Ensure combability of glyph setter

This commit is contained in:
Jack251970 2026-01-23 16:10:01 +08:00
parent 0f0ee9ffde
commit 935d41dc26
2 changed files with 18 additions and 3 deletions

View file

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
@ -164,10 +164,25 @@ namespace Flow.Launcher.Plugin
[JsonIgnore]
public IconDelegate BadgeIcon = null;
private GlyphInfo _glyph;
/// <summary>
/// Information for Glyph Icon (Prioritized than IcoPath/Icon if user enable Glyph Icons)
/// </summary>
public GlyphInfo Glyph { get; set; }
public GlyphInfo Glyph
{
get => _glyph;
init => _glyph = value;
}
/// <summary>
/// Set the Glyph Icon
/// </summary>
/// <param name="glyph"></param>
public void SetGlyph(GlyphInfo glyph)
{
_glyph = glyph;
}
/// <summary>
/// An action to take in the form of a function call when the result has been selected.

View file

@ -78,7 +78,7 @@ namespace Flow.Launcher.Storage
if (existingHistoryItem.Glyph?.Glyph != result.Glyph?.Glyph
|| existingHistoryItem.Glyph?.FontFamily != result.Glyph?.FontFamily)
existingHistoryItem.Glyph = result.Glyph;
existingHistoryItem.SetGlyph(result.Glyph);
}
else
{