From 3b0551ff3708d2e9fa07d0c1b51de8d7674f29ea Mon Sep 17 00:00:00 2001 From: DB p Date: Wed, 31 Aug 2022 15:21:52 +0900 Subject: [PATCH 01/10] - Add Clock Code - Add Base Clock Style --- Flow.Launcher.sln | 1 - Flow.Launcher/MainWindow.xaml | 4 ++ Flow.Launcher/MainWindow.xaml.cs | 19 ++++++++- Flow.Launcher/Themes/Base.xaml | 70 ++++++++++++++++++++++++++++++++ 4 files changed, 91 insertions(+), 3 deletions(-) diff --git a/Flow.Launcher.sln b/Flow.Launcher.sln index ec4a29ee7..9d5f355d8 100644 --- a/Flow.Launcher.sln +++ b/Flow.Launcher.sln @@ -273,7 +273,6 @@ Global {4792A74A-0CEA-4173-A8B2-30E6764C6217}.Release|x86.ActiveCfg = Release|Any CPU {4792A74A-0CEA-4173-A8B2-30E6764C6217}.Release|x86.Build.0 = Release|Any CPU {5043CECE-E6A7-4867-9CBE-02D27D83747A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5043CECE-E6A7-4867-9CBE-02D27D83747A}.Debug|Any CPU.Build.0 = Debug|Any CPU {5043CECE-E6A7-4867-9CBE-02D27D83747A}.Debug|x64.ActiveCfg = Debug|Any CPU {5043CECE-E6A7-4867-9CBE-02D27D83747A}.Debug|x64.Build.0 = Debug|Any CPU {5043CECE-E6A7-4867-9CBE-02D27D83747A}.Debug|x86.ActiveCfg = Debug|Any CPU diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml index 714fcc53f..8bed94383 100644 --- a/Flow.Launcher/MainWindow.xaml +++ b/Flow.Launcher/MainWindow.xaml @@ -192,6 +192,10 @@ + + + + + + + + + + + @@ -105,19 +104,19 @@ x:Key="ClockBox" BasedOn="{StaticResource BaseClockBox}" TargetType="{x:Type TextBlock}"> - + + - - - - - + - - - - #2c313c - - - - - - - + + diff --git a/Flow.Launcher/Themes/BlurBlack Darker.xaml b/Flow.Launcher/Themes/BlurBlack Darker.xaml index 98ab77314..a26f45c63 100644 --- a/Flow.Launcher/Themes/BlurBlack Darker.xaml +++ b/Flow.Launcher/Themes/BlurBlack Darker.xaml @@ -1,79 +1,125 @@ - + True - - - - - - - - - - - #356ef3 - - - - + + diff --git a/Flow.Launcher/Themes/BlurWhite.xaml b/Flow.Launcher/Themes/BlurWhite.xaml index 99b5b222c..92ab9b5a3 100644 --- a/Flow.Launcher/Themes/BlurWhite.xaml +++ b/Flow.Launcher/Themes/BlurWhite.xaml @@ -1,71 +1,115 @@ - + True - - - - - + - - - #356ef3 - - - - + + diff --git a/Flow.Launcher/Themes/Darker Glass.xaml b/Flow.Launcher/Themes/Darker Glass.xaml index de37dd192..13c9e2bc5 100644 --- a/Flow.Launcher/Themes/Darker Glass.xaml +++ b/Flow.Launcher/Themes/Darker Glass.xaml @@ -1,84 +1,131 @@ - + - - - - - - + - - - #545454 - - - - - - + + diff --git a/Flow.Launcher/Themes/Darker.xaml b/Flow.Launcher/Themes/Darker.xaml index 675092bf8..b255c4d9e 100644 --- a/Flow.Launcher/Themes/Darker.xaml +++ b/Flow.Launcher/Themes/Darker.xaml @@ -1,51 +1,97 @@ - + - - - - + + + - - - #4d4d4d - - - + + + diff --git a/Flow.Launcher/Themes/Discord Dark.xaml b/Flow.Launcher/Themes/Discord Dark.xaml index 636fe7b6d..92b8d8da7 100644 --- a/Flow.Launcher/Themes/Discord Dark.xaml +++ b/Flow.Launcher/Themes/Discord Dark.xaml @@ -1,64 +1,101 @@ - + - - - - - - - - - - - - #49443c - - - - - - + + diff --git a/Flow.Launcher/Themes/Dracula.xaml b/Flow.Launcher/Themes/Dracula.xaml index c661d33e3..146038ba9 100644 --- a/Flow.Launcher/Themes/Dracula.xaml +++ b/Flow.Launcher/Themes/Dracula.xaml @@ -1,64 +1,100 @@ - + - - - - - - + - - - - #44475a - - - - - - - + + diff --git a/Flow.Launcher/Themes/Gray.xaml b/Flow.Launcher/Themes/Gray.xaml index c3cec7bd8..1cacc8ec2 100644 --- a/Flow.Launcher/Themes/Gray.xaml +++ b/Flow.Launcher/Themes/Gray.xaml @@ -1,61 +1,107 @@ - + - - - - - - - - - - #787878 - - - + + + diff --git a/Flow.Launcher/Themes/League.xaml b/Flow.Launcher/Themes/League.xaml index 06649978b..c64bf0a8b 100644 --- a/Flow.Launcher/Themes/League.xaml +++ b/Flow.Launcher/Themes/League.xaml @@ -1,61 +1,102 @@ - + - + - - - - - - - - - - + + #192026 - - - + + \ No newline at end of file diff --git a/Flow.Launcher/Themes/Metro Server.xaml b/Flow.Launcher/Themes/Metro Server.xaml index 016e6af9d..cbd70dbaf 100644 --- a/Flow.Launcher/Themes/Metro Server.xaml +++ b/Flow.Launcher/Themes/Metro Server.xaml @@ -1,48 +1,83 @@ - + - - - - - - - - - - + + #04152E - - - + + + \ No newline at end of file diff --git a/Flow.Launcher/Themes/Nord Darker.xaml b/Flow.Launcher/Themes/Nord Darker.xaml index 413effa51..7c29eda22 100644 --- a/Flow.Launcher/Themes/Nord Darker.xaml +++ b/Flow.Launcher/Themes/Nord Darker.xaml @@ -1,64 +1,110 @@ - + - - - - - - - - - - - #4e586b - - - + + diff --git a/Flow.Launcher/Themes/Nord.xaml b/Flow.Launcher/Themes/Nord.xaml index 2fcc11ef2..735041656 100644 --- a/Flow.Launcher/Themes/Nord.xaml +++ b/Flow.Launcher/Themes/Nord.xaml @@ -1,63 +1,109 @@ - + - - - - - - - - - - - #596479 - - - + + diff --git a/Flow.Launcher/Themes/Pink.xaml b/Flow.Launcher/Themes/Pink.xaml index cb5f56a8e..7e1ae911a 100644 --- a/Flow.Launcher/Themes/Pink.xaml +++ b/Flow.Launcher/Themes/Pink.xaml @@ -1,63 +1,102 @@ - + - + - - - - - - - - - - + + #cc1081 - - + @@ -74,4 +113,16 @@ + + \ No newline at end of file diff --git a/Flow.Launcher/Themes/Sublime.xaml b/Flow.Launcher/Themes/Sublime.xaml index 82fff06ff..1b6f25e83 100644 --- a/Flow.Launcher/Themes/Sublime.xaml +++ b/Flow.Launcher/Themes/Sublime.xaml @@ -1,64 +1,101 @@ - + - - - - - - - - - - - - #3c454e - - - - - - + + diff --git a/Flow.Launcher/Themes/Win10Light.xaml b/Flow.Launcher/Themes/Win10Light.xaml index 6f487a895..ad16f390e 100644 --- a/Flow.Launcher/Themes/Win10Light.xaml +++ b/Flow.Launcher/Themes/Win10Light.xaml @@ -1,67 +1,104 @@ - + - - - - - - - - - - - - #ccd0d4 - - - - - - + + diff --git a/Flow.Launcher/Themes/Win11Dark.xaml b/Flow.Launcher/Themes/Win11Dark.xaml index 31f6fb956..aa510acaf 100644 --- a/Flow.Launcher/Themes/Win11Dark.xaml +++ b/Flow.Launcher/Themes/Win11Dark.xaml @@ -156,4 +156,16 @@ + + diff --git a/Flow.Launcher/Themes/Win11Light.xaml b/Flow.Launcher/Themes/Win11Light.xaml index 33aa6cdee..2cba67760 100644 --- a/Flow.Launcher/Themes/Win11Light.xaml +++ b/Flow.Launcher/Themes/Win11Light.xaml @@ -1,64 +1,100 @@ - + - - - - - - + - - - - #198F8F8F - - - - - - - + + diff --git a/Flow.Launcher/Themes/Win11System.xaml b/Flow.Launcher/Themes/Win11System.xaml index bcc83be9f..3cf7fd123 100644 --- a/Flow.Launcher/Themes/Win11System.xaml +++ b/Flow.Launcher/Themes/Win11System.xaml @@ -156,4 +156,16 @@ + + From d2332abd95251f07f2df4e296cf423bb493307a0 Mon Sep 17 00:00:00 2001 From: DB p Date: Thu, 1 Sep 2022 16:19:00 +0900 Subject: [PATCH 06/10] - Add Clock/Date in SettingWindow --- .../UserSettings/Settings.cs | 2 +- Flow.Launcher/Languages/en.xaml | 2 + Flow.Launcher/MainWindow.xaml.cs | 30 ++++++- Flow.Launcher/SettingWindow.xaml | 78 ++++++++++++++++--- .../ViewModel/SettingWindowViewModel.cs | 13 ++++ 5 files changed, 114 insertions(+), 11 deletions(-) diff --git a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs index b5f2ac18e..6b783a210 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs @@ -42,7 +42,7 @@ namespace Flow.Launcher.Infrastructure.UserSettings public bool UseAnimation { get; set; } = true; public bool UseSound { get; set; } = true; public bool UseClock { get; set; } = true; - public bool UseDate { get; set; } = true; + public bool UseDate { get; set; } = false; public bool FirstLaunch { get; set; } = true; public int CustomExplorerIndex { get; set; } = 0; diff --git a/Flow.Launcher/Languages/en.xaml b/Flow.Launcher/Languages/en.xaml index bdf745052..79afe0998 100644 --- a/Flow.Launcher/Languages/en.xaml +++ b/Flow.Launcher/Languages/en.xaml @@ -105,6 +105,8 @@ Play a small sound when the search window opens Animation Use Animation in UI + Clock + Date Hotkey diff --git a/Flow.Launcher/MainWindow.xaml.cs b/Flow.Launcher/MainWindow.xaml.cs index 1fcccd8d2..080486c5e 100644 --- a/Flow.Launcher/MainWindow.xaml.cs +++ b/Flow.Launcher/MainWindow.xaml.cs @@ -81,6 +81,29 @@ namespace Flow.Launcher } + } + + public void ClockDisplay() + { + if (_settings.UseClock == true) + { + ClockBox.Visibility = Visibility.Visible; + ClockBox.Text = System.DateTime.Now.ToString("tt hh:mm"); + } + else if (_settings.UseClock == false) + { + ClockBox.Visibility = Visibility.Collapsed; + } + if (_settings.UseDate == true) + { + DateBox.Visibility = Visibility.Visible; + DateBox.Text = System.DateTime.Now.ToString("MM/dd ddd"); + } + else if (_settings.UseDate == false) + { + DateBox.Visibility = Visibility.Collapsed; + } + } private void OnCopy(object sender, ExecutedRoutedEventArgs e) { @@ -206,6 +229,12 @@ namespace Flow.Launcher case nameof(Settings.Hotkey): UpdateNotifyIconText(); break; + case nameof(Settings.UseClock): + ClockDisplay(); + break; + case nameof(Settings.UseDate): + ClockDisplay(); + break; } }; } @@ -378,7 +407,6 @@ namespace Flow.Launcher _settings.WindowLeft = Left; _settings.WindowTop = Top; iconsb.Begin(SearchIcon); - iconsb.Begin(ClockPanel); sb.Begin(FlowMainWindow); } diff --git a/Flow.Launcher/SettingWindow.xaml b/Flow.Launcher/SettingWindow.xaml index 06c9549e2..144edf5d1 100644 --- a/Flow.Launcher/SettingWindow.xaml +++ b/Flow.Launcher/SettingWindow.xaml @@ -597,9 +597,7 @@ - + @@ -1555,8 +1553,17 @@ IsReadOnly="True" Style="{DynamicResource QueryBoxStyle}" Text="{DynamicResource hiThere}" /> - + + + + + SelectedItem="{Binding SelectedQueryBoxFont}" /> + SelectedItem="{Binding SelectedResultFont}" /> + + + + + + + + +  + + + + + + + + + + + +  + + + + + + + diff --git a/Flow.Launcher/ViewModel/SettingWindowViewModel.cs b/Flow.Launcher/ViewModel/SettingWindowViewModel.cs index a63e54f3b..95758c471 100644 --- a/Flow.Launcher/ViewModel/SettingWindowViewModel.cs +++ b/Flow.Launcher/ViewModel/SettingWindowViewModel.cs @@ -385,6 +385,19 @@ namespace Flow.Launcher.ViewModel set => Settings.UseSound = value; } + public bool UseClock + { + get => Settings.UseClock; + set => Settings.UseClock = value; + } + + public bool UseDate + { + get => Settings.UseDate; + set => Settings.UseDate = value; + } + + public Brush PreviewBackground { get From 8e6af08b4df3f8b7c3bd01038e0338f071e6a7fb Mon Sep 17 00:00:00 2001 From: DB p Date: Mon, 5 Sep 2022 13:47:16 +0900 Subject: [PATCH 07/10] Add Clock/Date Format Combobox UI in settingswindow --- Flow.Launcher/SettingWindow.xaml | 38 +++++++++++++++++++++++++---- Flow.Launcher/SettingWindow.xaml.cs | 5 ++++ 2 files changed, 38 insertions(+), 5 deletions(-) diff --git a/Flow.Launcher/SettingWindow.xaml b/Flow.Launcher/SettingWindow.xaml index 88b80a89f..ca310fce8 100644 --- a/Flow.Launcher/SettingWindow.xaml +++ b/Flow.Launcher/SettingWindow.xaml @@ -1897,13 +1897,27 @@ - + + + @@ -1921,13 +1935,27 @@ + + + diff --git a/Flow.Launcher/SettingWindow.xaml.cs b/Flow.Launcher/SettingWindow.xaml.cs index 10c9aeffe..452538485 100644 --- a/Flow.Launcher/SettingWindow.xaml.cs +++ b/Flow.Launcher/SettingWindow.xaml.cs @@ -348,5 +348,10 @@ namespace Flow.Launcher { Plugins.ScrollIntoView(Plugins.SelectedItem); } + + private void ColorSchemeSelectedIndexChanged(object sender, SelectionChangedEventArgs e) + { + + } } } From 7ae6f2ac7dbfd15d9685b66f0bdb653b89853720 Mon Sep 17 00:00:00 2001 From: DB p Date: Mon, 5 Sep 2022 15:48:10 +0900 Subject: [PATCH 08/10] - Add Timeformat to changable list --- .../UserSettings/Settings.cs | 2 ++ Flow.Launcher/MainWindow.xaml.cs | 23 ++------------- Flow.Launcher/SettingWindow.xaml | 29 +++++++------------ .../ViewModel/SettingWindowViewModel.cs | 19 ++++++++++++ 4 files changed, 35 insertions(+), 38 deletions(-) diff --git a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs index 6b783a210..26b89be86 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs @@ -43,6 +43,8 @@ namespace Flow.Launcher.Infrastructure.UserSettings public bool UseSound { get; set; } = true; public bool UseClock { get; set; } = true; public bool UseDate { get; set; } = false; + public string TimeFormat { get; set; } = "hh:mm tt "; + public string DateFormat { get; set; } = "MM'/'dd ddd"; public bool FirstLaunch { get; set; } = true; public int CustomExplorerIndex { get; set; } = 0; diff --git a/Flow.Launcher/MainWindow.xaml.cs b/Flow.Launcher/MainWindow.xaml.cs index 080486c5e..bc18d8dbc 100644 --- a/Flow.Launcher/MainWindow.xaml.cs +++ b/Flow.Launcher/MainWindow.xaml.cs @@ -63,24 +63,7 @@ namespace Flow.Launcher } private void Timer_Tick(object sender, EventArgs e) { - if (_settings.UseClock == true) - { - ClockBox.Text = System.DateTime.Now.ToString("tt hh:mm"); - } - else if(_settings.UseClock == false) - { - ClockBox.Visibility = Visibility.Collapsed; - } - if (_settings.UseDate == true) - { - DateBox.Text = System.DateTime.Now.ToString("MM/dd ddd"); - } - else if (_settings.UseDate == false) - { - DateBox.Visibility = Visibility.Collapsed; - } - - + ClockDisplay(); } public void ClockDisplay() @@ -88,7 +71,7 @@ namespace Flow.Launcher if (_settings.UseClock == true) { ClockBox.Visibility = Visibility.Visible; - ClockBox.Text = System.DateTime.Now.ToString("tt hh:mm"); + ClockBox.Text = System.DateTime.Now.ToString(_settings.TimeFormat); } else if (_settings.UseClock == false) { @@ -97,7 +80,7 @@ namespace Flow.Launcher if (_settings.UseDate == true) { DateBox.Visibility = Visibility.Visible; - DateBox.Text = System.DateTime.Now.ToString("MM/dd ddd"); + DateBox.Text = System.DateTime.Now.ToString(_settings.DateFormat); } else if (_settings.UseDate == false) { diff --git a/Flow.Launcher/SettingWindow.xaml b/Flow.Launcher/SettingWindow.xaml index ca310fce8..0c92f073f 100644 --- a/Flow.Launcher/SettingWindow.xaml +++ b/Flow.Launcher/SettingWindow.xaml @@ -1,17 +1,16 @@ + ItemsSource="{Binding TimeFormatList}" + SelectedValue="{Binding Settings.TimeFormat}"/> + ItemsSource="{Binding DateFormatList}" + SelectedValue="{Binding Settings.DateFormat}" + /> TimeFormatList { get; set; } = new List() + { + "hh:mm", + "HH:mm", + "tt hh:mm", + "hh:mm tt" + }; + + public List DateFormatList { get; set; } = new List() + { + "MM'/'dd dddd", + "MM'/'dd ddd", + "MM'/'dd", + "dd'/'MM", + "ddd MM'/'dd", + "dddd MM'/'dd", + "dddd" + }; + public double WindowWidthSize { get => Settings.WindowSize; From 7e0ef2a400954bb674e1c640095ef098d2c4435c Mon Sep 17 00:00:00 2001 From: DB p Date: Mon, 5 Sep 2022 16:58:56 +0900 Subject: [PATCH 09/10] - Refresh Preview when Change Time/Date Format --- Flow.Launcher/SettingWindow.xaml | 92 ++++++++++++++--------------- Flow.Launcher/SettingWindow.xaml.cs | 28 +++++++++ 2 files changed, 73 insertions(+), 47 deletions(-) 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; + } + + } } } From 61cdc73068b70c606cdc68621a8c8d7013a9bd2f Mon Sep 17 00:00:00 2001 From: DB p Date: Mon, 5 Sep 2022 19:44:30 +0900 Subject: [PATCH 10/10] - Toggle Clock/Date Display in Theme Preview --- Flow.Launcher/SettingWindow.xaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Flow.Launcher/SettingWindow.xaml b/Flow.Launcher/SettingWindow.xaml index e960b7355..8dd2a3814 100644 --- a/Flow.Launcher/SettingWindow.xaml +++ b/Flow.Launcher/SettingWindow.xaml @@ -1908,7 +1908,8 @@ IsOn="{Binding UseClock, Mode=TwoWay}" OffContent="{DynamicResource disable}" OnContent="{DynamicResource enable}" - Style="{DynamicResource SideToggleSwitch}" /> + Style="{DynamicResource SideToggleSwitch}" + Toggled="PreviewClockAndDate" />  @@ -1945,7 +1946,8 @@ IsOn="{Binding UseDate, Mode=TwoWay}" OffContent="{DynamicResource disable}" OnContent="{DynamicResource enable}" - Style="{DynamicResource SideToggleSwitch}" /> + Style="{DynamicResource SideToggleSwitch}" + Toggled="PreviewClockAndDate" />