Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Flow.Launcher.Plugin/Flow.Launcher.Plugin.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0-windows</TargetFramework>
Expand Down Expand Up @@ -42,6 +42,7 @@
<WarningLevel>4</WarningLevel>
<PlatformTarget>AnyCPU</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
<DocumentationFile>..\Output\Debug\Flow.Launcher.Plugin.xml</DocumentationFile>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
Expand Down
5 changes: 5 additions & 0 deletions Flow.Launcher.Plugin/GlyphInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,10 @@

namespace Flow.Launcher.Plugin
{
/// <summary>
/// Text with FontFamily specified
/// </summary>
/// <param name="FontFamily">Font Family of this Glyph</param>
/// <param name="Glyph">Text/Unicode of the Glyph</param>
public record GlyphInfo(string FontFamily, string Glyph);
}
34 changes: 25 additions & 9 deletions Flow.Launcher.Plugin/Result.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ public class Result
{

private string _pluginDirectory;

private string _icoPath;

/// <summary>
/// Provides the title of the result. This is always required.
/// The title of the result. This is always required.
/// </summary>
public string Title { get; set; }

Expand All @@ -36,6 +36,11 @@ public class Result
/// </summary>
public string AutoCompleteText { get; set; }

/// <summary>
/// Image Displayed on the result
/// <value>Relative Path to the Image File</value>
/// <remarks>GlyphInfo is prioritized if not null</remarks>
/// </summary>
public string IcoPath
{
get { return _icoPath; }
Expand All @@ -60,16 +65,23 @@ public string IcoPath
public IconDelegate Icon;

/// <summary>
/// Information for Glyph Icon
/// Information for Glyph Icon (Prioritized than IcoPath/Icon if user enable Glyph Icons)
/// </summary>
public GlyphInfo Glyph { get; init; }
public GlyphInfo Glyph { get; init; }


/// <summary>
/// return true to hide flowlauncher after select result
/// Delegate. An action to take in the form of a function call when the result has been selected
/// <returns>
/// true to hide flowlauncher after select result
/// </returns>
/// </summary>
public Func<ActionContext, bool> Action { get; set; }

/// <summary>
/// Priority of the current result
/// <value>default: 0</value>
/// </summary>
public int Score { get; set; }

/// <summary>
Expand All @@ -83,7 +95,7 @@ public string IcoPath
public IList<int> SubTitleHighlightData { get; set; }

/// <summary>
/// Only results that originQuery match with current query will be displayed in the panel
/// Query information associated with the result
/// </summary>
internal Query OriginQuery { get; set; }

Expand All @@ -103,6 +115,7 @@ public string PluginDirectory
}
}

/// <inheritdoc />
public override bool Equals(object obj)
{
var r = obj as Result;
Expand All @@ -116,22 +129,25 @@ public override bool Equals(object obj)
return equality;
}

/// <inheritdoc />
public override int GetHashCode()
{
var hashcode = (Title?.GetHashCode() ?? 0) ^
(SubTitle?.GetHashCode() ?? 0);
return hashcode;
}

/// <inheritdoc />
public override string ToString()
{
return Title + SubTitle;
}

public Result() { }

/// <summary>
/// Additional data associate with this result
/// Additional data associated with this result
/// <example>
/// As external information for ContextMenu
/// </example>
/// </summary>
public object ContextData { get; set; }

Expand Down