Skip to content

Commit f50f2ff

Browse files
committed
Implement dynamic font settings for the setting window
1 parent 3da3c59 commit f50f2ff

File tree

12 files changed

+30
-22
lines changed

12 files changed

+30
-22
lines changed

Flow.Launcher.Infrastructure/UserSettings/Settings.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Collections.ObjectModel;
33
using System.Text.Json.Serialization;
44
using System.Windows;
5+
using System.Windows.Media;
56
using CommunityToolkit.Mvvm.DependencyInjection;
67
using Flow.Launcher.Infrastructure.Hotkey;
78
using Flow.Launcher.Infrastructure.Logger;
@@ -113,6 +114,7 @@ public string SettingWindowFont
113114
{
114115
_settingWindowFont = value;
115116
OnPropertyChanged();
117+
Application.Current.Resources["SettingWindowFont"] = new FontFamily(value);
116118
}
117119
}
118120
}

Flow.Launcher/CustomQueryHotkeySetting.xaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
Width="530"
99
Background="{DynamicResource PopuBGColor}"
1010
DataContext="{Binding RelativeSource={RelativeSource Self}}"
11-
FontFamily="{Binding Settings.SettingWindowFont, Mode=TwoWay}"
1211
Foreground="{DynamicResource PopupTextColor}"
1312
Icon="Images\app.png"
1413
MouseDown="window_MouseDown"

Flow.Launcher/CustomShortcutSetting.xaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
Width="530"
88
Background="{DynamicResource PopuBGColor}"
99
DataContext="{Binding RelativeSource={RelativeSource Self}}"
10-
FontFamily="{Binding Settings.SettingWindowFont, Mode=TwoWay}"
1110
Foreground="{DynamicResource PopupTextColor}"
1211
Icon="Images\app.png"
1312
ResizeMode="NoResize"

Flow.Launcher/Languages/en.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@
355355
<system:String x:Key="logLevel">Log Level</system:String>
356356
<system:String x:Key="LogLevelDEBUG">Debug</system:String>
357357
<system:String x:Key="LogLevelINFO">Info</system:String>
358-
<system:String x:Key="settingWindowFont">Setting Window Font</system:String>
358+
<system:String x:Key="settingWindowFontTitle">Setting Window Font</system:String>
359359

360360
<!-- FileManager Setting Dialog -->
361361
<system:String x:Key="fileManagerWindow">Select File Manager</system:String>

Flow.Launcher/Resources/CustomControlTemplate.xaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,20 @@
44
xmlns:system="clr-namespace:System;assembly=mscorlib"
55
xmlns:ui="http://schemas.modernwpf.com/2019">
66

7+
<!-- Setting Window Font -->
8+
<Style TargetType="ui:FontIcon">
9+
<Setter Property="FontFamily" Value="/Resources/#Segoe Fluent Icons" />
10+
</Style>
11+
<Style TargetType="Control">
12+
<Setter Property="FontFamily" Value="{DynamicResource SettingWindowFont}" />
13+
</Style>
14+
<Style TargetType="TextBlock">
15+
<Setter Property="FontFamily" Value="{DynamicResource SettingWindowFont}" />
16+
</Style>
17+
<Style TargetType="Window">
18+
<Setter Property="FontFamily" Value="{DynamicResource SettingWindowFont}" />
19+
</Style>
20+
721
<ContextMenu x:Key="TextBoxContextMenu">
822
<MenuItem Command="ApplicationCommands.Cut" Header="{DynamicResource cut}">
923
<MenuItem.Icon>

Flow.Launcher/Resources/SettingWindowStyle.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
88
<converters:TextConverter x:Key="TextConverter" />
99
<core:TranslationConverter x:Key="TranslationConverter" />
10+
<FontFamily x:Key="SettingWindowFont">Segoe UI</FontFamily>
1011

1112
<!-- Icon for Theme Type Label -->
1213
<Geometry x:Key="circle_half_stroke_solid">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</Geometry>

Flow.Launcher/SelectBrowserWindow.xaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
Width="550"
1111
Background="{DynamicResource PopuBGColor}"
1212
DataContext="{Binding RelativeSource={RelativeSource Self}}"
13-
FontFamily="{Binding Settings.SettingWindowFont, Mode=TwoWay}"
1413
Foreground="{DynamicResource PopupTextColor}"
1514
ResizeMode="NoResize"
1615
SizeToContent="Height"

Flow.Launcher/SelectFileManagerWindow.xaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
Width="600"
1111
Background="{DynamicResource PopuBGColor}"
1212
DataContext="{Binding RelativeSource={RelativeSource Self}}"
13-
FontFamily="{Binding Settings.SettingWindowFont, Mode=TwoWay}"
1413
Foreground="{DynamicResource PopupTextColor}"
1514
ResizeMode="NoResize"
1615
SizeToContent="Height"

Flow.Launcher/SettingPages/Views/SettingsPaneAbout.xaml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,8 @@
103103
Margin="0 0 12 0"
104104
Command="{Binding AskClearLogFolderConfirmationCommand}"
105105
Content="{Binding LogFolderSize, Mode=OneWay}" />
106-
<Button
107-
Content="&#xec7a;"
108-
FontFamily="/Resources/#Segoe Fluent Icons"
109-
FontSize="20">
106+
<Button>
107+
<ui:FontIcon FontSize="20" Glyph="&#xec7a;" />
110108
<ui:FlyoutService.Flyout>
111109
<ui:MenuFlyout>
112110
<MenuItem Command="{Binding OpenWelcomeWindowCommand}" Header="{DynamicResource welcomewindow}">
@@ -148,7 +146,7 @@
148146
SelectedValuePath="Value" />
149147
</cc:Card>
150148
<cc:Card
151-
Title="{DynamicResource settingWindowFont}"
149+
Title="{DynamicResource settingWindowFontTitle}"
152150
Icon="&#xf259;"
153151
Type="Inside">
154152
<StackPanel Orientation="Horizontal">

Flow.Launcher/SettingPages/Views/SettingsPanePlugins.xaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@
5858
Margin="0 0 20 0"
5959
Command="{Binding OpenHelperCommand}"
6060
CommandParameter="{Binding RelativeSource={RelativeSource Self}}"
61-
Content="&#xe9ce;"
62-
FontFamily="{DynamicResource SymbolThemeFontFamily}"
63-
FontSize="14" />
61+
FontSize="14">
62+
<ui:FontIcon FontSize="14" Glyph="&#xe9ce;" />
63+
</Button>
6464
<TextBox
6565
Name="PluginFilterTextbox"
6666
Width="150"

0 commit comments

Comments
 (0)