Skip to content

Commit 25f39f6

Browse files
committed
Add dynamic font support for the setting window
1 parent f50f2ff commit 25f39f6

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

Flow.Launcher/App.xaml.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.Threading;
55
using System.Threading.Tasks;
66
using System.Windows;
7+
using System.Windows.Media;
78
using CommunityToolkit.Mvvm.DependencyInjection;
89
using Flow.Launcher.Core;
910
using Flow.Launcher.Core.Configuration;
@@ -175,6 +176,7 @@ await API.StopwatchLogInfoAsync(ClassName, "Startup cost", async () =>
175176
await imageLoadertask;
176177

177178
_mainWindow = new MainWindow();
179+
Current.Resources["SettingWindowFont"] = new FontFamily(_settings.SettingWindowFont);
178180

179181
API.LogInfo(ClassName, "Dependencies Info:{ErrorReporting.DependenciesInfo()}");
180182

Flow.Launcher/SettingWindow.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
MinHeight="600"
1414
d:DataContext="{d:DesignInstance vm:SettingWindowViewModel}"
1515
Closed="OnClosed"
16+
FontFamily="{Binding Settings.SettingWindowFont, Mode=TwoWay}"
1617
Icon="Images\app.ico"
1718
Left="{Binding SettingWindowLeft, Mode=TwoWay}"
1819
Loaded="OnLoaded"

0 commit comments

Comments
 (0)