Skip to content

Commit 0982198

Browse files
committed
Fix HideOnstartup Checkbox
1 parent 0cf7fa7 commit 0982198

File tree

2 files changed

+61
-48
lines changed

2 files changed

+61
-48
lines changed

Flow.Launcher/Resources/Pages/WelcomePage5.xaml

Lines changed: 51 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
<Page x:Class="Flow.Launcher.Resources.Pages.WelcomePage5"
2-
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3-
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4-
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
5-
xmlns:local="clr-namespace:Flow.Launcher.Resources.Pages"
6-
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
7-
xmlns:userSettings="clr-namespace:Flow.Launcher.Infrastructure.UserSettings;assembly=Flow.Launcher.Infrastructure"
8-
Title="WelcomePage5"
9-
d:DesignHeight="450"
10-
d:DesignWidth="800"
11-
DataContext="{Binding RelativeSource={RelativeSource Self}}"
12-
mc:Ignorable="d">
1+
<Page
2+
x:Class="Flow.Launcher.Resources.Pages.WelcomePage5"
3+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6+
xmlns:local="clr-namespace:Flow.Launcher.Resources.Pages"
7+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
8+
xmlns:userSettings="clr-namespace:Flow.Launcher.Infrastructure.UserSettings;assembly=Flow.Launcher.Infrastructure"
9+
Title="WelcomePage5"
10+
d:DesignHeight="450"
11+
d:DesignWidth="800"
12+
DataContext="{Binding RelativeSource={RelativeSource Self}}"
13+
mc:Ignorable="d">
1314
<Page.Resources>
1415
<Style x:Key="StyleImageFadeIn" TargetType="{x:Type Image}">
1516
<Setter Property="Opacity" Value="0" />
@@ -20,7 +21,10 @@
2021
<BeginStoryboard>
2122
<BeginStoryboard.Storyboard>
2223
<Storyboard x:Name="FadeIn">
23-
<DoubleAnimation Storyboard.TargetProperty="Opacity" To="1" Duration="0:0:2">
24+
<DoubleAnimation
25+
Storyboard.TargetProperty="Opacity"
26+
To="1"
27+
Duration="0:0:2">
2428
<DoubleAnimation.EasingFunction>
2529
<QuadraticEase EasingMode="EaseOut" />
2630
</DoubleAnimation.EasingFunction>
@@ -51,46 +55,49 @@
5155
</Border.Background>
5256

5357
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
54-
<Image Name="Logo"
55-
Width="90"
56-
Height="90"
57-
Source="../../images/app.png"
58-
Style="{DynamicResource StyleImageFadeIn}" />
58+
<Image
59+
Name="Logo"
60+
Width="90"
61+
Height="90"
62+
Source="../../images/app.png"
63+
Style="{DynamicResource StyleImageFadeIn}" />
5964
</StackPanel>
6065
</Border>
6166

6267
<StackPanel Grid.Row="1" Margin="24,20,24,20">
6368
<StackPanel>
64-
<TextBlock FontSize="20" FontWeight="SemiBold" Text="{DynamicResource Welcome_Page5_Title}" />
65-
<TextBlock Margin="0,10,0,0"
66-
FontSize="14"
67-
Text="{DynamicResource Welcome_Page5_Text01}"
68-
TextWrapping="WrapWithOverflow" />
69+
<TextBlock
70+
FontSize="20"
71+
FontWeight="SemiBold"
72+
Text="{DynamicResource Welcome_Page5_Title}" />
73+
<TextBlock
74+
Margin="0,10,0,0"
75+
FontSize="14"
76+
Text="{DynamicResource Welcome_Page5_Text01}"
77+
TextWrapping="WrapWithOverflow" />
6978
<StackPanel Margin="0,30,0,0" Orientation="Horizontal">
70-
<CheckBox IsChecked="{Binding Settings.HideOnStartup}" Style="{DynamicResource DefaultCheckBoxStyle}" />
71-
<TextBlock Margin="0,5,0,0"
72-
FontSize="14"
73-
FontWeight="SemiBold"
74-
Text="{DynamicResource hideOnStartup}" />
75-
79+
<CheckBox
80+
Checked="OnAutoStartupChecked"
81+
Content="{DynamicResource startFlowLauncherOnSystemStartup}"
82+
IsChecked="{Binding Settings.StartFlowLauncherOnSystemStartup}"
83+
Style="{DynamicResource DefaultCheckBoxStyle}"
84+
Unchecked="OnAutoStartupUncheck" />
7685
</StackPanel>
7786
<StackPanel Margin="0,0,0,0" Orientation="Horizontal">
78-
<CheckBox Checked="OnAutoStartupChecked"
79-
IsChecked="{Binding Settings.StartFlowLauncherOnSystemStartup}"
80-
Style="{DynamicResource DefaultCheckBoxStyle}"
81-
Unchecked="OnAutoStartupUncheck" />
82-
<TextBlock Margin="0,5,0,0"
83-
FontSize="14"
84-
FontWeight="SemiBold"
85-
Text="{DynamicResource startFlowLauncherOnSystemStartup}" />
86-
87+
<CheckBox
88+
Checked="OnHideOnStartupChecked"
89+
Content="{DynamicResource hideOnStartup}"
90+
IsChecked="{Binding Settings.HideOnStartup}"
91+
Style="{DynamicResource DefaultCheckBoxStyle}"
92+
Unchecked="OnHideOnStartupUnchecked" />
8793
</StackPanel>
88-
<Button Width="150"
89-
Height="40"
90-
Margin="0,60,0,0"
91-
HorizontalAlignment="Right"
92-
Content="{DynamicResource done}"
93-
Style="{DynamicResource AccentButtonStyle}" />
94+
<Button
95+
Width="150"
96+
Height="40"
97+
Margin="0,60,0,0"
98+
HorizontalAlignment="Right"
99+
Content="{DynamicResource done}"
100+
Style="{DynamicResource AccentButtonStyle}" />
94101
</StackPanel>
95102

96103
</StackPanel>

Flow.Launcher/Resources/Pages/WelcomePage5.xaml.cs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,11 @@
2121

2222
namespace Flow.Launcher.Resources.Pages
2323
{
24-
/// <summary>
25-
/// WelcomePage5.xaml에 대한 상호 작용 논리
26-
/// </summary>
2724
public partial class WelcomePage5 : Page
2825
{
2926
private const string StartupPath = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run";
3027
private readonly Settings settings;
31-
28+
public bool HideOnStartup { get; set; }
3229
public WelcomePage5(Settings settings)
3330
{
3431
InitializeComponent();
@@ -58,6 +55,15 @@ public void SetStartup()
5855
settings.StartFlowLauncherOnSystemStartup = true;
5956
}
6057

58+
private void OnHideOnStartupChecked(object sender, RoutedEventArgs e)
59+
{
60+
settings.HideOnStartup = true;
61+
62+
}
63+
private void OnHideOnStartupUnchecked(object sender, RoutedEventArgs e)
64+
{
65+
settings.HideOnStartup = false;
66+
}
6167

6268
}
6369
}

0 commit comments

Comments
 (0)