Skip to content

Commit 486659e

Browse files
committed
ux: add a group header for workspace context menu
Signed-off-by: leo <[email protected]>
1 parent 86464c2 commit 486659e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/Views/Launcher.axaml.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using Avalonia.Controls;
55
using Avalonia.Input;
66
using Avalonia.Interactivity;
7+
using Avalonia.Media;
78
using Avalonia.Platform;
89
using Avalonia.VisualTree;
910

@@ -320,6 +321,18 @@ private void OnOpenWorkspaceMenu(object sender, RoutedEventArgs e)
320321
menu.Placement = PlacementMode.BottomEdgeAlignedLeft;
321322
menu.VerticalOffset = -6;
322323

324+
var groupHeader = new TextBlock()
325+
{
326+
Text = App.Text("Launcher.Workspaces"),
327+
FontWeight = FontWeight.Bold,
328+
};
329+
330+
var workspaces = new MenuItem();
331+
workspaces.Header = groupHeader;
332+
workspaces.Tag = OperatingSystem.IsMacOS() ? "⌘+⇧+P" : "Ctrl+Shift+P";
333+
workspaces.IsEnabled = false;
334+
menu.Items.Add(workspaces);
335+
323336
for (var i = 0; i < pref.Workspaces.Count; i++)
324337
{
325338
var workspace = pref.Workspaces[i];

0 commit comments

Comments
 (0)