From 3b0551ff3708d2e9fa07d0c1b51de8d7674f29ea Mon Sep 17 00:00:00 2001 From: DB p Date: Wed, 31 Aug 2022 15:21:52 +0900 Subject: [PATCH 01/80] - 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/80] - 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/80] 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/80] - 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/80] - 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/80] - 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" />  From 0566a6c6d697bed0449fe371c5d803d08981b4d7 Mon Sep 17 00:00:00 2001 From: DB p Date: Tue, 27 Sep 2022 19:52:40 +0900 Subject: [PATCH 11/80] Change the clock to it cannot be clicked --- Flow.Launcher/MainWindow.xaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml index bc1dda0e5..7e4c75541 100644 --- a/Flow.Launcher/MainWindow.xaml +++ b/Flow.Launcher/MainWindow.xaml @@ -193,7 +193,7 @@ - + From 52cd8a8c3381e20d5997887b5cf5f605536f29b5 Mon Sep 17 00:00:00 2001 From: DB p Date: Mon, 3 Oct 2022 15:06:44 +0900 Subject: [PATCH 12/80] Adjust Clock Code --- Flow.Launcher/MainWindow.xaml.cs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Flow.Launcher/MainWindow.xaml.cs b/Flow.Launcher/MainWindow.xaml.cs index bc18d8dbc..4eac8f9b5 100644 --- a/Flow.Launcher/MainWindow.xaml.cs +++ b/Flow.Launcher/MainWindow.xaml.cs @@ -22,6 +22,7 @@ using Flow.Launcher.Infrastructure.Hotkey; using Flow.Launcher.Plugin.SharedCommands; using System.Windows.Threading; using System.Globalization; +using System.Reflection.Emit; namespace Flow.Launcher { @@ -47,11 +48,15 @@ namespace Flow.Launcher _settings = settings; - DispatcherTimer timer = new DispatcherTimer(); - timer.Interval = new TimeSpan(0, 0, 1); - timer.Tick += Timer_Tick; + var timer = new Timer + { + Interval = 1000, + }; + timer.Tick += (s, evt) => + { + ClockDisplay(); + }; timer.Start(); - InitializeComponent(); InitializePosition(); animationSound.Open(new Uri(AppDomain.CurrentDomain.BaseDirectory + "Resources\\open.wav")); @@ -61,10 +66,6 @@ namespace Flow.Launcher { InitializeComponent(); } - private void Timer_Tick(object sender, EventArgs e) - { - ClockDisplay(); - } public void ClockDisplay() { From aa75aa64f9e7d2079e769f9a8e34611443691515 Mon Sep 17 00:00:00 2001 From: DB p Date: Mon, 3 Oct 2022 15:22:59 +0900 Subject: [PATCH 13/80] Fix Formatting --- Flow.Launcher/SettingWindow.xaml.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Flow.Launcher/SettingWindow.xaml.cs b/Flow.Launcher/SettingWindow.xaml.cs index d3d1c1f13..e0b8498ae 100644 --- a/Flow.Launcher/SettingWindow.xaml.cs +++ b/Flow.Launcher/SettingWindow.xaml.cs @@ -381,7 +381,7 @@ namespace Flow.Launcher { DateBox.Visibility = Visibility.Collapsed; } - + } private void OnExternalPluginUninstallClick(object sender, MouseButtonEventArgs e) { @@ -394,5 +394,6 @@ namespace Flow.Launcher API.ShowMainWindow(); } } + } } From 26b14c4b5f405031ee6e10fc7798d7dd61dfa6c7 Mon Sep 17 00:00:00 2001 From: DB p Date: Fri, 7 Oct 2022 16:34:08 +0900 Subject: [PATCH 14/80] Add Install/New/Updated Label in plugin store --- .../ExternalPlugins/UserPlugin.cs | 11 +++- .../Converters/BoolToVisibilityConverter.cs | 43 ++++++++++++++++ Flow.Launcher/Languages/en.xaml | 8 +++ Flow.Launcher/SettingWindow.xaml | 34 ++++++++++--- .../ViewModel/SettingWindowViewModel.cs | 51 ++++++++++++++++++- 5 files changed, 137 insertions(+), 10 deletions(-) create mode 100644 Flow.Launcher/Converters/BoolToVisibilityConverter.cs diff --git a/Flow.Launcher.Core/ExternalPlugins/UserPlugin.cs b/Flow.Launcher.Core/ExternalPlugins/UserPlugin.cs index f98815c1a..0bea2e0e1 100644 --- a/Flow.Launcher.Core/ExternalPlugins/UserPlugin.cs +++ b/Flow.Launcher.Core/ExternalPlugins/UserPlugin.cs @@ -1,4 +1,6 @@ -namespace Flow.Launcher.Core.ExternalPlugins +using System; + +namespace Flow.Launcher.Core.ExternalPlugins { public record UserPlugin { @@ -12,5 +14,12 @@ public string UrlDownload { get; set; } public string UrlSourceCode { get; set; } public string IcoPath { get; set; } + public DateTime LatestReleaseDate { get; set; } + public DateTime DateAdded { get; set; } + + /* Label Data for Plugin Store */ + public bool LabelNew { get; set; } + public bool LabelInstalled { get; set; } + public bool LabelUpdated { get; set; } } } diff --git a/Flow.Launcher/Converters/BoolToVisibilityConverter.cs b/Flow.Launcher/Converters/BoolToVisibilityConverter.cs new file mode 100644 index 000000000..ad474d693 --- /dev/null +++ b/Flow.Launcher/Converters/BoolToVisibilityConverter.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; + +namespace Flow.Launcher.Converters +{ + public class BoolToVisibilityConverter : IValueConverter + { + public object Convert(object value, System.Type targetType, object parameter, CultureInfo culture) + { + if (parameter != null) + { + if (value is true) + { + return Visibility.Collapsed; + } + + else + { + return Visibility.Visible; + } + } + else { + if (value is true) + { + return Visibility.Visible; + } + + else { + return Visibility.Collapsed; + } + } + } + + public object ConvertBack(object value, System.Type targetType, object parameter, CultureInfo culture) => throw new System.InvalidOperationException(); + } +} diff --git a/Flow.Launcher/Languages/en.xaml b/Flow.Launcher/Languages/en.xaml index b2018254c..e047fd685 100644 --- a/Flow.Launcher/Languages/en.xaml +++ b/Flow.Launcher/Languages/en.xaml @@ -88,6 +88,14 @@ Plugin Store Refresh Install + Installed + Plug-in already installed + New + This is a newly registered plug-in in 7 days + Updated + This plug-in has been updated within the last 5 days + + Theme diff --git a/Flow.Launcher/SettingWindow.xaml b/Flow.Launcher/SettingWindow.xaml index 7fc583777..d9ec94f98 100644 --- a/Flow.Launcher/SettingWindow.xaml +++ b/Flow.Launcher/SettingWindow.xaml @@ -38,6 +38,7 @@ + @@ -1513,11 +1514,27 @@ VerticalAlignment="Top" Background="#f14551" CornerRadius="4" - Visibility="Collapsed"> + ToolTip="{DynamicResource LabelNewToolTip}" + Visibility="{Binding LabelNew, Converter={StaticResource BoolToVisibilityConverter}}"> + Foreground="{DynamicResource Color01B}" + Text="{DynamicResource LabelNew}" /> + + + + ToolTip="{DynamicResource LabelInstalledToolTip}" + Visibility="{Binding LabelInstalled, Converter={StaticResource BoolToVisibilityConverter}}"> + Foreground="{DynamicResource Color01B}" + Text="{DynamicResource LabelInstalled}" /> @@ -1670,7 +1688,9 @@ HorizontalAlignment="Right" VerticalAlignment="Center" Click="OnExternalPluginInstallClick" - Content="{DynamicResource install}" /> + Content="{DynamicResource install}" + Visibility="{Binding LabelInstalled, Converter={StaticResource BoolToVisibilityConverter}, ConverterParameter='!'}" /> + diff --git a/Flow.Launcher/ViewModel/SettingWindowViewModel.cs b/Flow.Launcher/ViewModel/SettingWindowViewModel.cs index a63e54f3b..3a21a38cb 100644 --- a/Flow.Launcher/ViewModel/SettingWindowViewModel.cs +++ b/Flow.Launcher/ViewModel/SettingWindowViewModel.cs @@ -1,11 +1,14 @@ using System; +using System.Collections; using System.Collections.Generic; +using System.Diagnostics; using System.IO; using System.Linq; using System.Net; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; +using System.Windows.Documents; using System.Windows.Media; using System.Windows.Media.Imaging; using Flow.Launcher.Core; @@ -19,6 +22,8 @@ using Flow.Launcher.Infrastructure.Storage; using Flow.Launcher.Infrastructure.UserSettings; using Flow.Launcher.Plugin; using Flow.Launcher.Plugin.SharedModels; +using Microsoft.FSharp.Data.UnitSystems.SI.UnitNames; +using Windows.Management.Deployment.Preview; namespace Flow.Launcher.ViewModel { @@ -241,7 +246,8 @@ namespace Flow.Launcher.ViewModel #region plugin - public static string Plugin => @"https://github.com/Flow-Launcher/Flow.Launcher.PluginsManifest"; + //public static string Plugin => @"https://github.com/Flow-Launcher/Flow.Launcher.PluginsManifest"; + public static string Plugin => @"https://raw.githubusercontent.com/Flow-Launcher/Flow.Launcher.PluginsManifest/plugin_api_v2/plugins.json"; public PluginViewModel SelectedPlugin { get; set; } public IList PluginViewModels @@ -261,10 +267,51 @@ namespace Flow.Launcher.ViewModel { get { - return PluginsManifest.UserPlugins; + return LabelMaker(PluginsManifest.UserPlugins); } } + private IList LabelMaker(IList list) + { + foreach (UserPlugin item in list) + { + item.LabelNew = false; + item.LabelInstalled = false; + item.LabelUpdated = false; + + foreach (var vm in PluginViewModels) + { + + var id = vm.PluginPair.Metadata.ID; + if (item.ID == vm.PluginPair.Metadata.ID) // Add Installed Label + { + item.LabelInstalled = true; + } + + TimeSpan UpdatedDay = DateTime.Now.Subtract(item.LatestReleaseDate); + int LastUpdated = UpdatedDay.Days; + + if (LastUpdated <= 5) // Add Updated Label + { + item.LabelUpdated = true; + } + } + TimeSpan AddedDay = DateTime.Now.Subtract(item.DateAdded); + int DateAdded = AddedDay.Days; + if (DateAdded <= 7) + { + + //item.LabelNew = true; // Add New Label + //item.LabelUpdated = false; // Hide Updated Label when Added New Label. New and Update doesn't show both same time. + } + } + + // New first, Updated second. Installed to bottom of list. + list = list.OrderByDescending(x => x.LabelNew).OrderByDescending(x => x.LabelUpdated).ThenBy(y => y.LabelInstalled).ToList(); + + return list; + } + public Control SettingProvider { get From 15df419a5e1185ac67853ee97d812b8dfb6b3ec6 Mon Sep 17 00:00:00 2001 From: DB p Date: Sat, 8 Oct 2022 09:47:38 +0900 Subject: [PATCH 15/80] - Change list order - remove comment --- Flow.Launcher/ViewModel/SettingWindowViewModel.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Flow.Launcher/ViewModel/SettingWindowViewModel.cs b/Flow.Launcher/ViewModel/SettingWindowViewModel.cs index 6e76e31c1..fd0f49c82 100644 --- a/Flow.Launcher/ViewModel/SettingWindowViewModel.cs +++ b/Flow.Launcher/ViewModel/SettingWindowViewModel.cs @@ -267,8 +267,7 @@ namespace Flow.Launcher.ViewModel #region plugin - //public static string Plugin => @"https://github.com/Flow-Launcher/Flow.Launcher.PluginsManifest"; - public static string Plugin => @"https://raw.githubusercontent.com/Flow-Launcher/Flow.Launcher.PluginsManifest/plugin_api_v2/plugins.json"; + public static string Plugin => @"https://github.com/Flow-Launcher/Flow.Launcher.PluginsManifest"; public PluginViewModel SelectedPlugin { get; set; } public IList PluginViewModels @@ -322,8 +321,8 @@ namespace Flow.Launcher.ViewModel if (DateAdded <= 7) { - //item.LabelNew = true; // Add New Label - //item.LabelUpdated = false; // Hide Updated Label when Added New Label. New and Update doesn't show both same time. + item.LabelNew = true; // Add New Label + item.LabelUpdated = false; // Hide Updated Label when Added New Label. New and Update doesn't show both same time. } } From bc47671129d9b223951e3131c5f69cd4778f02e5 Mon Sep 17 00:00:00 2001 From: Hongtao Zhang Date: Sat, 8 Oct 2022 01:57:41 -0500 Subject: [PATCH 16/80] User ViewModel to separate logic --- .../ExternalPlugins/UserPlugin.cs | 4 -- .../ViewModel/PluginStoreItemViewModel.cs | 27 +++++++++++ .../ViewModel/SettingWindowViewModel.cs | 46 +++---------------- 3 files changed, 34 insertions(+), 43 deletions(-) create mode 100644 Flow.Launcher/ViewModel/PluginStoreItemViewModel.cs diff --git a/Flow.Launcher.Core/ExternalPlugins/UserPlugin.cs b/Flow.Launcher.Core/ExternalPlugins/UserPlugin.cs index 0bea2e0e1..bb1279b2c 100644 --- a/Flow.Launcher.Core/ExternalPlugins/UserPlugin.cs +++ b/Flow.Launcher.Core/ExternalPlugins/UserPlugin.cs @@ -17,9 +17,5 @@ namespace Flow.Launcher.Core.ExternalPlugins public DateTime LatestReleaseDate { get; set; } public DateTime DateAdded { get; set; } - /* Label Data for Plugin Store */ - public bool LabelNew { get; set; } - public bool LabelInstalled { get; set; } - public bool LabelUpdated { get; set; } } } diff --git a/Flow.Launcher/ViewModel/PluginStoreItemViewModel.cs b/Flow.Launcher/ViewModel/PluginStoreItemViewModel.cs new file mode 100644 index 000000000..94b435f1a --- /dev/null +++ b/Flow.Launcher/ViewModel/PluginStoreItemViewModel.cs @@ -0,0 +1,27 @@ +using System; +using Flow.Launcher.Core.ExternalPlugins; +using Flow.Launcher.Core.Plugin; +using Flow.Launcher.Plugin; + +namespace Flow.Launcher.ViewModel +{ + public class PluginStoreItemViewModel : BaseModel + { + public PluginStoreItemViewModel(UserPlugin plugin) + { + _plugin = plugin; + } + + private UserPlugin _plugin; + + public string Name => _plugin.Name; + public string Description => _plugin.Description; + public string Author => _plugin.Author; + public string Version => _plugin.Version; + + + public bool LabelNew => _plugin.LatestReleaseDate-DateTime.Now < TimeSpan.FromDays(7); + public bool LabelInstalled => PluginManager.GetPluginForId(_plugin.ID) != null; + public bool LabelUpdated => _plugin.DateAdded -DateTime.Now < TimeSpan.FromDays(7); + } +} diff --git a/Flow.Launcher/ViewModel/SettingWindowViewModel.cs b/Flow.Launcher/ViewModel/SettingWindowViewModel.cs index fd0f49c82..99a05548f 100644 --- a/Flow.Launcher/ViewModel/SettingWindowViewModel.cs +++ b/Flow.Launcher/ViewModel/SettingWindowViewModel.cs @@ -283,7 +283,7 @@ namespace Flow.Launcher.ViewModel } } - public IList ExternalPlugins + public IList ExternalPlugins { get { @@ -291,45 +291,13 @@ namespace Flow.Launcher.ViewModel } } - private IList LabelMaker(IList list) + private IList LabelMaker(IList list) { - foreach (UserPlugin item in list) - { - item.LabelNew = false; - item.LabelInstalled = false; - item.LabelUpdated = false; - - foreach (var vm in PluginViewModels) - { - - var id = vm.PluginPair.Metadata.ID; - if (item.ID == vm.PluginPair.Metadata.ID) // Add Installed Label - { - item.LabelInstalled = true; - } - - TimeSpan UpdatedDay = DateTime.Now.Subtract(item.LatestReleaseDate); - int LastUpdated = UpdatedDay.Days; - - if (LastUpdated <= 5) // Add Updated Label - { - item.LabelUpdated = true; - } - } - TimeSpan AddedDay = DateTime.Now.Subtract(item.DateAdded); - int DateAdded = AddedDay.Days; - if (DateAdded <= 7) - { - - item.LabelNew = true; // Add New Label - item.LabelUpdated = false; // Hide Updated Label when Added New Label. New and Update doesn't show both same time. - } - } - - // New first, Updated second. Installed to bottom of list. - list = list.OrderByDescending(x => x.LabelNew).OrderByDescending(x => x.LabelUpdated).ThenBy(y => y.LabelInstalled).ToList(); - - return list; + return list.Select(p=>new PluginStoreItemViewModel(p)) + .OrderBy(p=>p.LabelNew) + .ThenByDescending(p=>p.LabelUpdated) + .ThenBy(p=>p.LabelInstalled) + .ToList(); } public Control SettingProvider From e3e0545c9d96f1ca5503a407732443c60d717d3c Mon Sep 17 00:00:00 2001 From: DB p Date: Sat, 8 Oct 2022 18:27:17 +0900 Subject: [PATCH 17/80] - Fix Mode to oneway - Add sources - Hide Updated label when LabelNew --- Flow.Launcher/SettingWindow.xaml | 4 ++-- Flow.Launcher/ViewModel/PluginStoreItemViewModel.cs | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Flow.Launcher/SettingWindow.xaml b/Flow.Launcher/SettingWindow.xaml index bd4cca0bb..74798235a 100644 --- a/Flow.Launcher/SettingWindow.xaml +++ b/Flow.Launcher/SettingWindow.xaml @@ -1625,7 +1625,7 @@ + Text="{Binding Description, Mode=OneWay}" /> @@ -1687,7 +1687,7 @@ Foreground="{DynamicResource Color04B}" NavigateUri="{Binding Website}" RequestNavigate="OnRequestNavigate"> - + diff --git a/Flow.Launcher/ViewModel/PluginStoreItemViewModel.cs b/Flow.Launcher/ViewModel/PluginStoreItemViewModel.cs index 94b435f1a..606511738 100644 --- a/Flow.Launcher/ViewModel/PluginStoreItemViewModel.cs +++ b/Flow.Launcher/ViewModel/PluginStoreItemViewModel.cs @@ -16,12 +16,16 @@ namespace Flow.Launcher.ViewModel public string Name => _plugin.Name; public string Description => _plugin.Description; + public string IcoPath => _plugin.IcoPath; public string Author => _plugin.Author; + public string Website => _plugin.Website; + public string Language => _plugin.Language; + public string UrlDownload => _plugin.UrlDownload; + public string UrlSourceCode => _plugin.UrlSourceCode; public string Version => _plugin.Version; - public bool LabelNew => _plugin.LatestReleaseDate-DateTime.Now < TimeSpan.FromDays(7); public bool LabelInstalled => PluginManager.GetPluginForId(_plugin.ID) != null; - public bool LabelUpdated => _plugin.DateAdded -DateTime.Now < TimeSpan.FromDays(7); + public bool LabelUpdated => _plugin.DateAdded -DateTime.Now < TimeSpan.FromDays(5) && !LabelNew; } } From b7e51e5e69c5c5450b7645f544281e3be2d86187 Mon Sep 17 00:00:00 2001 From: DB p Date: Sat, 8 Oct 2022 18:32:42 +0900 Subject: [PATCH 18/80] Fix Install Button --- Flow.Launcher/SettingWindow.xaml.cs | 2 +- Flow.Launcher/ViewModel/PluginStoreItemViewModel.cs | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Flow.Launcher/SettingWindow.xaml.cs b/Flow.Launcher/SettingWindow.xaml.cs index e681d78ab..db46b6f24 100644 --- a/Flow.Launcher/SettingWindow.xaml.cs +++ b/Flow.Launcher/SettingWindow.xaml.cs @@ -306,7 +306,7 @@ namespace Flow.Launcher private void OnExternalPluginInstallClick(object sender, RoutedEventArgs e) { - if (sender is Button { DataContext: UserPlugin plugin }) + if (sender is Button { DataContext: PluginStoreItemViewModel plugin }) { var pluginsManagerPlugin = PluginManager.GetPluginForId("9f8f9b14-2518-4907-b211-35ab6290dee7"); var actionKeyword = pluginsManagerPlugin.Metadata.ActionKeywords.Count == 0 ? "" : pluginsManagerPlugin.Metadata.ActionKeywords[0]; diff --git a/Flow.Launcher/ViewModel/PluginStoreItemViewModel.cs b/Flow.Launcher/ViewModel/PluginStoreItemViewModel.cs index 606511738..e0235b5ac 100644 --- a/Flow.Launcher/ViewModel/PluginStoreItemViewModel.cs +++ b/Flow.Launcher/ViewModel/PluginStoreItemViewModel.cs @@ -14,16 +14,17 @@ namespace Flow.Launcher.ViewModel private UserPlugin _plugin; + public string ID => _plugin.ID; public string Name => _plugin.Name; public string Description => _plugin.Description; - public string IcoPath => _plugin.IcoPath; public string Author => _plugin.Author; - public string Website => _plugin.Website; + public string Version => _plugin.Version; public string Language => _plugin.Language; + public string Website => _plugin.Website; public string UrlDownload => _plugin.UrlDownload; public string UrlSourceCode => _plugin.UrlSourceCode; - public string Version => _plugin.Version; - + public string IcoPath => _plugin.IcoPath; + public bool LabelNew => _plugin.LatestReleaseDate-DateTime.Now < TimeSpan.FromDays(7); public bool LabelInstalled => PluginManager.GetPluginForId(_plugin.ID) != null; public bool LabelUpdated => _plugin.DateAdded -DateTime.Now < TimeSpan.FromDays(5) && !LabelNew; From 03d8b508911924ee8ddba257f0f39c89f4e2e0ec Mon Sep 17 00:00:00 2001 From: DB p Date: Tue, 11 Oct 2022 15:14:19 +0900 Subject: [PATCH 19/80] Fix Default TimeFormat --- Flow.Launcher.Infrastructure/UserSettings/Settings.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs index 26b89be86..4d07ea658 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs @@ -43,7 +43,7 @@ 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 TimeFormat { get; set; } = "hh:mm tt"; public string DateFormat { get; set; } = "MM'/'dd ddd"; public bool FirstLaunch { get; set; } = true; From 6b2a78e1f2a6b2dcf983d1cd5fac40fa9bcfbd52 Mon Sep 17 00:00:00 2001 From: DB p Date: Tue, 11 Oct 2022 21:37:43 +0900 Subject: [PATCH 20/80] - Add Uninstall / Update Btn - Adjust Strings --- Flow.Launcher/Languages/en.xaml | 5 ++-- Flow.Launcher/SettingWindow.xaml | 30 ++++++++++++++----- Flow.Launcher/SettingWindow.xaml.cs | 22 ++++++++++++++ .../ViewModel/PluginStoreItemViewModel.cs | 7 +++-- 4 files changed, 51 insertions(+), 13 deletions(-) diff --git a/Flow.Launcher/Languages/en.xaml b/Flow.Launcher/Languages/en.xaml index 149dcb817..2dd61329a 100644 --- a/Flow.Launcher/Languages/en.xaml +++ b/Flow.Launcher/Languages/en.xaml @@ -84,13 +84,14 @@ Query time: | Version Website - Uninstall Plugin Store Refresh - Install + Install + Uninstall + Update Installed Plug-in already installed New diff --git a/Flow.Launcher/SettingWindow.xaml b/Flow.Launcher/SettingWindow.xaml index 74798235a..0a87ba677 100644 --- a/Flow.Launcher/SettingWindow.xaml +++ b/Flow.Launcher/SettingWindow.xaml @@ -1320,7 +1320,7 @@ FontSize="11" Foreground="{DynamicResource PluginInfoColor}" MouseUp="OnExternalPluginUninstallClick" - Text="{DynamicResource plugin_uninstall}" + Text="{DynamicResource uninstallbtn}" TextDecorations="Underline" /> - + +