Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit daa4ef6

Browse files
Making constants out of context menu items labels
1 parent 1ac71e8 commit daa4ef6

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/UnityExtension/Assets/Editor/GitHub.Unity/UI/BranchesView.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ class BranchesView : Subview
3232
private const string DeleteBranchTitle = "Delete Branch?";
3333
private const string DeleteBranchButton = "Delete";
3434
private const string CancelButtonLabel = "Cancel";
35+
private const string DeleteBranchContextMenuLabel = "Delete";
36+
private const string SwitchBranchContextMenuLabel = "Switch";
37+
private const string CheckoutBranchContextMenuLabel = "Checkout";
3538

3639
[NonSerialized] private int listID = -1;
3740
[NonSerialized] private BranchesMode targetMode;
@@ -337,8 +340,8 @@ private GenericMenu CreateContextMenuForLocalBranchNode(TreeNode node)
337340
{
338341
var genericMenu = new GenericMenu();
339342

340-
var deleteGuiContent = new GUIContent("Delete");
341-
var switchGuiContent = new GUIContent("Switch");
343+
var deleteGuiContent = new GUIContent(DeleteBranchContextMenuLabel);
344+
var switchGuiContent = new GUIContent(SwitchBranchContextMenuLabel);
342345

343346
if (node.IsActive)
344347
{
@@ -363,7 +366,7 @@ private GenericMenu CreateContextMenuForRemoteBranchNode(TreeNode node)
363366
{
364367
var genericMenu = new GenericMenu();
365368

366-
var checkoutGuiContent = new GUIContent("Checkout");
369+
var checkoutGuiContent = new GUIContent(CheckoutBranchContextMenuLabel);
367370

368371
genericMenu.AddItem(checkoutGuiContent, false, () => {
369372
CheckoutRemoteBranch(node.Name);

0 commit comments

Comments
 (0)