From 47398f104f316675f4193af1ff6df1865f587047 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Fri, 11 Apr 2025 14:58:47 +0800 Subject: [PATCH] Add ShowPluginBadges settings --- Flow.Launcher.Infrastructure/UserSettings/Settings.cs | 1 + Flow.Launcher/ResultListBox.xaml | 2 +- Flow.Launcher/ViewModel/ResultViewModel.cs | 5 +++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs index e304a1b50..b48f047c5 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs @@ -101,6 +101,7 @@ namespace Flow.Launcher.Infrastructure.UserSettings public bool UseAnimation { get; set; } = true; public bool UseSound { get; set; } = true; public double SoundVolume { get; set; } = 50; + public bool ShowPluginBadges { get; set; } = false; public bool UseClock { get; set; } = true; public bool UseDate { get; set; } = false; diff --git a/Flow.Launcher/ResultListBox.xaml b/Flow.Launcher/ResultListBox.xaml index b57cb0d40..03bff03eb 100644 --- a/Flow.Launcher/ResultListBox.xaml +++ b/Flow.Launcher/ResultListBox.xaml @@ -146,7 +146,7 @@ VerticalAlignment="Bottom" RenderOptions.BitmapScalingMode="Fant" Source="{Binding Image, TargetNullValue={x:Null}}" - Visibility="{Binding ShowBadge, Converter={StaticResource BoolToVisibilityConverter}}" /> + Visibility="{Binding ShowBadge}" /> diff --git a/Flow.Launcher/ViewModel/ResultViewModel.cs b/Flow.Launcher/ViewModel/ResultViewModel.cs index 0975398dc..41e5dd12e 100644 --- a/Flow.Launcher/ViewModel/ResultViewModel.cs +++ b/Flow.Launcher/ViewModel/ResultViewModel.cs @@ -123,6 +123,11 @@ namespace Flow.Launcher.ViewModel } } + public Visibility ShowBadge + { + get => Settings.ShowPluginBadges ? Visibility.Visible : Visibility.Collapsed; + } + private bool GlyphAvailable => Glyph is not null; private bool ImgIconAvailable => !string.IsNullOrEmpty(Result.IcoPath) || Result.Icon is not null;