From f50f2ff27c1aedd064e2b213adee24d4b485df30 Mon Sep 17 00:00:00 2001 From: DB p Date: Thu, 24 Apr 2025 10:18:38 +0900 Subject: [PATCH 01/28] Implement dynamic font settings for the setting window --- .../UserSettings/Settings.cs | 2 ++ Flow.Launcher/CustomQueryHotkeySetting.xaml | 1 - Flow.Launcher/CustomShortcutSetting.xaml | 1 - Flow.Launcher/Languages/en.xaml | 2 +- Flow.Launcher/Resources/CustomControlTemplate.xaml | 14 ++++++++++++++ Flow.Launcher/Resources/SettingWindowStyle.xaml | 1 + Flow.Launcher/SelectBrowserWindow.xaml | 1 - Flow.Launcher/SelectFileManagerWindow.xaml | 1 - .../SettingPages/Views/SettingsPaneAbout.xaml | 8 +++----- .../SettingPages/Views/SettingsPanePlugins.xaml | 6 +++--- Flow.Launcher/SettingWindow.xaml | 1 - Flow.Launcher/WelcomeWindow.xaml | 14 ++++++-------- 12 files changed, 30 insertions(+), 22 deletions(-) diff --git a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs index 0f878151e72..ca015fd70ca 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs @@ -2,6 +2,7 @@ using System.Collections.ObjectModel; using System.Text.Json.Serialization; using System.Windows; +using System.Windows.Media; using CommunityToolkit.Mvvm.DependencyInjection; using Flow.Launcher.Infrastructure.Hotkey; using Flow.Launcher.Infrastructure.Logger; @@ -113,6 +114,7 @@ public string SettingWindowFont { _settingWindowFont = value; OnPropertyChanged(); + Application.Current.Resources["SettingWindowFont"] = new FontFamily(value); } } } diff --git a/Flow.Launcher/CustomQueryHotkeySetting.xaml b/Flow.Launcher/CustomQueryHotkeySetting.xaml index d3c31c6da5c..0171e6d79c3 100644 --- a/Flow.Launcher/CustomQueryHotkeySetting.xaml +++ b/Flow.Launcher/CustomQueryHotkeySetting.xaml @@ -8,7 +8,6 @@ Width="530" Background="{DynamicResource PopuBGColor}" DataContext="{Binding RelativeSource={RelativeSource Self}}" - FontFamily="{Binding Settings.SettingWindowFont, Mode=TwoWay}" Foreground="{DynamicResource PopupTextColor}" Icon="Images\app.png" MouseDown="window_MouseDown" diff --git a/Flow.Launcher/CustomShortcutSetting.xaml b/Flow.Launcher/CustomShortcutSetting.xaml index cbdcecea6a9..d8623753f63 100644 --- a/Flow.Launcher/CustomShortcutSetting.xaml +++ b/Flow.Launcher/CustomShortcutSetting.xaml @@ -7,7 +7,6 @@ Width="530" Background="{DynamicResource PopuBGColor}" DataContext="{Binding RelativeSource={RelativeSource Self}}" - FontFamily="{Binding Settings.SettingWindowFont, Mode=TwoWay}" Foreground="{DynamicResource PopupTextColor}" Icon="Images\app.png" ResizeMode="NoResize" diff --git a/Flow.Launcher/Languages/en.xaml b/Flow.Launcher/Languages/en.xaml index 04a26f09c86..72897521b6d 100644 --- a/Flow.Launcher/Languages/en.xaml +++ b/Flow.Launcher/Languages/en.xaml @@ -355,7 +355,7 @@ Log Level Debug Info - Setting Window Font + Setting Window Font Select File Manager diff --git a/Flow.Launcher/Resources/CustomControlTemplate.xaml b/Flow.Launcher/Resources/CustomControlTemplate.xaml index ef85e8724b7..be68fc1b1c6 100644 --- a/Flow.Launcher/Resources/CustomControlTemplate.xaml +++ b/Flow.Launcher/Resources/CustomControlTemplate.xaml @@ -4,6 +4,20 @@ xmlns:system="clr-namespace:System;assembly=mscorlib" xmlns:ui="http://schemas.modernwpf.com/2019"> + + + + + + diff --git a/Flow.Launcher/Resources/SettingWindowStyle.xaml b/Flow.Launcher/Resources/SettingWindowStyle.xaml index fc9246aa33d..c59baeaea4b 100644 --- a/Flow.Launcher/Resources/SettingWindowStyle.xaml +++ b/Flow.Launcher/Resources/SettingWindowStyle.xaml @@ -7,6 +7,7 @@ + Segoe UI F1 M512,512z M0,0z M448,256C448,150,362,64,256,64L256,448C362,448,448,362,448,256z M0,256A256,256,0,1,1,512,256A256,256,0,1,1,0,256z diff --git a/Flow.Launcher/SelectBrowserWindow.xaml b/Flow.Launcher/SelectBrowserWindow.xaml index 4fc5a91c5da..4a0928dc2e6 100644 --- a/Flow.Launcher/SelectBrowserWindow.xaml +++ b/Flow.Launcher/SelectBrowserWindow.xaml @@ -10,7 +10,6 @@ Width="550" Background="{DynamicResource PopuBGColor}" DataContext="{Binding RelativeSource={RelativeSource Self}}" - FontFamily="{Binding Settings.SettingWindowFont, Mode=TwoWay}" Foreground="{DynamicResource PopupTextColor}" ResizeMode="NoResize" SizeToContent="Height" diff --git a/Flow.Launcher/SelectFileManagerWindow.xaml b/Flow.Launcher/SelectFileManagerWindow.xaml index 7d1fe0f567f..0287af9b03a 100644 --- a/Flow.Launcher/SelectFileManagerWindow.xaml +++ b/Flow.Launcher/SelectFileManagerWindow.xaml @@ -10,7 +10,6 @@ Width="600" Background="{DynamicResource PopuBGColor}" DataContext="{Binding RelativeSource={RelativeSource Self}}" - FontFamily="{Binding Settings.SettingWindowFont, Mode=TwoWay}" Foreground="{DynamicResource PopupTextColor}" ResizeMode="NoResize" SizeToContent="Height" diff --git a/Flow.Launcher/SettingPages/Views/SettingsPaneAbout.xaml b/Flow.Launcher/SettingPages/Views/SettingsPaneAbout.xaml index 4bf5df227e5..1a92ad0c24a 100644 --- a/Flow.Launcher/SettingPages/Views/SettingsPaneAbout.xaml +++ b/Flow.Launcher/SettingPages/Views/SettingsPaneAbout.xaml @@ -103,10 +103,8 @@ Margin="0 0 12 0" Command="{Binding AskClearLogFolderConfirmationCommand}" Content="{Binding LogFolderSize, Mode=OneWay}" /> - + IsEnabled="{Binding NextEnabled, Mode=OneWay}"> + + From 25f39f6934921cc52a4f59243f7adef430b2ed0e Mon Sep 17 00:00:00 2001 From: DB p Date: Thu, 24 Apr 2025 11:08:02 +0900 Subject: [PATCH 02/28] Add dynamic font support for the setting window --- Flow.Launcher/App.xaml.cs | 2 ++ Flow.Launcher/SettingWindow.xaml | 1 + 2 files changed, 3 insertions(+) diff --git a/Flow.Launcher/App.xaml.cs b/Flow.Launcher/App.xaml.cs index 87698a54571..606536dad84 100644 --- a/Flow.Launcher/App.xaml.cs +++ b/Flow.Launcher/App.xaml.cs @@ -4,6 +4,7 @@ using System.Threading; using System.Threading.Tasks; using System.Windows; +using System.Windows.Media; using CommunityToolkit.Mvvm.DependencyInjection; using Flow.Launcher.Core; using Flow.Launcher.Core.Configuration; @@ -175,6 +176,7 @@ await API.StopwatchLogInfoAsync(ClassName, "Startup cost", async () => await imageLoadertask; _mainWindow = new MainWindow(); + Current.Resources["SettingWindowFont"] = new FontFamily(_settings.SettingWindowFont); API.LogInfo(ClassName, "Dependencies Info:{ErrorReporting.DependenciesInfo()}"); diff --git a/Flow.Launcher/SettingWindow.xaml b/Flow.Launcher/SettingWindow.xaml index ab27b235a2c..a34777d3020 100644 --- a/Flow.Launcher/SettingWindow.xaml +++ b/Flow.Launcher/SettingWindow.xaml @@ -13,6 +13,7 @@ MinHeight="600" d:DataContext="{d:DesignInstance vm:SettingWindowViewModel}" Closed="OnClosed" + FontFamily="{Binding Settings.SettingWindowFont, Mode=TwoWay}" Icon="Images\app.ico" Left="{Binding SettingWindowLeft, Mode=TwoWay}" Loaded="OnLoaded" From 8432fa3b40ceb87916676fc5021e7e72dac54078 Mon Sep 17 00:00:00 2001 From: DB p Date: Thu, 24 Apr 2025 11:25:21 +0900 Subject: [PATCH 03/28] Add SettingWindowFont definition to CustomControlTemplate --- Flow.Launcher/Resources/CustomControlTemplate.xaml | 1 + Flow.Launcher/Resources/SettingWindowStyle.xaml | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Flow.Launcher/Resources/CustomControlTemplate.xaml b/Flow.Launcher/Resources/CustomControlTemplate.xaml index be68fc1b1c6..4e94da526f7 100644 --- a/Flow.Launcher/Resources/CustomControlTemplate.xaml +++ b/Flow.Launcher/Resources/CustomControlTemplate.xaml @@ -5,6 +5,7 @@ xmlns:ui="http://schemas.modernwpf.com/2019"> + Segoe UI diff --git a/Flow.Launcher/Resources/SettingWindowStyle.xaml b/Flow.Launcher/Resources/SettingWindowStyle.xaml index c59baeaea4b..60655fa7c32 100644 --- a/Flow.Launcher/Resources/SettingWindowStyle.xaml +++ b/Flow.Launcher/Resources/SettingWindowStyle.xaml @@ -7,8 +7,6 @@ - Segoe UI - F1 M512,512z M0,0z M448,256C448,150,362,64,256,64L256,448C362,448,448,362,448,256z M0,256A256,256,0,1,1,512,256A256,256,0,1,1,0,256z + + {DynamicResource SettingWindowFont} + @@ -1360,7 +1363,6 @@ - @@ -1584,6 +1586,7 @@ diff --git a/Flow.Launcher/Resources/Pages/WelcomePage1.xaml b/Flow.Launcher/Resources/Pages/WelcomePage1.xaml index 32fdb62fc71..b6a99d9e993 100644 --- a/Flow.Launcher/Resources/Pages/WelcomePage1.xaml +++ b/Flow.Launcher/Resources/Pages/WelcomePage1.xaml @@ -127,7 +127,7 @@ Style="{DynamicResource StyleImageFadeIn}" /> - - + + @@ -89,29 +89,29 @@ - + @@ -81,26 +81,26 @@ Canvas.Left="0" Width="450" Height="280" - Margin="0,0,0,0" + Margin="0 0 0 0" Source="../../images/page_img01.png" Style="{DynamicResource StyleImageFadeIn}" /> - + diff --git a/Flow.Launcher/Resources/Pages/WelcomePage5.xaml b/Flow.Launcher/Resources/Pages/WelcomePage5.xaml index 3df4b506ed2..7495231aece 100644 --- a/Flow.Launcher/Resources/Pages/WelcomePage5.xaml +++ b/Flow.Launcher/Resources/Pages/WelcomePage5.xaml @@ -79,18 +79,18 @@ - + - + - + + Padding="5 18 0 0"> + Margin="5 24 0 0"> @@ -97,8 +97,8 @@ - - + + - + @@ -86,23 +86,23 @@ Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" - Margin="5,0,0,20"> + Margin="5 0 0 20"> @@ -180,18 +180,18 @@ Grid.Row="1" Background="{DynamicResource PopupButtonAreaBGColor}" BorderBrush="{DynamicResource PopupButtonAreaBorderColor}" - BorderThickness="0,1,0,0"> + BorderThickness="0 1 0 0"> - - + + - + - + + BorderThickness="0 1 0 0"> - - + + - + @@ -104,16 +104,16 @@ HorizontalAlignment="Stretch" Click="BrowseButton_Click" Content="{DynamicResource flowlauncher_plugin_program_browse}" - Visibility="{Binding IsCustomSource, Converter={StaticResource BooleanToVisibilityConverter}}" - DockPanel.Dock="Right" /> + DockPanel.Dock="Right" + Visibility="{Binding IsCustomSource, Converter={StaticResource BooleanToVisibilityConverter}}" /> + VerticalAlignment="Center" + IsReadOnly="{Binding IsNotCustomSource}" + Text="{Binding Location, Mode=TwoWay}" /> + Margin="10 0" + VerticalAlignment="Center" + IsChecked="{Binding Enabled, Mode=TwoWay}" /> + BorderThickness="0 1 0 0"> - + - + @@ -151,82 +151,82 @@ TextWrapping="Wrap" /> - + - + appref-ms exe lnk + BorderThickness="1 0 0 0"> @@ -237,27 +237,27 @@ Grid.Row="1" Background="{DynamicResource PopupButtonAreaBGColor}" BorderBrush="{DynamicResource PopupButtonAreaBorderColor}" - BorderThickness="0,1,0,0"> + BorderThickness="0 1 0 0">