diff --git a/Flow.Launcher/SettingWindow.xaml b/Flow.Launcher/SettingWindow.xaml index 0c92f073f..e960b7355 100644 --- a/Flow.Launcher/SettingWindow.xaml +++ b/Flow.Launcher/SettingWindow.xaml @@ -1,16 +1,16 @@ - - + + - - + + + IsOn="{Binding UseClock, Mode=TwoWay}" + OffContent="{DynamicResource disable}" + OnContent="{DynamicResource enable}" + Style="{DynamicResource SideToggleSwitch}" /> @@ -1931,23 +1927,25 @@ - - - + + + diff --git a/Flow.Launcher/SettingWindow.xaml.cs b/Flow.Launcher/SettingWindow.xaml.cs index 452538485..3672053a8 100644 --- a/Flow.Launcher/SettingWindow.xaml.cs +++ b/Flow.Launcher/SettingWindow.xaml.cs @@ -54,6 +54,7 @@ namespace Flow.Launcher HwndSource hwndSource = PresentationSource.FromVisual(this) as HwndSource; HwndTarget hwndTarget = hwndSource.CompositionTarget; hwndTarget.RenderMode = RenderMode.SoftwareOnly; + ClockDisplay(); } private void OnSelectPythonDirectoryClick(object sender, RoutedEventArgs e) @@ -353,5 +354,32 @@ namespace Flow.Launcher { } + + private void PreviewClockAndDate(object sender, RoutedEventArgs e) + { + ClockDisplay(); + } + public void ClockDisplay() + { + if (settings.UseClock == true) + { + ClockBox.Visibility = Visibility.Visible; + ClockBox.Text = System.DateTime.Now.ToString(settings.TimeFormat); + } + else if (settings.UseClock == false) + { + ClockBox.Visibility = Visibility.Collapsed; + } + if (settings.UseDate == true) + { + DateBox.Visibility = Visibility.Visible; + DateBox.Text = System.DateTime.Now.ToString(settings.DateFormat); + } + else if (settings.UseDate == false) + { + DateBox.Visibility = Visibility.Collapsed; + } + + } } }