Fix HideOnstartup Checkbox

This commit is contained in:
DB p 2021-12-02 15:14:48 +09:00
parent 0cf7fa7c17
commit 0982198bc3
2 changed files with 61 additions and 48 deletions

View file

@ -1,15 +1,16 @@
<Page x:Class="Flow.Launcher.Resources.Pages.WelcomePage5"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Flow.Launcher.Resources.Pages"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:userSettings="clr-namespace:Flow.Launcher.Infrastructure.UserSettings;assembly=Flow.Launcher.Infrastructure"
Title="WelcomePage5"
d:DesignHeight="450"
d:DesignWidth="800"
DataContext="{Binding RelativeSource={RelativeSource Self}}"
mc:Ignorable="d">
<Page
x:Class="Flow.Launcher.Resources.Pages.WelcomePage5"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Flow.Launcher.Resources.Pages"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:userSettings="clr-namespace:Flow.Launcher.Infrastructure.UserSettings;assembly=Flow.Launcher.Infrastructure"
Title="WelcomePage5"
d:DesignHeight="450"
d:DesignWidth="800"
DataContext="{Binding RelativeSource={RelativeSource Self}}"
mc:Ignorable="d">
<Page.Resources>
<Style x:Key="StyleImageFadeIn" TargetType="{x:Type Image}">
<Setter Property="Opacity" Value="0" />
@ -20,7 +21,10 @@
<BeginStoryboard>
<BeginStoryboard.Storyboard>
<Storyboard x:Name="FadeIn">
<DoubleAnimation Storyboard.TargetProperty="Opacity" To="1" Duration="0:0:2">
<DoubleAnimation
Storyboard.TargetProperty="Opacity"
To="1"
Duration="0:0:2">
<DoubleAnimation.EasingFunction>
<QuadraticEase EasingMode="EaseOut" />
</DoubleAnimation.EasingFunction>
@ -51,46 +55,49 @@
</Border.Background>
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
<Image Name="Logo"
Width="90"
Height="90"
Source="../../images/app.png"
Style="{DynamicResource StyleImageFadeIn}" />
<Image
Name="Logo"
Width="90"
Height="90"
Source="../../images/app.png"
Style="{DynamicResource StyleImageFadeIn}" />
</StackPanel>
</Border>
<StackPanel Grid.Row="1" Margin="24,20,24,20">
<StackPanel>
<TextBlock FontSize="20" FontWeight="SemiBold" Text="{DynamicResource Welcome_Page5_Title}" />
<TextBlock Margin="0,10,0,0"
FontSize="14"
Text="{DynamicResource Welcome_Page5_Text01}"
TextWrapping="WrapWithOverflow" />
<TextBlock
FontSize="20"
FontWeight="SemiBold"
Text="{DynamicResource Welcome_Page5_Title}" />
<TextBlock
Margin="0,10,0,0"
FontSize="14"
Text="{DynamicResource Welcome_Page5_Text01}"
TextWrapping="WrapWithOverflow" />
<StackPanel Margin="0,30,0,0" Orientation="Horizontal">
<CheckBox IsChecked="{Binding Settings.HideOnStartup}" Style="{DynamicResource DefaultCheckBoxStyle}" />
<TextBlock Margin="0,5,0,0"
FontSize="14"
FontWeight="SemiBold"
Text="{DynamicResource hideOnStartup}" />
<CheckBox
Checked="OnAutoStartupChecked"
Content="{DynamicResource startFlowLauncherOnSystemStartup}"
IsChecked="{Binding Settings.StartFlowLauncherOnSystemStartup}"
Style="{DynamicResource DefaultCheckBoxStyle}"
Unchecked="OnAutoStartupUncheck" />
</StackPanel>
<StackPanel Margin="0,0,0,0" Orientation="Horizontal">
<CheckBox Checked="OnAutoStartupChecked"
IsChecked="{Binding Settings.StartFlowLauncherOnSystemStartup}"
Style="{DynamicResource DefaultCheckBoxStyle}"
Unchecked="OnAutoStartupUncheck" />
<TextBlock Margin="0,5,0,0"
FontSize="14"
FontWeight="SemiBold"
Text="{DynamicResource startFlowLauncherOnSystemStartup}" />
<CheckBox
Checked="OnHideOnStartupChecked"
Content="{DynamicResource hideOnStartup}"
IsChecked="{Binding Settings.HideOnStartup}"
Style="{DynamicResource DefaultCheckBoxStyle}"
Unchecked="OnHideOnStartupUnchecked" />
</StackPanel>
<Button Width="150"
Height="40"
Margin="0,60,0,0"
HorizontalAlignment="Right"
Content="{DynamicResource done}"
Style="{DynamicResource AccentButtonStyle}" />
<Button
Width="150"
Height="40"
Margin="0,60,0,0"
HorizontalAlignment="Right"
Content="{DynamicResource done}"
Style="{DynamicResource AccentButtonStyle}" />
</StackPanel>
</StackPanel>

View file

@ -21,14 +21,11 @@ using Flow.Launcher.ViewModel;
namespace Flow.Launcher.Resources.Pages
{
/// <summary>
/// WelcomePage5.xaml에 대한 상호 작용 논리
/// </summary>
public partial class WelcomePage5 : Page
{
private const string StartupPath = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run";
private readonly Settings settings;
public bool HideOnStartup { get; set; }
public WelcomePage5(Settings settings)
{
InitializeComponent();
@ -58,6 +55,15 @@ namespace Flow.Launcher.Resources.Pages
settings.StartFlowLauncherOnSystemStartup = true;
}
private void OnHideOnStartupChecked(object sender, RoutedEventArgs e)
{
settings.HideOnStartup = true;
}
private void OnHideOnStartupUnchecked(object sender, RoutedEventArgs e)
{
settings.HideOnStartup = false;
}
}
}