From b2d174f59c6465609d3cdde4be866a455de95db8 Mon Sep 17 00:00:00 2001 From: DB p Date: Fri, 5 Apr 2024 19:32:08 +0900 Subject: [PATCH 01/18] Add Legacy/Modern option in setting window --- .../UserSettings/Settings.cs | 9 ++- Flow.Launcher/Languages/en.xaml | 4 + Flow.Launcher/SettingWindow.xaml | 77 +++++++++++++++---- Flow.Launcher/SettingWindow.xaml.cs | 1 + .../ViewModel/SettingWindowViewModel.cs | 28 +++++++ 5 files changed, 101 insertions(+), 18 deletions(-) diff --git a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs index 274f88dc674..7458eed4c2e 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs @@ -17,6 +17,7 @@ public class Settings : BaseModel public string Hotkey { get; set; } = $"{KeyConstant.Alt} + {KeyConstant.Space}"; public string OpenResultModifiers { get; set; } = KeyConstant.Alt; public string ColorScheme { get; set; } = "System"; + public string ThemeMode { get; set; } = "Modern"; public bool ShowOpenResultHotkey { get; set; } = true; public double WindowSize { get; set; } = 580; public string PreviewHotkey { get; set; } = $"F1"; @@ -278,7 +279,13 @@ public enum ColorSchemes Light, Dark } - + + public enum ThemeModes + { + Modern, + Legacy + } + public enum SearchWindowScreens { RememberLastLaunchLocation, diff --git a/Flow.Launcher/Languages/en.xaml b/Flow.Launcher/Languages/en.xaml index 4bc79ccb398..8ca307c8e9e 100644 --- a/Flow.Launcher/Languages/en.xaml +++ b/Flow.Launcher/Languages/en.xaml @@ -168,6 +168,10 @@ Custom Clock Date + Theme Mode (Beta) + Select the window rendering method. Modern mode is available in Windows 10 and later versions. There are differences in some features. + Modern + Legacy Hotkey diff --git a/Flow.Launcher/SettingWindow.xaml b/Flow.Launcher/SettingWindow.xaml index 96f80f0c5c6..b06574a7ccb 100644 --- a/Flow.Launcher/SettingWindow.xaml +++ b/Flow.Launcher/SettingWindow.xaml @@ -693,7 +693,7 @@ - @@ -720,7 +720,7 @@ -  +  - + + @@ -1989,6 +1994,45 @@ + + + + + + + +  + + + + + + + @@ -2446,8 +2490,7 @@ FontSize="14" ItemsSource="{Binding AnimationSpeeds}" SelectedValue="{Binding Settings.AnimationSpeed}" - SelectedValuePath="Value"> - + SelectedValuePath="Value" /> + + + - - - - - - - - - - - - - - - - - - - #19ffffff - - - - - - - - - - - - - - - diff --git a/Flow.Launcher/Themes/BlurBlack.xaml b/Flow.Launcher/Themes/BlurBlack.xaml deleted file mode 100644 index 0f126429242..00000000000 --- a/Flow.Launcher/Themes/BlurBlack.xaml +++ /dev/null @@ -1,171 +0,0 @@ - - - - - - True - - - - - - - - - - - - - - - - - - - - #19c9c9c9 - - - - - - - - - - - - - \ No newline at end of file diff --git a/Flow.Launcher/Themes/BlurWhite.xaml b/Flow.Launcher/Themes/BlurWhite.xaml deleted file mode 100644 index 4406724b8ec..00000000000 --- a/Flow.Launcher/Themes/BlurWhite.xaml +++ /dev/null @@ -1,182 +0,0 @@ - - - - - - True - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Flow.Launcher/Themes/Bullet Light.xaml b/Flow.Launcher/Themes/Bullet Light.xaml deleted file mode 100644 index 1f776a2eee4..00000000000 --- a/Flow.Launcher/Themes/Bullet Light.xaml +++ /dev/null @@ -1,209 +0,0 @@ - - - - - - - - - - - - - - - - - - - #f1f1f1 - - - - - - - - - - 5 - 10 0 10 0 - 0 0 0 10 - - - - - - - - \ No newline at end of file diff --git a/Flow.Launcher/Themes/Circle System.xaml b/Flow.Launcher/Themes/Circle System.xaml deleted file mode 100644 index 2b2ce7ca33d..00000000000 --- a/Flow.Launcher/Themes/Circle System.xaml +++ /dev/null @@ -1,191 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - 8 - 10 0 10 0 - 0 0 0 10 - - - - - - - - \ No newline at end of file diff --git a/Flow.Launcher/Themes/Cyan Dark.xaml b/Flow.Launcher/Themes/Cyan Dark.xaml deleted file mode 100644 index 60bc090022f..00000000000 --- a/Flow.Launcher/Themes/Cyan Dark.xaml +++ /dev/null @@ -1,211 +0,0 @@ - - - - - - - - - - - - - - - - - - - - #1e292f - - - - - - - - - - 0 - 0 - 0 0 0 4 - - - - - - - - \ No newline at end of file diff --git a/Flow.Launcher/Themes/Darker Glass.xaml b/Flow.Launcher/Themes/Darker Glass.xaml deleted file mode 100644 index 89b6dfa0181..00000000000 --- a/Flow.Launcher/Themes/Darker Glass.xaml +++ /dev/null @@ -1,174 +0,0 @@ - - - - - 0 0 0 8 - - - - - - - - - - - - - - #545454 - - - - - - - - - - - - - - - - diff --git a/Flow.Launcher/Themes/Darker.xaml b/Flow.Launcher/Themes/Darker.xaml deleted file mode 100644 index d1abbe9789f..00000000000 --- a/Flow.Launcher/Themes/Darker.xaml +++ /dev/null @@ -1,100 +0,0 @@ - - - - - 0 0 0 8 - - - - - - - - #4d4d4d - - - - - - diff --git a/Flow.Launcher/Themes/Discord Dark.xaml b/Flow.Launcher/Themes/Discord Dark.xaml deleted file mode 100644 index 5315c7644a1..00000000000 --- a/Flow.Launcher/Themes/Discord Dark.xaml +++ /dev/null @@ -1,192 +0,0 @@ - - - - - 0 0 0 6 - - - - - - - - - - - - - - #49443c - - - - - - - - - - - - - - - diff --git a/Flow.Launcher/Themes/Gray.xaml b/Flow.Launcher/Themes/Gray.xaml deleted file mode 100644 index d8d344e216d..00000000000 --- a/Flow.Launcher/Themes/Gray.xaml +++ /dev/null @@ -1,195 +0,0 @@ - - - - - - - - - - - - - - - - - - #797d86 - - - - - - - - - - 0 - 0 - 0 0 0 0 - - - - - - - - - diff --git a/Flow.Launcher/Themes/League.xaml b/Flow.Launcher/Themes/League.xaml deleted file mode 100644 index 7fbe56187ad..00000000000 --- a/Flow.Launcher/Themes/League.xaml +++ /dev/null @@ -1,165 +0,0 @@ - - - - - - - - - - - - - - - - - - #192026 - - - - - - F1 M12000,12000z M0,0z M10354,10962C10326,10951 10279,10927 10249,10907 10216,10886 9476,10153 8370,9046 7366,8042 6541,7220 6536,7220 6532,7220 6498,7242 6461,7268 6213,7447 5883,7619 5592,7721 5194,7860 4802,7919 4360,7906 3612,7886 2953,7647 2340,7174 2131,7013 1832,6699 1664,6465 1394,6088 1188,5618 1097,5170 1044,4909 1030,4764 1030,4470 1030,4130 1056,3914 1135,3609 1263,3110 1511,2633 1850,2235 1936,2134 2162,1911 2260,1829 2781,1395 3422,1120 4090,1045 4271,1025 4667,1025 4848,1045 5505,1120 6100,1368 6630,1789 6774,1903 7081,2215 7186,2355 7362,2588 7467,2759 7579,2990 7802,3455 7911,3937 7911,4460 7911,4854 7861,5165 7737,5542 7684,5702 7675,5724 7602,5885 7517,6071 7390,6292 7270,6460 7242,6499 7220,6533 7220,6538 7220,6542 8046,7371 9055,8380 10441,9766 10898,10229 10924,10274 10945,10308 10966,10364 10976,10408 10990,10472 10991,10493 10980,10554 10952,10717 10840,10865 10690,10937 10621,10971 10607,10974 10510,10977 10425,10980 10395,10977 10354,10962z M4685,7050C5214,7001 5694,6809 6100,6484 6209,6396 6396,6209 6484,6100 7151,5267 7246,4110 6721,3190 6369,2571 5798,2137 5100,1956 4706,1855 4222,1855 3830,1957 3448,2056 3140,2210 2838,2453 2337,2855 2010,3427 1908,4080 1877,4274 1877,4656 1908,4850 1948,5105 2028,5370 2133,5590 2459,6272 3077,6782 3810,6973 3967,7014 4085,7034 4290,7053 4371,7061 4583,7059 4685,7050z - - - - - - - - \ No newline at end of file diff --git a/Flow.Launcher/Themes/Midnight.xaml b/Flow.Launcher/Themes/Midnight.xaml deleted file mode 100644 index 91ff620d54e..00000000000 --- a/Flow.Launcher/Themes/Midnight.xaml +++ /dev/null @@ -1,191 +0,0 @@ - - - - - - - - - - - - - - - - - #202938 - - - - - - - - - - 8 - 10 0 10 0 - 0 0 0 10 - - - - - - - - diff --git a/Flow.Launcher/Themes/Nord Darker.xaml b/Flow.Launcher/Themes/Nord Darker.xaml deleted file mode 100644 index d9ddb307664..00000000000 --- a/Flow.Launcher/Themes/Nord Darker.xaml +++ /dev/null @@ -1,164 +0,0 @@ - - - - - - 0 0 0 8 - - - - - - - - - - - - - - #4e586b - - - - - - - - - - - - - diff --git a/Flow.Launcher/Themes/Pink.xaml b/Flow.Launcher/Themes/Pink.xaml deleted file mode 100644 index dc97e432055..00000000000 --- a/Flow.Launcher/Themes/Pink.xaml +++ /dev/null @@ -1,161 +0,0 @@ - - - - - 0 0 0 4 - - - - - - - - - - - - - #cc1081 - - - - - - - - - - - - \ No newline at end of file diff --git a/Flow.Launcher/Themes/SlimLight.xaml b/Flow.Launcher/Themes/SlimLight.xaml deleted file mode 100644 index dc08eec3003..00000000000 --- a/Flow.Launcher/Themes/SlimLight.xaml +++ /dev/null @@ -1,217 +0,0 @@ - - - - - - 38 - - - - - - - - - - - - - - #d6d4d7 - - - - - - - - - - - 6 - 4 0 4 0 - 0 0 0 4 - - - - - - - - diff --git a/Flow.Launcher/Themes/Sublime.xaml b/Flow.Launcher/Themes/Sublime.xaml deleted file mode 100644 index 6df69ad3e72..00000000000 --- a/Flow.Launcher/Themes/Sublime.xaml +++ /dev/null @@ -1,191 +0,0 @@ - - - - - 0 0 0 8 - - - - - - - - - - - - - - - #3c454e - - - - - - - - - - - - - - - diff --git a/Flow.Launcher/Themes/Ubuntu.xaml b/Flow.Launcher/Themes/Ubuntu.xaml deleted file mode 100644 index 33f232699a4..00000000000 --- a/Flow.Launcher/Themes/Ubuntu.xaml +++ /dev/null @@ -1,215 +0,0 @@ - - - - - - - - - - - - - - - - - - - #4d4d4d - - - - - - - - - - 0 - 0 0 0 0 - 0 0 0 8 - - - - - - - - \ No newline at end of file diff --git a/Flow.Launcher/Themes/Win10Light.xaml b/Flow.Launcher/Themes/Win10Light.xaml deleted file mode 100644 index eaa66e7fda5..00000000000 --- a/Flow.Launcher/Themes/Win10Light.xaml +++ /dev/null @@ -1,199 +0,0 @@ - - - - - 0 0 0 4 - - - - - - - - - - - - - - - - #ccd0d4 - - - - - - - - - - - - - - - diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs index 7ca9a6de451..a95b9338326 100644 --- a/Flow.Launcher/ViewModel/MainViewModel.cs +++ b/Flow.Launcher/ViewModel/MainViewModel.cs @@ -623,6 +623,12 @@ public double MainWindowWidth set => Settings.WindowSize = value; } + public WindowStyle MainWindowStyle + { + get => Settings.WindowStyle; + set => Settings.WindowStyle = value; + } + public string PluginIconPath { get; set; } = null; public string OpenResultCommandModifiers => Settings.OpenResultModifiers; From cfed9af0e39cca95605b0002cb1baa1b5d990c3d Mon Sep 17 00:00:00 2001 From: DB p Date: Tue, 9 Apr 2024 10:34:01 +0900 Subject: [PATCH 06/18] Remove Border --- Flow.Launcher/MainWindow.xaml | 589 +++++++++++++++++----------------- 1 file changed, 296 insertions(+), 293 deletions(-) diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml index 4d826215361..d327cee7f5a 100644 --- a/Flow.Launcher/MainWindow.xaml +++ b/Flow.Launcher/MainWindow.xaml @@ -196,312 +196,315 @@ Command="{Binding TogglePreviewCommand}" Modifiers="{Binding PreviewHotkey, Converter={StaticResource StringToKeyBindingConverter}, ConverterParameter='modifiers'}" /> - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - - + + + - - - - - + + + + + + + + + + + + - - + + \ No newline at end of file From 1ef55a6d24c589d63fa67426d2b9cac5f37720aa Mon Sep 17 00:00:00 2001 From: DB p Date: Tue, 9 Apr 2024 10:39:29 +0900 Subject: [PATCH 07/18] Add ThemeResource --- Flow.Launcher/App.xaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Flow.Launcher/App.xaml b/Flow.Launcher/App.xaml index 01c1eb71c22..91e433363d7 100644 --- a/Flow.Launcher/App.xaml +++ b/Flow.Launcher/App.xaml @@ -10,6 +10,7 @@ + From 1328f48d94eccf4d0b3e8e3f34308c6307d86d93 Mon Sep 17 00:00:00 2001 From: DB p Date: Tue, 9 Apr 2024 10:43:11 +0900 Subject: [PATCH 08/18] Adjust Colors --- Flow.Launcher/MainWindow.xaml | 5 +---- Flow.Launcher/Themes/Base.xaml | 4 ---- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml index d327cee7f5a..c0c1d2e88c8 100644 --- a/Flow.Launcher/MainWindow.xaml +++ b/Flow.Launcher/MainWindow.xaml @@ -197,11 +197,8 @@ Modifiers="{Binding PreviewHotkey, Converter={StaticResource StringToKeyBindingConverter}, ConverterParameter='modifiers'}" /> - - - - + diff --git a/Flow.Launcher/Themes/Base.xaml b/Flow.Launcher/Themes/Base.xaml index b3a81f38873..f7342584d35 100644 --- a/Flow.Launcher/Themes/Base.xaml +++ b/Flow.Launcher/Themes/Base.xaml @@ -589,10 +589,6 @@ + + + + + + + + + + + + + + + + + + + + + 8 + 10 0 10 0 + 0 0 0 10 + + + + + + + + \ No newline at end of file diff --git a/Flow.Launcher/Themes/Win11System.xaml b/Flow.Launcher/Themes/Win11System.xaml index 3025f9a07e2..bc1938e0494 100644 --- a/Flow.Launcher/Themes/Win11System.xaml +++ b/Flow.Launcher/Themes/Win11System.xaml @@ -3,61 +3,50 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:m="http://schemas.modernwpf.com/2019" xmlns:system="clr-namespace:System;assembly=mscorlib"> + - 0 0 0 8 - + + - + TargetType="{x:Type Window}" /> + - - - - + + + + + + + 4 + 10 0 10 0 + 0 0 0 10 + - + \ No newline at end of file From 1c1a5cf8f55e9b054f9c4a7a7c71b14aecc81df2 Mon Sep 17 00:00:00 2001 From: DB p Date: Tue, 9 Apr 2024 21:27:11 +0900 Subject: [PATCH 12/18] Add Search Bar Size Setting --- .../UserSettings/Settings.cs | 1 + Flow.Launcher/MainWindow.xaml | 6 ++-- Flow.Launcher/SettingWindow.xaml | 32 +++++++++++++++++++ Flow.Launcher/Themes/Base.xaml | 3 +- Flow.Launcher/Themes/Win11System.xaml | 9 +++--- Flow.Launcher/ViewModel/MainViewModel.cs | 9 ++++++ .../ViewModel/SettingWindowViewModel.cs | 9 ++++++ 7 files changed, 60 insertions(+), 9 deletions(-) diff --git a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs index 13cfb403ac8..fbaad2be73b 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs @@ -20,6 +20,7 @@ public class Settings : BaseModel public string ThemeMode { get; set; } = "Modern"; public bool ShowOpenResultHotkey { get; set; } = true; public double WindowSize { get; set; } = 580; + public double WindowHeightSize { get; set; } = 24; public WindowStyle WindowStyle { get; set; } = WindowStyle.None; public string PreviewHotkey { get; set; } = $"F1"; diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml index d22cb5ef923..69c7b17d4b3 100644 --- a/Flow.Launcher/MainWindow.xaml +++ b/Flow.Launcher/MainWindow.xaml @@ -12,7 +12,7 @@ xmlns:vm="clr-namespace:Flow.Launcher.ViewModel" Name="FlowMainWindow" Title="Flow Launcher" - Width="{Binding MainWindowWidth, Mode=OneWay}" + Width="{Binding MainWindowWidth, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" d:DataContext="{d:DesignInstance Type=vm:MainViewModel}" uix:ExtendsContentIntoTitleBar="True" uix:SizeToContent="Height" @@ -204,7 +204,7 @@ - + @@ -212,6 +212,7 @@ @@ -224,6 +225,7 @@ + + + + + + + + + + + +  + + + + diff --git a/Flow.Launcher/Themes/Base.xaml b/Flow.Launcher/Themes/Base.xaml index 461455f4bfe..efb38b61108 100644 --- a/Flow.Launcher/Themes/Base.xaml +++ b/Flow.Launcher/Themes/Base.xaml @@ -32,7 +32,6 @@ - @@ -562,7 +561,7 @@ - + diff --git a/Flow.Launcher/Themes/Win11System.xaml b/Flow.Launcher/Themes/Win11System.xaml index bc1938e0494..37fcfd79d3b 100644 --- a/Flow.Launcher/Themes/Win11System.xaml +++ b/Flow.Launcher/Themes/Win11System.xaml @@ -17,19 +17,18 @@ x:Key="QueryBoxStyle" BasedOn="{StaticResource BaseQueryBoxStyle}" TargetType="{x:Type TextBox}"> - + - + @@ -69,7 +68,7 @@ x:Key="SeparatorStyle" BasedOn="{StaticResource BaseSeparatorStyle}" TargetType="{x:Type Rectangle}"> - + diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs index a95b9338326..fc35c0de901 100644 --- a/Flow.Launcher/ViewModel/MainViewModel.cs +++ b/Flow.Launcher/ViewModel/MainViewModel.cs @@ -71,6 +71,9 @@ public MainViewModel(Settings settings) case nameof(Settings.WindowSize): OnPropertyChanged(nameof(MainWindowWidth)); break; + case nameof(Settings.WindowHeightSize): + OnPropertyChanged(nameof(MainWindowHeight)); + break; case nameof(Settings.AlwaysStartEn): OnPropertyChanged(nameof(StartWithEnglishMode)); break; @@ -623,6 +626,12 @@ public double MainWindowWidth set => Settings.WindowSize = value; } + public double MainWindowHeight + { + get => Settings.WindowHeightSize; + set => Settings.WindowHeightSize = value; + } + public WindowStyle MainWindowStyle { get => Settings.WindowStyle; diff --git a/Flow.Launcher/ViewModel/SettingWindowViewModel.cs b/Flow.Launcher/ViewModel/SettingWindowViewModel.cs index 6c38d4d896b..ea896c8eb7c 100644 --- a/Flow.Launcher/ViewModel/SettingWindowViewModel.cs +++ b/Flow.Launcher/ViewModel/SettingWindowViewModel.cs @@ -47,6 +47,9 @@ public SettingWindowViewModel(Updater updater, IPortable portable) case nameof(Settings.WindowSize): OnPropertyChanged(nameof(WindowWidthSize)); break; + case nameof(Settings.WindowHeightSize): + OnPropertyChanged(nameof(WindowHeightSize)); + break; case nameof(Settings.UseDate): case nameof(Settings.DateFormat): OnPropertyChanged(nameof(DateText)); @@ -617,6 +620,12 @@ public double WindowWidthSize set => Settings.WindowSize = value; } + public double WindowHeightSize + { + get => Settings.WindowHeightSize; + set => Settings.WindowHeightSize = value; + } + public bool UseGlyphIcons { get => Settings.UseGlyphIcons; From 6b416671934b9118959d9031a98c900fe54c36d5 Mon Sep 17 00:00:00 2001 From: DB p Date: Wed, 10 Apr 2024 11:38:18 +0900 Subject: [PATCH 13/18] Add FontSize Setting for Item subtitle --- .../UserSettings/Settings.cs | 8 +- Flow.Launcher/Languages/en.xaml | 1 + Flow.Launcher/MainWindow.xaml | 2 + Flow.Launcher/ResultListBox.xaml | 2 + Flow.Launcher/SettingWindow.xaml | 93 ++++++++++++++++++- Flow.Launcher/Themes/Base.xaml | 2 - Flow.Launcher/Themes/Win11System.xaml | 2 +- Flow.Launcher/ViewModel/MainViewModel.cs | 28 ++++++ Flow.Launcher/ViewModel/ResultViewModel.cs | 23 +++++ .../ViewModel/SettingWindowViewModel.cs | 18 +++- 10 files changed, 169 insertions(+), 10 deletions(-) diff --git a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs index fbaad2be73b..7566c9335df 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs @@ -20,7 +20,6 @@ public class Settings : BaseModel public string ThemeMode { get; set; } = "Modern"; public bool ShowOpenResultHotkey { get; set; } = true; public double WindowSize { get; set; } = 580; - public double WindowHeightSize { get; set; } = 24; public WindowStyle WindowStyle { get; set; } = WindowStyle.None; public string PreviewHotkey { get; set; } = $"F1"; @@ -46,6 +45,12 @@ public string Theme } } public bool UseDropShadowEffect { get; set; } = false; + + /* Appearance Settings. It should be separated from the setting later.*/ + public double WindowHeightSize { get; set; } = 40; + public double QueryBoxFontSize { get; set; } = 18; + public double ResultItemFontSize { get; set; } = 16; + public double ResultSubItemFontSize { get; set; } = 13; public string QueryBoxFont { get; set; } = FontFamily.GenericSansSerif.Name; public string QueryBoxFontStyle { get; set; } public string QueryBoxFontWeight { get; set; } @@ -54,6 +59,7 @@ public string Theme public string ResultFontStyle { get; set; } public string ResultFontWeight { get; set; } public string ResultFontStretch { get; set; } + public bool UseGlyphIcons { get; set; } = true; public bool UseAnimation { get; set; } = true; public bool UseSound { get; set; } = true; diff --git a/Flow.Launcher/Languages/en.xaml b/Flow.Launcher/Languages/en.xaml index 8ca307c8e9e..ca76f5e8f89 100644 --- a/Flow.Launcher/Languages/en.xaml +++ b/Flow.Launcher/Languages/en.xaml @@ -144,6 +144,7 @@ Terminate unwanted processes Query Box Font Result Item Font + Item Subtitle Font Window Mode Opacity Theme {0} not exists, fallback to default theme diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml index 69c7b17d4b3..a7d8e715239 100644 --- a/Flow.Launcher/MainWindow.xaml +++ b/Flow.Launcher/MainWindow.xaml @@ -213,6 +213,7 @@ @@ -227,6 +228,7 @@ x:Name="QueryTextBox" Height="{Binding MainWindowHeight, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" AllowDrop="True" + FontSize="{Binding QueryBoxFontSize, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" InputMethod.PreferredImeConversionMode="{Binding StartWithEnglishMode, Converter={StaticResource BoolToIMEConversionModeConverter}}" InputMethod.PreferredImeState="{Binding StartWithEnglishMode, Converter={StaticResource BoolToIMEStateConverter}}" PreviewDragOver="OnPreviewDragOver" diff --git a/Flow.Launcher/ResultListBox.xaml b/Flow.Launcher/ResultListBox.xaml index ba4c9e9a451..899dacafe62 100644 --- a/Flow.Launcher/ResultListBox.xaml +++ b/Flow.Launcher/ResultListBox.xaml @@ -175,6 +175,7 @@ Grid.Row="0" VerticalAlignment="Center" DockPanel.Dock="Left" + FontSize="{Binding ResultItemFontSize, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" IsEnabled="False" Style="{DynamicResource ItemTitleStyle}" Text="{Binding Result.Title}" @@ -191,6 +192,7 @@ @@ -2082,7 +2082,7 @@ - + @@ -2285,9 +2285,21 @@ Grid.Column="2" Margin="0,0,20,0" Orientation="Horizontal"> + + + + + + + + + + + + + + + + + + +  + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -2763,7 +2768,7 @@ - + diff --git a/Flow.Launcher/ViewModel/SettingWindowViewModel.cs b/Flow.Launcher/ViewModel/SettingWindowViewModel.cs index d243559caa7..4ec41423d0a 100644 --- a/Flow.Launcher/ViewModel/SettingWindowViewModel.cs +++ b/Flow.Launcher/ViewModel/SettingWindowViewModel.cs @@ -775,18 +775,6 @@ public ResultsViewModel PreviewResults Title = InternationalizationManager.Instance.GetTranslation("SampleTitleWebSearch"), SubTitle = InternationalizationManager.Instance.GetTranslation("SampleSubTitleWebSearch"), IcoPath = Path.Combine(Constant.ProgramDirectory, @"Plugins\Flow.Launcher.Plugin.WebSearch\Images\web_search.png") - }, - new Result - { - Title = InternationalizationManager.Instance.GetTranslation("SampleTitleProgram"), - SubTitle = InternationalizationManager.Instance.GetTranslation("SampleSubTitleProgram"), - IcoPath = Path.Combine(Constant.ProgramDirectory, @"Plugins\Flow.Launcher.Plugin.Program\Images\program.png") - }, - new Result - { - Title = InternationalizationManager.Instance.GetTranslation("SampleTitleProcessKiller"), - SubTitle = InternationalizationManager.Instance.GetTranslation("SampleSubTitleProcessKiller"), - IcoPath = Path.Combine(Constant.ProgramDirectory, @"Plugins\Flow.Launcher.Plugin.ProcessKiller\Images\app.png") } }; var vm = new ResultsViewModel(Settings); From cf7ec9a00be2de1506dcfc2b56d392143e0891c1 Mon Sep 17 00:00:00 2001 From: DB p Date: Wed, 10 Apr 2024 17:18:41 +0900 Subject: [PATCH 15/18] Add Item Size Setting --- .../UserSettings/Settings.cs | 1 + Flow.Launcher/ResultListBox.xaml | 2 +- Flow.Launcher/SettingWindow.xaml | 25 ++++++++++--------- Flow.Launcher/ViewModel/ResultViewModel.cs | 10 ++++++++ .../ViewModel/SettingWindowViewModel.cs | 6 +++++ 5 files changed, 31 insertions(+), 13 deletions(-) diff --git a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs index 7566c9335df..f7e7661f8ff 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs @@ -48,6 +48,7 @@ public string Theme /* Appearance Settings. It should be separated from the setting later.*/ public double WindowHeightSize { get; set; } = 40; + public double ItemHeightSize { get; set; } = 58; public double QueryBoxFontSize { get; set; } = 18; public double ResultItemFontSize { get; set; } = 16; public double ResultSubItemFontSize { get; set; } = 13; diff --git a/Flow.Launcher/ResultListBox.xaml b/Flow.Launcher/ResultListBox.xaml index 899dacafe62..c16495332be 100644 --- a/Flow.Launcher/ResultListBox.xaml +++ b/Flow.Launcher/ResultListBox.xaml @@ -221,7 +221,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2055,70 +2255,6 @@ - - - - - - - - - - - -  - - - - - - - - - - - - - - -  - - - - - @@ -2273,192 +2409,8 @@ - - - - - - - - - - - - - - - - - - - - - - -  - - - - - - - - - - - - - - - - - - - - - - - - - -  - - - - - - - - - - - - - - - - - - - - - - - - -  - - - + diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs index 4c2bfadffe4..022bbf82f29 100644 --- a/Flow.Launcher/ViewModel/MainViewModel.cs +++ b/Flow.Launcher/ViewModel/MainViewModel.cs @@ -77,6 +77,9 @@ public MainViewModel(Settings settings) case nameof(Settings.QueryBoxFontSize): OnPropertyChanged(nameof(QueryBoxFontSize)); break; + case nameof(Settings.ItemHeightSize): + OnPropertyChanged(nameof(ItemHeightSize)); + break; case nameof(Settings.ResultItemFontSize): OnPropertyChanged(nameof(ResultItemFontSize)); break; @@ -647,6 +650,11 @@ public double QueryBoxFontSize set => Settings.QueryBoxFontSize = value; } + public double ItemHeightSize + { + get => Settings.ItemHeightSize; + set => Settings.ItemHeightSize = value; + } public double ResultItemFontSize { diff --git a/Flow.Launcher/ViewModel/ResultsViewModel.cs b/Flow.Launcher/ViewModel/ResultsViewModel.cs index d02dc9bd582..a7246619f78 100644 --- a/Flow.Launcher/ViewModel/ResultsViewModel.cs +++ b/Flow.Launcher/ViewModel/ResultsViewModel.cs @@ -32,9 +32,14 @@ public ResultsViewModel(Settings settings) : this() _settings = settings; _settings.PropertyChanged += (s, e) => { - if (e.PropertyName == nameof(_settings.MaxResultsToShow)) + switch (e.PropertyName) { - OnPropertyChanged(nameof(MaxHeight)); + case nameof(_settings.MaxResultsToShow): + OnPropertyChanged(nameof(MaxHeight)); + break; + case nameof(_settings.ItemHeightSize): + OnPropertyChanged(nameof(ItemHeightSize)); + break; } }; } @@ -43,8 +48,12 @@ public ResultsViewModel(Settings settings) : this() #region Properties - public double MaxHeight => MaxResults * (double)Application.Current.FindResource("ResultItemHeight")!; - + public double MaxHeight => MaxResults * _settings.ItemHeightSize!; + public double ItemHeightSize + { + get => _settings.ItemHeightSize; + set => _settings.ItemHeightSize = value; + } public int SelectedIndex { get; set; } public ResultViewModel SelectedItem { get; set; } From ce04e64cc72bce699b04c2ee6b1c8670520529c2 Mon Sep 17 00:00:00 2001 From: DB p Date: Wed, 10 Apr 2024 23:08:16 +0900 Subject: [PATCH 17/18] Fix Window Height Applying --- Flow.Launcher/ViewModel/ResultsViewModel.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Flow.Launcher/ViewModel/ResultsViewModel.cs b/Flow.Launcher/ViewModel/ResultsViewModel.cs index a7246619f78..a816faca952 100644 --- a/Flow.Launcher/ViewModel/ResultsViewModel.cs +++ b/Flow.Launcher/ViewModel/ResultsViewModel.cs @@ -39,6 +39,7 @@ public ResultsViewModel(Settings settings) : this() break; case nameof(_settings.ItemHeightSize): OnPropertyChanged(nameof(ItemHeightSize)); + OnPropertyChanged(nameof(MaxHeight)); break; } }; From 0f4895df1feb175278e831495986d83e4e996a99 Mon Sep 17 00:00:00 2001 From: DB p Date: Thu, 11 Apr 2024 00:21:30 +0900 Subject: [PATCH 18/18] Add Adjust MaxResultShow count by Window Height --- Flow.Launcher/MainWindow.xaml.cs | 62 ++++++++++++++++++++++++++++++-- 1 file changed, 59 insertions(+), 3 deletions(-) diff --git a/Flow.Launcher/MainWindow.xaml.cs b/Flow.Launcher/MainWindow.xaml.cs index 6f48e2ba8d1..4091737fb65 100644 --- a/Flow.Launcher/MainWindow.xaml.cs +++ b/Flow.Launcher/MainWindow.xaml.cs @@ -37,6 +37,7 @@ using Wpf.Ui.Controls; using MenuItem = System.Windows.Controls.MenuItem; using FontIcon = ModernWpf.Controls.FontIcon; +using System.Diagnostics; namespace Flow.Launcher { @@ -71,8 +72,19 @@ public MainWindow(Settings settings, MainViewModel mainVM) animationSound.Open(new Uri(AppDomain.CurrentDomain.BaseDirectory + "Resources\\open.wav")); DataObject.AddPastingHandler(QueryTextBox, OnPaste); + this.Loaded += (obj, args) => + { + var handle = new WindowInteropHelper(this).Handle; + var win = HwndSource.FromHwnd(handle); + win.AddHook(new HwndSourceHook(WndProc)); + }; } + DispatcherTimer timer = new DispatcherTimer + { + Interval = new TimeSpan(0, 0, 0, 0, 500), + IsEnabled = false + }; public MainWindow() { InitializeComponent(); @@ -740,9 +752,11 @@ private void QueryTextBox_KeyUp(object sender, KeyEventArgs e) private void OnSizeChanged(object sender, SizeChangedEventArgs e) { - _settings.WindowSize = Width; - FlowMainWindow.SizeToContent = SizeToContent.Height; - IntPtr WinHandle = new WindowInteropHelper(this).Handle; + /*_settings.WindowSize = Width;*/ + /*_settings.MaxResultsToShow = System.Convert.ToInt32(Height / _settings.ItemHeightSize);*/ + + /*FlowMainWindow.SizeToContent = SizeToContent.Height;*/ + /*IntPtr WinHandle = new WindowInteropHelper(this).Handle;*/ /* var backgroundBrush = FlowMainWindow.Resources["ApplicationBackgroundBrush"]; backgroundBrush = new SolidColorBrush(Color.FromArgb(0xFF, 0x20, 0x20, 0x20)); @@ -750,5 +764,47 @@ private void OnSizeChanged(object sender, SizeChangedEventArgs e) WindowBackdrop.RemoveBackdrop(FlowMainWindow); FlowMainWindow.Resources["ApplicationBackgroundColor"] = Color.FromArgb(0xFF, 0x00, 0x00, 0x00);*/ } + + private const int WM_ENTERSIZEMOVE = 0x0231; + private const int WM_EXITSIZEMOVE = 0x0232; + public event EventHandler ResizeBegin; + public event EventHandler ResizeEnd; + private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled) + { + if (msg == WM_ENTERSIZEMOVE) + { + OnResizeBegin(); + handled = true; + } + if (msg == WM_EXITSIZEMOVE) + { + OnResizeEnd(); + handled = true; + } + return IntPtr.Zero; + } + private void OnResizeBegin() + { + Debug.WriteLine("------------------RESIZE BEGIN-----------------------"); + //Any custom logic for resize begin + } + private void OnResizeEnd() + { + Debug.WriteLine("------------------END-----------------------"); + Debug.WriteLine(System.Convert.ToInt32((Height - (_settings.WindowHeightSize + 14)) / _settings.ItemHeightSize)); + Debug.WriteLine("----------------------------------------------------"); + //_settings.MaxResultsToShow = System.Convert.ToInt32((Height - (_settings.WindowHeightSize + 14)) / _settings.ItemHeightSize); + if (System.Convert.ToInt32((Height - (_settings.WindowHeightSize + 14)) / _settings.ItemHeightSize) == 0) + { + _settings.MaxResultsToShow = 1; + } + else + { + _settings.MaxResultsToShow = System.Convert.ToInt32((Height - (_settings.WindowHeightSize + 14)) / _settings.ItemHeightSize); + } + _settings.WindowSize = Width; + FlowMainWindow.SizeToContent = SizeToContent.Height; + //Any custom logic for resize begin + } } }