From 25f39f6934921cc52a4f59243f7adef430b2ed0e Mon Sep 17 00:00:00 2001 From: DB p Date: Thu, 24 Apr 2025 11:08:02 +0900 Subject: [PATCH] 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 87698a545..606536dad 100644 --- a/Flow.Launcher/App.xaml.cs +++ b/Flow.Launcher/App.xaml.cs @@ -4,6 +4,7 @@ using System.Text; 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 @@ namespace Flow.Launcher 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 ab27b235a..a34777d30 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"