Skip to content

Commit f387eba

Browse files
authored
Merge pull request #3819 from Flow-Launcher/home_page_update
Fix Home Page Update Issue
2 parents b3d2fea + 67ec700 commit f387eba

File tree

3 files changed

+33
-9
lines changed

3 files changed

+33
-9
lines changed

Flow.Launcher.Infrastructure/UserSettings/Settings.cs

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,37 @@ public void Save()
4040
}
4141

4242
public string Hotkey { get; set; } = $"{KeyConstant.Alt} + {KeyConstant.Space}";
43-
public string OpenResultModifiers { get; set; } = KeyConstant.Alt;
43+
44+
private string _openResultModifiers = KeyConstant.Alt;
45+
public string OpenResultModifiers
46+
{
47+
get => _openResultModifiers;
48+
set
49+
{
50+
if (_openResultModifiers != value)
51+
{
52+
_openResultModifiers = value;
53+
OnPropertyChanged();
54+
}
55+
}
56+
}
57+
4458
public string ColorScheme { get; set; } = "System";
45-
public bool ShowOpenResultHotkey { get; set; } = true;
59+
60+
private bool _showOpenResultHotkey = true;
61+
public bool ShowOpenResultHotkey
62+
{
63+
get => _showOpenResultHotkey;
64+
set
65+
{
66+
if (_showOpenResultHotkey != value)
67+
{
68+
_showOpenResultHotkey = value;
69+
OnPropertyChanged();
70+
}
71+
}
72+
}
73+
4674
public double WindowSize { get; set; } = 580;
4775
public string PreviewHotkey { get; set; } = $"F1";
4876
public string AutoCompleteHotkey { get; set; } = $"{KeyConstant.Ctrl} + Tab";

Flow.Launcher/ResultListBox.xaml

Lines changed: 3 additions & 2 deletions
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}" />
@@ -79,7 +80,7 @@
7980
Style="{DynamicResource ItemHotkeyStyle}">
8081
<TextBlock.Text>
8182
<MultiBinding StringFormat="{}{0}+{1}">
82-
<Binding Path="OpenResultModifiers" />
83+
<Binding Mode="OneWay" Path="Settings.OpenResultModifiers" />
8384
<Binding Converter="{StaticResource ResourceKey=OrdinalConverter}" RelativeSource="{RelativeSource Mode=FindAncestor, AncestorType=ListBoxItem}" />
8485
</MultiBinding>
8586
</TextBlock.Text>

Flow.Launcher/ViewModel/ResultViewModel.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,6 @@ public ResultViewModel(Result result, Settings settings)
6464

6565
public Settings Settings { get; }
6666

67-
public Visibility ShowOpenResultHotkey =>
68-
Settings.ShowOpenResultHotkey ? Visibility.Visible : Visibility.Collapsed;
69-
7067
public Visibility ShowDefaultPreview => Result.PreviewPanel == null ? Visibility.Visible : Visibility.Collapsed;
7168

7269
public Visibility ShowCustomizedPreview => Result.PreviewPanel == null ? Visibility.Collapsed : Visibility.Visible;
@@ -152,8 +149,6 @@ public Visibility ShowBadge
152149

153150
private bool PreviewImageAvailable => !string.IsNullOrEmpty(Result.Preview.PreviewImagePath) || Result.Preview.PreviewDelegate != null;
154151

155-
public string OpenResultModifiers => Settings.OpenResultModifiers;
156-
157152
public string ShowTitleToolTip => string.IsNullOrEmpty(Result.TitleToolTip)
158153
? Result.Title
159154
: Result.TitleToolTip;

0 commit comments

Comments
 (0)