mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
save IconPath to settings for customisation
This commit is contained in:
parent
1e662057be
commit
ee43152de1
1 changed files with 19 additions and 4 deletions
|
|
@ -1,4 +1,4 @@
|
|||
using System.IO;
|
||||
using System.IO;
|
||||
using System.Windows.Media;
|
||||
using JetBrains.Annotations;
|
||||
using Newtonsoft.Json;
|
||||
|
|
@ -16,11 +16,26 @@ namespace Flow.Launcher.Plugin.WebSearch
|
|||
public string Icon { get; set; } = DefaultIcon;
|
||||
|
||||
/// <summary>
|
||||
/// All icon should be put under Images directory
|
||||
/// Default icons are placed in Images directory in the app location.
|
||||
/// Custom icons are placed in the user data directory
|
||||
/// </summary>
|
||||
[NotNull]
|
||||
[JsonIgnore]
|
||||
internal string IconPath => Path.Combine(Main.ImagesDirectory, Icon);
|
||||
public string IconPath
|
||||
{
|
||||
get
|
||||
{
|
||||
if (string.IsNullOrEmpty(iconPath))
|
||||
return Path.Combine(Main.ImagesDirectory, Icon);
|
||||
|
||||
return iconPath;
|
||||
}
|
||||
set
|
||||
{
|
||||
iconPath = value;
|
||||
}
|
||||
}
|
||||
|
||||
private string iconPath;
|
||||
|
||||
[JsonIgnore]
|
||||
public ImageSource Image => ImageLoader.Load(IconPath);
|
||||
|
|
|
|||
Loading…
Reference in a new issue