Explorer plugin native context menu: item type adjustments

This commit is contained in:
Yusyuriv 2024-06-08 10:27:56 +06:00
parent 0edd9eafab
commit deb4f20301
No known key found for this signature in database
GPG key ID: A91C52E6F73148E0
5 changed files with 13 additions and 6 deletions

View file

@ -247,10 +247,9 @@ namespace Flow.Launcher.Plugin
}
/// <summary>
/// Item Height Style. Null, Small(for OS Context), Author
/// Item Height Style. Null, Small (for displaying the native context menu in the Explorer plugin), Author
/// </summary>
public string ItemType { get; set; }
public ResultItemType ItemType { get; set; }
/// <summary>
/// Progress bar display. Providing an int value between 0-100 will trigger the progress bar to be displayed on the result

View file

@ -0,0 +1,8 @@
namespace Flow.Launcher.Plugin;
public enum ResultItemType
{
Default,
Small,
Author
}

View file

@ -224,7 +224,7 @@
<Style TargetType="{x:Type ListBoxItem}">
<Style.Triggers>
<DataTrigger Binding="{Binding Result.ItemType}" Value="Small">
<Setter Property="Height" Value="{Binding SmallSize}" />
<Setter Property="Height" Value="{Binding ItemTypeSmallSize}" />
</DataTrigger>
</Style.Triggers>
<Setter Property="Height" Value="{Binding Settings.ItemHeightSize}" />

View file

@ -180,7 +180,7 @@ namespace Flow.Launcher.ViewModel
/// </summary>
public bool UseBigThumbnail => Result.Preview.IsMedia;
public double SmallSize => Settings.ItemHeightSize * 0.6;
public double ItemTypeSmallSize => Settings.ItemHeightSize * 0.6;
public GlyphInfo Glyph { get; set; }

View file

@ -301,7 +301,7 @@ namespace Flow.Launcher.Plugin.Explorer
{
Title = menuItem.Label,
Icon = () => menuItem.Icon,
ItemType = "Small",
ItemType = ResultItemType.Small,
Action = _ =>
{
ShellContextMenuDisplayHelper.ExecuteContextMenuItem(record.FullPath, menuItem.CommandId);