feature: supports re-order custom actions (#1346)

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo 2025-06-03 20:24:30 +08:00
parent ee2e7d0127
commit 98041c803e
No known key found for this signature in database
5 changed files with 98 additions and 18 deletions

View file

@ -453,5 +453,19 @@ namespace SourceGit.Models
if (act != null)
CustomActions.Remove(act);
}
public void MoveCustomActionUp(CustomAction act)
{
var idx = CustomActions.IndexOf(act);
if (idx > 0)
CustomActions.Move(idx - 1, idx);
}
public void MoveCustomActionDown(CustomAction act)
{
var idx = CustomActions.IndexOf(act);
if (idx < CustomActions.Count - 1)
CustomActions.Move(idx + 1, idx);
}
}
}