Skip to content

Commit ee43152

Browse files
committed
save IconPath to settings for customisation
1 parent 1e66205 commit ee43152

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

Plugins/Flow.Launcher.Plugin.WebSearch/SearchSource.cs

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System.IO;
1+
using System.IO;
22
using System.Windows.Media;
33
using JetBrains.Annotations;
44
using Newtonsoft.Json;
@@ -16,11 +16,26 @@ public class SearchSource : BaseModel
1616
public string Icon { get; set; } = DefaultIcon;
1717

1818
/// <summary>
19-
/// All icon should be put under Images directory
19+
/// Default icons are placed in Images directory in the app location.
20+
/// Custom icons are placed in the user data directory
2021
/// </summary>
2122
[NotNull]
22-
[JsonIgnore]
23-
internal string IconPath => Path.Combine(Main.ImagesDirectory, Icon);
23+
public string IconPath
24+
{
25+
get
26+
{
27+
if (string.IsNullOrEmpty(iconPath))
28+
return Path.Combine(Main.ImagesDirectory, Icon);
29+
30+
return iconPath;
31+
}
32+
set
33+
{
34+
iconPath = value;
35+
}
36+
}
37+
38+
private string iconPath;
2439

2540
[JsonIgnore]
2641
public ImageSource Image => ImageLoader.Load(IconPath);

0 commit comments

Comments
 (0)