Skip to content

Commit c5373f6

Browse files
committed
Use one way binding for showing result hotkey
1 parent b3d2fea commit c5373f6

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

Flow.Launcher.Infrastructure/UserSettings/Settings.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,21 @@ public void Save()
4242
public string Hotkey { get; set; } = $"{KeyConstant.Alt} + {KeyConstant.Space}";
4343
public string OpenResultModifiers { get; set; } = KeyConstant.Alt;
4444
public string ColorScheme { get; set; } = "System";
45-
public bool ShowOpenResultHotkey { get; set; } = true;
45+
46+
private bool _showOpenResultHotkey = true;
47+
public bool ShowOpenResultHotkey
48+
{
49+
get => _showOpenResultHotkey;
50+
set
51+
{
52+
if (_showOpenResultHotkey != value)
53+
{
54+
_showOpenResultHotkey = value;
55+
OnPropertyChanged();
56+
}
57+
}
58+
}
59+
4660
public double WindowSize { get; set; } = 580;
4761
public string PreviewHotkey { get; set; } = $"F1";
4862
public string AutoCompleteHotkey { get; set; } = $"{KeyConstant.Ctrl} + Tab";

Flow.Launcher/ResultListBox.xaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
<converter:BadgePositionConverter x:Key="BadgePositionConverter" />
3737
<converter:IconRadiusConverter x:Key="IconRadiusConverter" />
3838
<converter:DiameterToCenterPointConverter x:Key="DiameterToCenterPointConverter" />
39+
<converter:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
3940
</ListBox.Resources>
4041
<ListBox.ItemTemplate>
4142
<DataTemplate>
@@ -66,7 +67,7 @@
6667
Grid.Column="2"
6768
Margin="0 0 10 0"
6869
VerticalAlignment="Center"
69-
Visibility="{Binding ShowOpenResultHotkey}">
70+
Visibility="{Binding Settings.ShowOpenResultHotkey, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}">
7071
<Border x:Name="HotkeyBG" Style="{DynamicResource ItemHotkeyBGStyle}">
7172
<Border.Visibility>
7273
<Binding Converter="{StaticResource ResourceKey=OpenResultHotkeyVisibilityConverter}" RelativeSource="{RelativeSource Mode=FindAncestor, AncestorType=ListBoxItem}" />

0 commit comments

Comments
 (0)