mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-06-16 16:05:00 +00:00
ux: move some buttons to page switcher (#1370)
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
2aac6779a5
commit
40bf69bff3
16 changed files with 48 additions and 44 deletions
|
@ -1766,6 +1766,18 @@ namespace SourceGit.ViewModels
|
|||
return menu;
|
||||
}
|
||||
|
||||
public void DiscardAllChanges()
|
||||
{
|
||||
if (CanCreatePopup())
|
||||
ShowPopup(new Discard(this));
|
||||
}
|
||||
|
||||
public void ClearStashes()
|
||||
{
|
||||
if (CanCreatePopup())
|
||||
ShowPopup(new ClearStashes(this));
|
||||
}
|
||||
|
||||
public ContextMenu CreateContextMenuForLocalBranch(Models.Branch branch)
|
||||
{
|
||||
var menu = new ContextMenu();
|
||||
|
@ -1785,19 +1797,6 @@ namespace SourceGit.ViewModels
|
|||
{
|
||||
if (!IsBare)
|
||||
{
|
||||
var discard = new MenuItem();
|
||||
discard.Header = App.Text("BranchCM.DiscardAll");
|
||||
discard.Icon = App.CreateMenuIcon("Icons.Undo");
|
||||
discard.Click += (_, e) =>
|
||||
{
|
||||
if (CanCreatePopup())
|
||||
ShowPopup(new Discard(this));
|
||||
e.Handled = true;
|
||||
};
|
||||
|
||||
menu.Items.Add(discard);
|
||||
menu.Items.Add(new MenuItem() { Header = "-" });
|
||||
|
||||
if (!string.IsNullOrEmpty(branch.Upstream))
|
||||
{
|
||||
var upstream = branch.Upstream.Substring(13);
|
||||
|
@ -1828,6 +1827,7 @@ namespace SourceGit.ViewModels
|
|||
};
|
||||
|
||||
menu.Items.Add(fastForward);
|
||||
menu.Items.Add(new MenuItem() { Header = "-" });
|
||||
menu.Items.Add(pull);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue