From 942b29061edfbd9102f63c7d3f14316408cd6954 Mon Sep 17 00:00:00 2001 From: DB P Date: Sat, 19 Apr 2025 15:40:11 +0900 Subject: [PATCH] Add FontFamily Style --- Flow.Launcher/CustomQueryHotkeySetting.xaml | 1 + .../CustomQueryHotkeySetting.xaml.cs | 21 +++++++- Flow.Launcher/CustomShortcutSetting.xaml.cs | 23 ++++++++- Flow.Launcher/SelectBrowserWindow.xaml | 51 +++++++++---------- Flow.Launcher/SelectBrowserWindow.xaml.cs | 17 ++++++- Flow.Launcher/SelectFileManagerWindow.xaml | 1 + Flow.Launcher/SelectFileManagerWindow.xaml.cs | 16 ++++++ 7 files changed, 101 insertions(+), 29 deletions(-) diff --git a/Flow.Launcher/CustomQueryHotkeySetting.xaml b/Flow.Launcher/CustomQueryHotkeySetting.xaml index 0171e6d79..a460ffae0 100644 --- a/Flow.Launcher/CustomQueryHotkeySetting.xaml +++ b/Flow.Launcher/CustomQueryHotkeySetting.xaml @@ -4,6 +4,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:flowlauncher="clr-namespace:Flow.Launcher" + FontFamily="{Binding SettingWindowFont, Mode=TwoWay}" Title="{DynamicResource customeQueryHotkeyTitle}" Width="530" Background="{DynamicResource PopuBGColor}" diff --git a/Flow.Launcher/CustomQueryHotkeySetting.xaml.cs b/Flow.Launcher/CustomQueryHotkeySetting.xaml.cs index 8b193fa1d..c377fb250 100644 --- a/Flow.Launcher/CustomQueryHotkeySetting.xaml.cs +++ b/Flow.Launcher/CustomQueryHotkeySetting.xaml.cs @@ -1,6 +1,7 @@ using Flow.Launcher.Helper; using Flow.Launcher.Infrastructure.UserSettings; using System.Collections.ObjectModel; +using System.ComponentModel; using System.Linq; using System.Windows; using System.Windows.Input; @@ -13,7 +14,25 @@ namespace Flow.Launcher private readonly Settings _settings; private bool update; private CustomPluginHotkey updateCustomHotkey; - + public event PropertyChangedEventHandler PropertyChanged; + + public string SettingWindowFont + { + get => _settings.SettingWindowFont; + set + { + if (_settings.SettingWindowFont != value) + { + _settings.SettingWindowFont = value; + OnPropertyChanged(nameof(SettingWindowFont)); + } + } + } + + protected virtual void OnPropertyChanged(string propertyName) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } public CustomQueryHotkeySetting(Settings settings) { _settings = settings; diff --git a/Flow.Launcher/CustomShortcutSetting.xaml.cs b/Flow.Launcher/CustomShortcutSetting.xaml.cs index ecbdea606..dcfa572f4 100644 --- a/Flow.Launcher/CustomShortcutSetting.xaml.cs +++ b/Flow.Launcher/CustomShortcutSetting.xaml.cs @@ -1,6 +1,8 @@ using System; +using System.ComponentModel; using System.Windows; using System.Windows.Input; +using Flow.Launcher.Infrastructure.UserSettings; using Flow.Launcher.SettingPages.ViewModels; namespace Flow.Launcher @@ -13,7 +15,26 @@ namespace Flow.Launcher private string originalKey { get; } = null; private string originalValue { get; } = null; private bool update { get; } = false; - + private readonly Settings _settings; + public event PropertyChangedEventHandler PropertyChanged; + + public string SettingWindowFont + { + get => _settings.SettingWindowFont; + set + { + if (_settings.SettingWindowFont != value) + { + _settings.SettingWindowFont = value; + OnPropertyChanged(nameof(SettingWindowFont)); + } + } + } + + protected virtual void OnPropertyChanged(string propertyName) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } public CustomShortcutSetting(SettingsPaneHotkeyViewModel vm) { _hotkeyVm = vm; diff --git a/Flow.Launcher/SelectBrowserWindow.xaml b/Flow.Launcher/SelectBrowserWindow.xaml index c12879a04..b16de2770 100644 --- a/Flow.Launcher/SelectBrowserWindow.xaml +++ b/Flow.Launcher/SelectBrowserWindow.xaml @@ -10,6 +10,7 @@ Width="550" Background="{DynamicResource PopuBGColor}" DataContext="{Binding RelativeSource={RelativeSource Self}}" + FontFamily="{Binding SettingWindowFont, Mode=TwoWay}" Foreground="{DynamicResource PopupTextColor}" ResizeMode="NoResize" SizeToContent="Height" @@ -54,11 +55,11 @@ - - + + - +