From 90e9965763571769611636f79aafc96d7f293a6b Mon Sep 17 00:00:00 2001 From: Stanley Goldman Date: Mon, 27 Nov 2017 14:26:51 -0500 Subject: [PATCH 1/4] Removing references to Favorites --- .../Editor/GitHub.Unity/UI/BranchesView.cs | 35 ------------------- 1 file changed, 35 deletions(-) diff --git a/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/BranchesView.cs b/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/BranchesView.cs index fd19672c3..1ac2d283c 100644 --- a/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/BranchesView.cs +++ b/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/BranchesView.cs @@ -375,16 +375,6 @@ private void OnTreeGUI(Rect rect) private int CompareBranches(GitBranch a, GitBranch b) { - //if (IsFavorite(a.Name)) - //{ - // return -1; - //} - - //if (IsFavorite(b.Name)) - //{ - // return 1; - //} - if (a.Name.Equals("master")) { return -1; @@ -398,31 +388,6 @@ private int CompareBranches(GitBranch a, GitBranch b) return a.Name.CompareTo(b.Name); } - //private bool IsFavorite(string branchName) - //{ - // return !String.IsNullOrEmpty(branchName) && favoritesList.Contains(branchName); - //} - - //private void SetFavorite(TreeNode branch, bool favorite) - //{ - // if (string.IsNullOrEmpty(branch.Name)) - // { - // return; - // } - - // if (!favorite) - // { - // favorites.Remove(branch); - // Manager.LocalSettings.Set(FavoritesSetting, favorites.Select(x => x.Name).ToList()); - // } - // else - // { - // favorites.Remove(branch); - // favorites.Add(branch); - // Manager.LocalSettings.Set(FavoritesSetting, favorites.Select(x => x.Name).ToList()); - // } - //} - public override bool IsBusy { get { return false; } From 036603712b81f3acf15aca3e91c096bb927d6c6c Mon Sep 17 00:00:00 2001 From: Stanley Goldman Date: Mon, 27 Nov 2017 16:57:43 -0500 Subject: [PATCH 2/4] Adding braces --- src/UnityExtension/Assets/Editor/GitHub.Unity/UI/TreeControl.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/TreeControl.cs b/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/TreeControl.cs index aed254212..284e9a01a 100644 --- a/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/TreeControl.cs +++ b/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/TreeControl.cs @@ -439,7 +439,9 @@ public bool Render(Rect rect, float indentation, bool isSelected, GUIStyle folde { nodeStyle.Draw(fillRect, "", false, false, false, isSelected); if (IsFolder) + { style.Draw(nodeRect, content, false, false, !IsCollapsed, isSelected); + } else { style.Draw(nodeRect, content, false, false, false, isSelected); From 73d841ed910a8938f28bcf8a40005ce2eb6e197c Mon Sep 17 00:00:00 2001 From: Stanley Goldman Date: Mon, 27 Nov 2017 19:08:38 -0500 Subject: [PATCH 3/4] Cleanup GitBranch --- src/GitHub.Api/Git/GitBranch.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/GitHub.Api/Git/GitBranch.cs b/src/GitHub.Api/Git/GitBranch.cs index 41cd21106..3e1c747d8 100644 --- a/src/GitHub.Api/Git/GitBranch.cs +++ b/src/GitHub.Api/Git/GitBranch.cs @@ -17,10 +17,6 @@ public struct GitBranch : ITreeData public string tracking; public bool isActive; - public string Name { get { return name; } } - public string Tracking { get { return tracking; } } - public bool IsActive { get { return isActive; } } - public GitBranch(string name, string tracking, bool active) { Guard.ArgumentNotNullOrWhiteSpace(name, "name"); @@ -30,6 +26,10 @@ public GitBranch(string name, string tracking, bool active) this.isActive = active; } + public string Name => name; + public string Tracking => tracking; + public bool IsActive => isActive; + public override string ToString() { return $"{Name} Tracking? {Tracking} Active? {IsActive}"; From cfd433cbbf2d12516788311d1d83bc7746725a4f Mon Sep 17 00:00:00 2001 From: Stanley Goldman Date: Tue, 28 Nov 2017 17:00:21 -0500 Subject: [PATCH 4/4] Undoing some code cleanup --- .../Assets/Editor/GitHub.Unity/UI/BranchesView.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/BranchesView.cs b/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/BranchesView.cs index 1ac2d283c..db718a8fa 100644 --- a/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/BranchesView.cs +++ b/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/BranchesView.cs @@ -358,13 +358,9 @@ private void OnTreeGUI(Rect rect) }); if (treeHadFocus && treeRemotes.SelectedNode == null) - { treeLocals.Focus(); - } else if (!treeHadFocus && treeRemotes.SelectedNode != null) - { treeLocals.Blur(); - } if (treeRemotes.RequiresRepaint) Redraw();