Support global query only

This commit is contained in:
Jack251970 2025-04-11 16:11:39 +08:00
parent 2eda64aa7a
commit 01f896a578
4 changed files with 28 additions and 9 deletions

View file

@ -102,6 +102,7 @@ namespace Flow.Launcher.Infrastructure.UserSettings
public bool UseSound { get; set; } = true;
public double SoundVolume { get; set; } = 50;
public bool ShowBadges { get; set; } = false;
public bool ShowBadgesGlobalOnly { get; set; } = false;
public bool UseClock { get; set; } = true;
public bool UseDate { get; set; } = false;

View file

@ -285,6 +285,8 @@
<system:String x:Key="flowlauncherPressHotkey">Press Key</system:String>
<system:String x:Key="showBadges">Show Result Badges</system:String>
<system:String x:Key="showBadgesToolTip">Show badges for query results where supported</system:String>
<system:String x:Key="showBadgesGlobalOnly">Show Result Badges Only for Global Query</system:String>
<system:String x:Key="showBadgesGlobalOnlyToolTip">Show badges only for global query results</system:String>
<!-- Setting Proxy -->
<system:String x:Key="proxy">HTTP Proxy</system:String>

View file

@ -711,16 +711,27 @@
</cc:Card>
<!-- Badges -->
<cc:Card
<cc:ExCard
Title="{DynamicResource showBadges}"
Margin="0 0 0 0"
Icon="&#xEC1B;"
Sub="{DynamicResource showBadgesToolTip}">
<ui:ToggleSwitch
IsOn="{Binding Settings.ShowBadges}"
OffContent="{DynamicResource disable}"
OnContent="{DynamicResource enable}" />
</cc:Card>
<cc:ExCard.SideContent>
<ui:ToggleSwitch
IsOn="{Binding Settings.ShowBadges}"
OffContent="{DynamicResource disable}"
OnContent="{DynamicResource enable}" />
</cc:ExCard.SideContent>
<cc:Card
Title="{DynamicResource showBadgesGlobalOnly}"
Sub="{DynamicResource showBadgesGlobalOnlyToolTip}"
Type="InsideFit">
<ui:ToggleSwitch
IsOn="{Binding Settings.ShowBadgesGlobalOnly}"
OffContent="{DynamicResource disable}"
OnContent="{DynamicResource enable}" />
</cc:Card>
</cc:ExCard>
<!-- Settings color scheme -->
<cc:Card

View file

@ -127,13 +127,18 @@ namespace Flow.Launcher.ViewModel
{
get
{
if (Settings.ShowBadges && BadgeIconAvailable)
return Visibility.Visible;
if (!Settings.ShowBadges || !BadgeIconAvailable)
return Visibility.Collapsed;
return Visibility.Collapsed;
if (Settings.ShowBadgesGlobalOnly && !IsGlobalQuery)
return Visibility.Collapsed;
return Visibility.Visible;
}
}
public bool IsGlobalQuery => Result.OriginQuery.ActionKeyword == Query.GlobalPluginWildcardSign;
private bool GlyphAvailable => Glyph is not null;
private bool ImgIconAvailable => !string.IsNullOrEmpty(Result.IcoPath) || Result.Icon is not null;