Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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);
}
32 changes: 23 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,9 @@ public class Result
/// </summary>
public string AutoCompleteText { get; set; }

/// <summary>
/// Image Displayed on the result
/// </summary>
public string IcoPath
{
get { return _icoPath; }
Expand All @@ -60,16 +63,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 activated when result is 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,9 +93,9 @@ 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; }
public Query OriginQuery { get; set; }

/// <summary>
/// Plugin directory
Expand All @@ -103,6 +113,7 @@ public string PluginDirectory
}
}

/// <inheritdoc />
public override bool Equals(object obj)
{
var r = obj as Result;
Expand All @@ -116,22 +127,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
/// <example>
/// As external information for ContextMenu
/// </example>
/// </summary>
public object ContextData { get; set; }

Expand Down