Skip to content

Commit 01f896a

Browse files
committed
Support global query only
1 parent 2eda64a commit 01f896a

File tree

4 files changed

+28
-9
lines changed

4 files changed

+28
-9
lines changed

Flow.Launcher.Infrastructure/UserSettings/Settings.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ public string Theme
102102
public bool UseSound { get; set; } = true;
103103
public double SoundVolume { get; set; } = 50;
104104
public bool ShowBadges { get; set; } = false;
105+
public bool ShowBadgesGlobalOnly { get; set; } = false;
105106

106107
public bool UseClock { get; set; } = true;
107108
public bool UseDate { get; set; } = false;

Flow.Launcher/Languages/en.xaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,8 @@
285285
<system:String x:Key="flowlauncherPressHotkey">Press Key</system:String>
286286
<system:String x:Key="showBadges">Show Result Badges</system:String>
287287
<system:String x:Key="showBadgesToolTip">Show badges for query results where supported</system:String>
288+
<system:String x:Key="showBadgesGlobalOnly">Show Result Badges Only for Global Query</system:String>
289+
<system:String x:Key="showBadgesGlobalOnlyToolTip">Show badges only for global query results</system:String>
288290

289291
<!-- Setting Proxy -->
290292
<system:String x:Key="proxy">HTTP Proxy</system:String>

Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -711,16 +711,27 @@
711711
</cc:Card>
712712

713713
<!-- Badges -->
714-
<cc:Card
714+
<cc:ExCard
715715
Title="{DynamicResource showBadges}"
716716
Margin="0 0 0 0"
717717
Icon="&#xEC1B;"
718718
Sub="{DynamicResource showBadgesToolTip}">
719-
<ui:ToggleSwitch
720-
IsOn="{Binding Settings.ShowBadges}"
721-
OffContent="{DynamicResource disable}"
722-
OnContent="{DynamicResource enable}" />
723-
</cc:Card>
719+
<cc:ExCard.SideContent>
720+
<ui:ToggleSwitch
721+
IsOn="{Binding Settings.ShowBadges}"
722+
OffContent="{DynamicResource disable}"
723+
OnContent="{DynamicResource enable}" />
724+
</cc:ExCard.SideContent>
725+
<cc:Card
726+
Title="{DynamicResource showBadgesGlobalOnly}"
727+
Sub="{DynamicResource showBadgesGlobalOnlyToolTip}"
728+
Type="InsideFit">
729+
<ui:ToggleSwitch
730+
IsOn="{Binding Settings.ShowBadgesGlobalOnly}"
731+
OffContent="{DynamicResource disable}"
732+
OnContent="{DynamicResource enable}" />
733+
</cc:Card>
734+
</cc:ExCard>
724735

725736
<!-- Settings color scheme -->
726737
<cc:Card

Flow.Launcher/ViewModel/ResultViewModel.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,18 @@ public Visibility ShowBadge
127127
{
128128
get
129129
{
130-
if (Settings.ShowBadges && BadgeIconAvailable)
131-
return Visibility.Visible;
130+
if (!Settings.ShowBadges || !BadgeIconAvailable)
131+
return Visibility.Collapsed;
132+
133+
if (Settings.ShowBadgesGlobalOnly && !IsGlobalQuery)
134+
return Visibility.Collapsed;
132135

133-
return Visibility.Collapsed;
136+
return Visibility.Visible;
134137
}
135138
}
136139

140+
public bool IsGlobalQuery => Result.OriginQuery.ActionKeyword == Query.GlobalPluginWildcardSign;
141+
137142
private bool GlyphAvailable => Glyph is not null;
138143

139144
private bool ImgIconAvailable => !string.IsNullOrEmpty(Result.IcoPath) || Result.Icon is not null;

0 commit comments

Comments
 (0)