Add ShowBadge property

This commit is contained in:
Jack251970 2025-04-12 20:10:24 +08:00
parent 5d39501707
commit d8f4eac0d2
2 changed files with 11 additions and 1 deletions

View file

@ -251,6 +251,12 @@ namespace Flow.Launcher.Plugin
/// </summary>
public string RecordKey { get; set; } = null;
/// <summary>
/// Determines if the badge icon should be shown.
/// If users want to show the result badges and here you set this to true, the results will show the badge icon.
/// </summary>
public bool ShowBadge { get; set; } = false;
/// <summary>
/// Run this result, asynchronously
/// </summary>

View file

@ -128,9 +128,13 @@ namespace Flow.Launcher.ViewModel
{
get
{
if (!Settings.ShowBadges || !BadgeIconAvailable)
// If results do not allow badges, or user has disabled badges in settings,
// or badge icon is not available, then do not show badge
if (!Result.ShowBadge || !Settings.ShowBadges || !BadgeIconAvailable)
return Visibility.Collapsed;
// If user has set to show badges only for global results, and this is not a global result,
// then do not show badge
if (Settings.ShowBadgesGlobalOnly && !IsGlobalQuery)
return Visibility.Collapsed;