From c5373f6abf29e95bd3452ea3ee1f6e999b796fc4 Mon Sep 17 00:00:00 2001
From: Jack251970 <1160210343@qq.com>
Date: Sun, 13 Jul 2025 10:51:03 +0800
Subject: [PATCH] Use one way binding for showing result hotkey
---
.../UserSettings/Settings.cs | 16 +++++++++++++++-
Flow.Launcher/ResultListBox.xaml | 3 ++-
2 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs
index d55daf175..1a5367499 100644
--- a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs
+++ b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs
@@ -42,7 +42,21 @@ namespace Flow.Launcher.Infrastructure.UserSettings
public string Hotkey { get; set; } = $"{KeyConstant.Alt} + {KeyConstant.Space}";
public string OpenResultModifiers { get; set; } = KeyConstant.Alt;
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 8cb15400f..9b5235217 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}}">