enhance: add file histories context menu item for staged changes and deleted files (#432)

This commit is contained in:
leo 2024-09-02 09:41:00 +08:00
parent b0b55c989a
commit a2c6afc5cc
No known key found for this signature in database
2 changed files with 37 additions and 28 deletions

View file

@ -952,6 +952,16 @@ namespace SourceGit.ViewModels
e.Handled = true;
};
var history = new MenuItem();
history.Header = App.Text("FileHistory");
history.Icon = App.CreateMenuIcon("Icons.Histories");
history.Click += (_, e) =>
{
var window = new Views.FileHistories() { DataContext = new FileHistories(_repo, change.Path) };
window.Show();
e.Handled = true;
};
var copyPath = new MenuItem();
copyPath.Header = App.Text("CopyPath");
copyPath.Icon = App.CreateMenuIcon("Icons.Copy");
@ -977,6 +987,8 @@ namespace SourceGit.ViewModels
menu.Items.Add(stash);
menu.Items.Add(patch);
menu.Items.Add(new MenuItem() { Header = "-" });
menu.Items.Add(history);
menu.Items.Add(new MenuItem() { Header = "-" });
var lfsEnabled = new Commands.LFS(_repo.FullPath).IsEnabled();
if (lfsEnabled)