mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-06-16 07:55:00 +00:00
feature: supports re-order custom actions (#1346)
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
ee2e7d0127
commit
98041c803e
5 changed files with 98 additions and 18 deletions
|
@ -415,6 +415,30 @@ namespace SourceGit.Views
|
|||
e.Handled = true;
|
||||
}
|
||||
|
||||
private void OnMoveSelectedCustomActionUp(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (SelectedCustomAction == null)
|
||||
return;
|
||||
|
||||
var idx = ViewModels.Preferences.Instance.CustomActions.IndexOf(SelectedCustomAction);
|
||||
if (idx > 0)
|
||||
ViewModels.Preferences.Instance.CustomActions.Move(idx - 1, idx);
|
||||
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
private void OnMoveSelectedCustomActionDown(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (SelectedCustomAction == null)
|
||||
return;
|
||||
|
||||
var idx = ViewModels.Preferences.Instance.CustomActions.IndexOf(SelectedCustomAction);
|
||||
if (idx < ViewModels.Preferences.Instance.CustomActions.Count - 1)
|
||||
ViewModels.Preferences.Instance.CustomActions.Move(idx + 1, idx);
|
||||
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
private void UpdateGitVersion()
|
||||
{
|
||||
GitVersion = Native.OS.GitVersionString;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue