Merge pull request #3819 from Flow-Launcher/home_page_update

Fix Home Page Update Issue
This commit is contained in:
Jack Ye 2025-07-13 18:23:03 +08:00 committed by GitHub
commit f387eba946
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 33 additions and 9 deletions

View file

@ -40,9 +40,37 @@ namespace Flow.Launcher.Infrastructure.UserSettings
}
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";

View file

@ -36,6 +36,7 @@
<converter:BadgePositionConverter x:Key="BadgePositionConverter" />
<converter:IconRadiusConverter x:Key="IconRadiusConverter" />
<converter:DiameterToCenterPointConverter x:Key="DiameterToCenterPointConverter" />
<converter:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
</ListBox.Resources>
<ListBox.ItemTemplate>
<DataTemplate>
@ -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}}">
<Border x:Name="HotkeyBG" Style="{DynamicResource ItemHotkeyBGStyle}">
<Border.Visibility>
<Binding Converter="{StaticResource ResourceKey=OpenResultHotkeyVisibilityConverter}" RelativeSource="{RelativeSource Mode=FindAncestor, AncestorType=ListBoxItem}" />
@ -79,7 +80,7 @@
Style="{DynamicResource ItemHotkeyStyle}">
<TextBlock.Text>
<MultiBinding StringFormat="{}{0}+{1}">
<Binding Path="OpenResultModifiers" />
<Binding Mode="OneWay" Path="Settings.OpenResultModifiers" />
<Binding Converter="{StaticResource ResourceKey=OrdinalConverter}" RelativeSource="{RelativeSource Mode=FindAncestor, AncestorType=ListBoxItem}" />
</MultiBinding>
</TextBlock.Text>

View file

@ -64,9 +64,6 @@ namespace Flow.Launcher.ViewModel
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 @@ namespace Flow.Launcher.ViewModel
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;