mirror of
https://fastgit.cc/github.com/sourcegit-scm/sourcegit
synced 2026-04-23 18:30:34 +08:00
ux: add a group header for workspace context menu
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
@@ -4,6 +4,7 @@ using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Input;
|
||||
using Avalonia.Interactivity;
|
||||
using Avalonia.Media;
|
||||
using Avalonia.Platform;
|
||||
using Avalonia.VisualTree;
|
||||
|
||||
@@ -320,6 +321,18 @@ namespace SourceGit.Views
|
||||
menu.Placement = PlacementMode.BottomEdgeAlignedLeft;
|
||||
menu.VerticalOffset = -6;
|
||||
|
||||
var groupHeader = new TextBlock()
|
||||
{
|
||||
Text = App.Text("Launcher.Workspaces"),
|
||||
FontWeight = FontWeight.Bold,
|
||||
};
|
||||
|
||||
var workspaces = new MenuItem();
|
||||
workspaces.Header = groupHeader;
|
||||
workspaces.Tag = OperatingSystem.IsMacOS() ? "⌘+⇧+P" : "Ctrl+Shift+P";
|
||||
workspaces.IsEnabled = false;
|
||||
menu.Items.Add(workspaces);
|
||||
|
||||
for (var i = 0; i < pref.Workspaces.Count; i++)
|
||||
{
|
||||
var workspace = pref.Workspaces[i];
|
||||
|
||||
Reference in New Issue
Block a user