Remove custom ContextMenu and replace with MudMenu

This commit is contained in:
ahjephson
2025-10-20 13:30:40 +01:00
parent 300e81345c
commit 2ad7be1073
13 changed files with 31 additions and 347 deletions

View File

@@ -1,11 +1,11 @@
@page "/"
@layout ListLayout
<ContextMenu @ref="ContextMenu" Dense="true" RelativeWidth="DropdownWidth.Ignore" AdjustmentX="-242" AdjustmentY="0">
<MudMenu @ref="ContextMenu" Dense="true" RelativeWidth="DropdownWidth.Ignore" PositionAtCursor="true">
<MudMenuItem Icon="@Icons.Material.Outlined.Info" IconColor="Color.Inherit" OnClick="ShowTorrentContextMenu">View torrent details</MudMenuItem>
<MudDivider />
<TorrentActions RenderType="RenderType.MenuItems" Hashes="GetContextMenuTargetHashes()" PrimaryHash="@(ContextMenuItem?.Hash)" Torrents="MainData.Torrents" Preferences="Preferences" />
</ContextMenu>
</MudMenu>
<div style="overflow-x: auto; white-space: nowrap; width: 100%;">
<MudToolBar Gutters="false" Dense="true">

View File

@@ -68,7 +68,7 @@ namespace Lantean.QBTMud.Pages
protected Torrent? ContextMenuItem { get; set; }
protected ContextMenu? ContextMenu { get; set; }
protected MudMenu? ContextMenu { get; set; }
private object? _lastRenderedTorrents;
private QBitTorrentClient.Models.Preferences? _lastPreferences;
@@ -272,7 +272,7 @@ namespace Lantean.QBTMud.Pages
return;
}
await ContextMenu.ToggleMenuAsync(eventArgs);
await ContextMenu.OpenMenuAsync(eventArgs);
}
protected IEnumerable<ColumnDefinition<Torrent>> Columns => ColumnsDefinitions.Where(c => c.Id != "#" || Preferences?.QueueingEnabled == true);