mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
wip show result icon
This commit is contained in:
parent
0f269455b1
commit
7958b17968
1 changed files with 28 additions and 0 deletions
|
|
@ -90,6 +90,34 @@ namespace Flow.Launcher.Plugin
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the plugin directory relative IcoPath or URL. This path is useful for storage where the it needs
|
||||
/// to be resistant to changes in plugin location from update or portable mode change.
|
||||
/// </summary>
|
||||
/// <value>Must be a local file path.</value>
|
||||
/// <remarks>This will be empty string if IcoPath is a URL, so must check for empty string during usage</remarks>
|
||||
public string IcoPathRelative
|
||||
{
|
||||
get => _icoPath;
|
||||
set
|
||||
{
|
||||
// As a standard this property will handle prepping and converting to absolute local path for icon image processing
|
||||
if (!string.IsNullOrEmpty(value)
|
||||
&& !string.IsNullOrEmpty(PluginDirectory)
|
||||
&& !Path.IsPathRooted(value)
|
||||
&& !value.StartsWith("http://", StringComparison.OrdinalIgnoreCase)
|
||||
&& !value.StartsWith("https://", StringComparison.OrdinalIgnoreCase)
|
||||
&& !value.StartsWith("data:image", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
_icoPath = Path.Combine(PluginDirectory, value);
|
||||
}
|
||||
else
|
||||
{
|
||||
_icoPath = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The image to be displayed for the badge of the result.
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Reference in a new issue