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

@ -447,10 +447,7 @@ namespace SourceGit.ViewModels
checkout.Icon = App.CreateMenuIcon("Icons.Check");
checkout.Click += (o, e) =>
{
if (PopupHost.CanCreatePopup())
{
Checkout.ShowPopup(_repo, branch.Name);
}
_repo.CheckoutLocalBranch(branch.Name);
e.Handled = true;
};
submenu.Items.Add(checkout);
@ -526,16 +523,16 @@ namespace SourceGit.ViewModels
{
if (b.IsLocal && b.Upstream == branch.FullName)
{
if (b.IsCurrent)
return;
if (PopupHost.CanCreatePopup())
Checkout.ShowPopup(_repo, b.Name);
if (!b.IsCurrent)
_repo.CheckoutLocalBranch(b.Name);
return;
}
}
if (PopupHost.CanCreatePopup())
PopupHost.ShowPopup(new CreateBranch(_repo, branch));
e.Handled = true;
};
submenu.Items.Add(checkout);