diff --git a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs index 52bc63ec6..0f878151e 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs @@ -96,7 +96,6 @@ namespace Flow.Launcher.Infrastructure.UserSettings public string ResultSubFontStyle { get; set; } public string ResultSubFontWeight { get; set; } public string ResultSubFontStretch { get; set; } - public string SettingWindowFont { get; set; } = Win32Helper.GetSystemDefaultFont(false); public bool UseGlyphIcons { get; set; } = true; public bool UseAnimation { get; set; } = true; public bool UseSound { get; set; } = true; @@ -104,6 +103,20 @@ namespace Flow.Launcher.Infrastructure.UserSettings public bool ShowBadges { get; set; } = false; public bool ShowBadgesGlobalOnly { get; set; } = false; + private string _settingWindowFont { get; set; } = Win32Helper.GetSystemDefaultFont(false); + public string SettingWindowFont + { + get => _settingWindowFont; + set + { + if (_settingWindowFont != value) + { + _settingWindowFont = value; + OnPropertyChanged(); + } + } + } + public bool UseClock { get; set; } = true; public bool UseDate { get; set; } = false; public string TimeFormat { get; set; } = "hh:mm tt"; diff --git a/Flow.Launcher/CustomQueryHotkeySetting.xaml b/Flow.Launcher/CustomQueryHotkeySetting.xaml index a460ffae0..d3c31c6da 100644 --- a/Flow.Launcher/CustomQueryHotkeySetting.xaml +++ b/Flow.Launcher/CustomQueryHotkeySetting.xaml @@ -4,11 +4,11 @@ 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}" 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/CustomQueryHotkeySetting.xaml.cs b/Flow.Launcher/CustomQueryHotkeySetting.xaml.cs index c377fb250..3c501d41a 100644 --- a/Flow.Launcher/CustomQueryHotkeySetting.xaml.cs +++ b/Flow.Launcher/CustomQueryHotkeySetting.xaml.cs @@ -1,41 +1,23 @@ -using Flow.Launcher.Helper; -using Flow.Launcher.Infrastructure.UserSettings; -using System.Collections.ObjectModel; -using System.ComponentModel; +using System.Collections.ObjectModel; using System.Linq; using System.Windows; using System.Windows.Input; using System.Windows.Controls; +using Flow.Launcher.Helper; +using Flow.Launcher.Infrastructure.UserSettings; namespace Flow.Launcher { public partial class CustomQueryHotkeySetting : Window { - private readonly Settings _settings; + public Settings Settings { get; set; } + 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; + Settings = settings; InitializeComponent(); } @@ -48,13 +30,13 @@ namespace Flow.Launcher { if (!update) { - _settings.CustomPluginHotkeys ??= new ObservableCollection(); + Settings.CustomPluginHotkeys ??= new ObservableCollection(); var pluginHotkey = new CustomPluginHotkey { Hotkey = HotkeyControl.CurrentHotkey.ToString(), ActionKeyword = tbAction.Text }; - _settings.CustomPluginHotkeys.Add(pluginHotkey); + Settings.CustomPluginHotkeys.Add(pluginHotkey); HotKeyMapper.SetCustomQueryHotkey(pluginHotkey); } @@ -73,7 +55,7 @@ namespace Flow.Launcher public void UpdateItem(CustomPluginHotkey item) { - updateCustomHotkey = _settings.CustomPluginHotkeys.FirstOrDefault(o => + updateCustomHotkey = Settings.CustomPluginHotkeys.FirstOrDefault(o => o.ActionKeyword == item.ActionKeyword && o.Hotkey == item.Hotkey); if (updateCustomHotkey == null) { diff --git a/Flow.Launcher/CustomShortcutSetting.xaml b/Flow.Launcher/CustomShortcutSetting.xaml index 9256a2c52..cbdcecea6 100644 --- a/Flow.Launcher/CustomShortcutSetting.xaml +++ b/Flow.Launcher/CustomShortcutSetting.xaml @@ -7,6 +7,7 @@ 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" @@ -56,11 +57,11 @@ - - + + - + @@ -124,14 +125,14 @@ LastChildFill="True">