Skip to content

Commit deb4f20

Browse files
committed
Explorer plugin native context menu: item type adjustments
1 parent 0edd9ea commit deb4f20

File tree

5 files changed

+13
-6
lines changed

5 files changed

+13
-6
lines changed

Flow.Launcher.Plugin/Result.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,10 +247,9 @@ public ValueTask<bool> ExecuteAsync(ActionContext context)
247247
}
248248

249249
/// <summary>
250-
/// Item Height Style. Null, Small(for OS Context), Author
250+
/// Item Height Style. Null, Small (for displaying the native context menu in the Explorer plugin), Author
251251
/// </summary>
252-
public string ItemType { get; set; }
253-
252+
public ResultItemType ItemType { get; set; }
254253

255254
/// <summary>
256255
/// Progress bar display. Providing an int value between 0-100 will trigger the progress bar to be displayed on the result
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
namespace Flow.Launcher.Plugin;
2+
3+
public enum ResultItemType
4+
{
5+
Default,
6+
Small,
7+
Author
8+
}

Flow.Launcher/ResultListBox.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@
224224
<Style TargetType="{x:Type ListBoxItem}">
225225
<Style.Triggers>
226226
<DataTrigger Binding="{Binding Result.ItemType}" Value="Small">
227-
<Setter Property="Height" Value="{Binding SmallSize}" />
227+
<Setter Property="Height" Value="{Binding ItemTypeSmallSize}" />
228228
</DataTrigger>
229229
</Style.Triggers>
230230
<Setter Property="Height" Value="{Binding Settings.ItemHeightSize}" />

Flow.Launcher/ViewModel/ResultViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ public ImageSource PreviewImage
180180
/// </summary>
181181
public bool UseBigThumbnail => Result.Preview.IsMedia;
182182

183-
public double SmallSize => Settings.ItemHeightSize * 0.6;
183+
public double ItemTypeSmallSize => Settings.ItemHeightSize * 0.6;
184184

185185
public GlyphInfo Glyph { get; set; }
186186

Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ public List<Result> LoadContextMenus(Result selectedResult)
301301
{
302302
Title = menuItem.Label,
303303
Icon = () => menuItem.Icon,
304-
ItemType = "Small",
304+
ItemType = ResultItemType.Small,
305305
Action = _ =>
306306
{
307307
ShellContextMenuDisplayHelper.ExecuteContextMenuItem(record.FullPath, menuItem.CommandId);

0 commit comments

Comments
 (0)