diff --git a/src/Resources/Styles.axaml b/src/Resources/Styles.axaml
index a20bec81..e328cf26 100644
--- a/src/Resources/Styles.axaml
+++ b/src/Resources/Styles.axaml
@@ -843,6 +843,15 @@
+
+
+
+
+
+
+
+
+
diff --git a/src/ViewModels/CustomActionContextMenuLabel.cs b/src/ViewModels/CustomActionContextMenuLabel.cs
new file mode 100644
index 00000000..82804f09
--- /dev/null
+++ b/src/ViewModels/CustomActionContextMenuLabel.cs
@@ -0,0 +1,8 @@
+namespace SourceGit.ViewModels
+{
+ public class CustomActionContextMenuLabel(string name, bool isGlobal)
+ {
+ public string Name { get; set; } = name;
+ public bool IsGlobal { get; set; } = isGlobal;
+ }
+}
diff --git a/src/ViewModels/Histories.cs b/src/ViewModels/Histories.cs
index a2656936..8d159419 100644
--- a/src/ViewModels/Histories.cs
+++ b/src/ViewModels/Histories.cs
@@ -800,10 +800,10 @@ namespace SourceGit.ViewModels
foreach (var action in actions)
{
- var dup = action;
+ var (dup, label) = action;
var item = new MenuItem();
item.Icon = App.CreateMenuIcon("Icons.Action");
- item.Header = dup.Name;
+ item.Header = label;
item.Click += (_, e) =>
{
_repo.ExecCustomAction(dup, commit);
diff --git a/src/ViewModels/Repository.cs b/src/ViewModels/Repository.cs
index 4bf5f6f5..8dbf7012 100644
--- a/src/ViewModels/Repository.cs
+++ b/src/ViewModels/Repository.cs
@@ -1077,20 +1077,20 @@ namespace SourceGit.ViewModels
_workingCopy?.AbortMerge();
}
- public List GetCustomActions(Models.CustomActionScope scope)
+ public List<(Models.CustomAction, CustomActionContextMenuLabel)> GetCustomActions(Models.CustomActionScope scope)
{
- var actions = new List();
+ var actions = new List<(Models.CustomAction, CustomActionContextMenuLabel)>();
foreach (var act in Preferences.Instance.CustomActions)
{
if (act.Scope == scope)
- actions.Add(act);
+ actions.Add((act, new CustomActionContextMenuLabel(act.Name, true)));
}
foreach (var act in _settings.CustomActions)
{
if (act.Scope == scope)
- actions.Add(act);
+ actions.Add((act, new CustomActionContextMenuLabel(act.Name, false)));
}
return actions;
@@ -1748,10 +1748,10 @@ namespace SourceGit.ViewModels
{
foreach (var action in actions)
{
- var dup = action;
+ var (dup, label) = action;
var item = new MenuItem();
item.Icon = App.CreateMenuIcon("Icons.Action");
- item.Header = dup.Name;
+ item.Header = label;
item.Click += (_, e) =>
{
ExecCustomAction(dup, null);
@@ -2437,10 +2437,10 @@ namespace SourceGit.ViewModels
foreach (var action in actions)
{
- var dup = action;
+ var (dup, label) = action;
var item = new MenuItem();
item.Icon = App.CreateMenuIcon("Icons.Action");
- item.Header = dup.Name;
+ item.Header = label;
item.Click += (_, e) =>
{
ExecCustomAction(dup, tag);
@@ -2872,10 +2872,10 @@ namespace SourceGit.ViewModels
foreach (var action in actions)
{
- var dup = action;
+ var (dup, label) = action;
var item = new MenuItem();
item.Icon = App.CreateMenuIcon("Icons.Action");
- item.Header = dup.Name;
+ item.Header = label;
item.Click += (_, e) =>
{
ExecCustomAction(dup, branch);