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

Commit 5d80511

Browse files
Merge branch 'fixes/branches-view-cleanup' into fixes/branches-view-expands-on-reload
2 parents 7c20494 + cfd433c commit 5d80511

File tree

3 files changed

+6
-43
lines changed

3 files changed

+6
-43
lines changed

src/GitHub.Api/Git/GitBranch.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ public struct GitBranch : ITreeData
1717
public string tracking;
1818
public bool isActive;
1919

20-
public string Name { get { return name; } }
21-
public string Tracking { get { return tracking; } }
22-
public bool IsActive { get { return isActive; } }
23-
2420
public GitBranch(string name, string tracking, bool active)
2521
{
2622
Guard.ArgumentNotNullOrWhiteSpace(name, "name");
@@ -30,6 +26,10 @@ public GitBranch(string name, string tracking, bool active)
3026
this.isActive = active;
3127
}
3228

29+
public string Name => name;
30+
public string Tracking => tracking;
31+
public bool IsActive => isActive;
32+
3333
public override string ToString()
3434
{
3535
return $"{Name} Tracking? {Tracking} Active? {IsActive}";

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

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -358,13 +358,9 @@ private void OnTreeGUI(Rect rect)
358358
});
359359

360360
if (treeHadFocus && treeRemotes.SelectedNode == null)
361-
{
362361
treeLocals.Focus();
363-
}
364362
else if (!treeHadFocus && treeRemotes.SelectedNode != null)
365-
{
366363
treeLocals.Blur();
367-
}
368364

369365
if (treeRemotes.RequiresRepaint)
370366
Redraw();
@@ -375,16 +371,6 @@ private void OnTreeGUI(Rect rect)
375371

376372
private int CompareBranches(GitBranch a, GitBranch b)
377373
{
378-
//if (IsFavorite(a.Name))
379-
//{
380-
// return -1;
381-
//}
382-
383-
//if (IsFavorite(b.Name))
384-
//{
385-
// return 1;
386-
//}
387-
388374
if (a.Name.Equals("master"))
389375
{
390376
return -1;
@@ -398,31 +384,6 @@ private int CompareBranches(GitBranch a, GitBranch b)
398384
return a.Name.CompareTo(b.Name);
399385
}
400386

401-
//private bool IsFavorite(string branchName)
402-
//{
403-
// return !String.IsNullOrEmpty(branchName) && favoritesList.Contains(branchName);
404-
//}
405-
406-
//private void SetFavorite(TreeNode branch, bool favorite)
407-
//{
408-
// if (string.IsNullOrEmpty(branch.Name))
409-
// {
410-
// return;
411-
// }
412-
413-
// if (!favorite)
414-
// {
415-
// favorites.Remove(branch);
416-
// Manager.LocalSettings.Set(FavoritesSetting, favorites.Select(x => x.Name).ToList());
417-
// }
418-
// else
419-
// {
420-
// favorites.Remove(branch);
421-
// favorites.Add(branch);
422-
// Manager.LocalSettings.Set(FavoritesSetting, favorites.Select(x => x.Name).ToList());
423-
// }
424-
//}
425-
426387
public override bool IsBusy
427388
{
428389
get { return false; }

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,9 @@ public bool Render(Rect rect, float indentation, bool isSelected, GUIStyle folde
439439
{
440440
nodeStyle.Draw(fillRect, GUIContent.none, false, false, false, isSelected);
441441
if (IsFolder)
442+
{
442443
style.Draw(nodeRect, content, false, false, !IsCollapsed, isSelected);
444+
}
443445
else
444446
{
445447
style.Draw(nodeRect, content, false, false, false, isSelected);

0 commit comments

Comments
 (0)