code_review: PR #98

* remove the `Leave` option (it may lead to an undefined behaviour), so user can only choose `Stash & reapply` or `Discard`.
* re-design the UI
* remove unused resources
This commit is contained in:
leo 2024-04-29 17:22:22 +08:00
parent 927a1cab24
commit 776605cb68
7 changed files with 75 additions and 89 deletions

View file

@ -690,6 +690,17 @@ namespace SourceGit.ViewModels
PopupHost.ShowPopup(new CreateBranch(this, current));
}
public void CheckoutLocalBranch(string branch)
{
if (!PopupHost.CanCreatePopup())
return;
if (WorkingCopyChangesCount > 0)
PopupHost.ShowPopup(new Checkout(this, branch));
else
PopupHost.ShowAndStartPopup(new Checkout(this, branch));
}
public void CreateNewTag()
{
var current = Branches.Find(x => x.IsCurrent);
@ -842,11 +853,7 @@ namespace SourceGit.ViewModels
checkout.Icon = App.CreateMenuIcon("Icons.Check");
checkout.Click += (o, e) =>
{
if (PopupHost.CanCreatePopup())
{
Checkout.ShowPopup(this, branch.Name);
}
CheckoutLocalBranch(branch.Name);
e.Handled = true;
};
menu.Items.Add(checkout);