diff --git a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs index d55daf17551..0e755b4f425 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs @@ -40,9 +40,37 @@ public void Save() } public string Hotkey { get; set; } = $"{KeyConstant.Alt} + {KeyConstant.Space}"; - public string OpenResultModifiers { get; set; } = KeyConstant.Alt; + + private string _openResultModifiers = KeyConstant.Alt; + public string OpenResultModifiers + { + get => _openResultModifiers; + set + { + if (_openResultModifiers != value) + { + _openResultModifiers = value; + OnPropertyChanged(); + } + } + } + public string ColorScheme { get; set; } = "System"; - public bool ShowOpenResultHotkey { get; set; } = true; + + private bool _showOpenResultHotkey = true; + public bool ShowOpenResultHotkey + { + get => _showOpenResultHotkey; + set + { + if (_showOpenResultHotkey != value) + { + _showOpenResultHotkey = value; + OnPropertyChanged(); + } + } + } + public double WindowSize { get; set; } = 580; public string PreviewHotkey { get; set; } = $"F1"; public string AutoCompleteHotkey { get; set; } = $"{KeyConstant.Ctrl} + Tab"; diff --git a/Flow.Launcher/ResultListBox.xaml b/Flow.Launcher/ResultListBox.xaml index 8cb15400f18..e469bb63b16 100644 --- a/Flow.Launcher/ResultListBox.xaml +++ b/Flow.Launcher/ResultListBox.xaml @@ -36,6 +36,7 @@ + @@ -66,7 +67,7 @@ Grid.Column="2" Margin="0 0 10 0" VerticalAlignment="Center" - Visibility="{Binding ShowOpenResultHotkey}"> + Visibility="{Binding Settings.ShowOpenResultHotkey, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}"> @@ -79,7 +80,7 @@ Style="{DynamicResource ItemHotkeyStyle}"> - + diff --git a/Flow.Launcher/ViewModel/ResultViewModel.cs b/Flow.Launcher/ViewModel/ResultViewModel.cs index 648ac49bbf2..c58abae28ee 100644 --- a/Flow.Launcher/ViewModel/ResultViewModel.cs +++ b/Flow.Launcher/ViewModel/ResultViewModel.cs @@ -64,9 +64,6 @@ public ResultViewModel(Result result, Settings settings) public Settings Settings { get; } - public Visibility ShowOpenResultHotkey => - Settings.ShowOpenResultHotkey ? Visibility.Visible : Visibility.Collapsed; - public Visibility ShowDefaultPreview => Result.PreviewPanel == null ? Visibility.Visible : Visibility.Collapsed; public Visibility ShowCustomizedPreview => Result.PreviewPanel == null ? Visibility.Collapsed : Visibility.Visible; @@ -152,8 +149,6 @@ public Visibility ShowBadge private bool PreviewImageAvailable => !string.IsNullOrEmpty(Result.Preview.PreviewImagePath) || Result.Preview.PreviewDelegate != null; - public string OpenResultModifiers => Settings.OpenResultModifiers; - public string ShowTitleToolTip => string.IsNullOrEmpty(Result.TitleToolTip) ? Result.Title : Result.TitleToolTip;