Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
134 commits
Select commit Hold shift + click to select a range
10f5e15
Update data before OnGUI whenever the repo event happens, and OnEnabl…
shana Oct 17, 2017
b7bb749
Removing unused method
StanleyGoldman Oct 17, 2017
55883f2
Redraw whenever data has changed
shana Oct 17, 2017
4104c4f
Merge branch 'master' into shana/refreshing-the-branches-view
shana Oct 17, 2017
4654cae
Well duh
shana Oct 17, 2017
205da5b
Custom treeview control and cache manager
shana Jul 3, 2017
7cf80c0
treeLocals is never null
StanleyGoldman Oct 20, 2017
99c4ed2
Adding branchesHasChanged flag to signal rebuild of tree
StanleyGoldman Oct 20, 2017
13fcec0
Adding missing reset of branchesHasChanged
StanleyGoldman Oct 20, 2017
466507f
Removing stray newline
StanleyGoldman Oct 20, 2017
f37f2b0
Merge branch 'features/cache-manager' into stanley/branches-view-fixes
StanleyGoldman Oct 20, 2017
560fc55
Merge branch 'features/cache-manager' into stanley/branches-view-fixes
StanleyGoldman Oct 20, 2017
4cabc10
Removing initialize of BranchCache from BranchView
StanleyGoldman Oct 20, 2017
a58a212
Merge branch 'master' into stanley/branches-view-fixes
StanleyGoldman Nov 1, 2017
8921bd8
Fixes after merge
StanleyGoldman Nov 1, 2017
3f2d2f9
Merge branch 'features/using-cache-manager' into stanley/branches-vie…
StanleyGoldman Nov 1, 2017
733df51
More fixes after the merge
StanleyGoldman Nov 1, 2017
1064594
Merge branch 'features/using-cache-manager' into stanley/branches-vie…
StanleyGoldman Nov 2, 2017
72f6432
Removing some unused references to favorites
StanleyGoldman Nov 2, 2017
daed451
Removing unused function parameters
StanleyGoldman Nov 2, 2017
29116a6
Merge branch 'features/using-cache-manager' into stanley/branches-vie…
StanleyGoldman Nov 2, 2017
8dfe36a
Merge branch 'features/using-cache-manager' into stanley/branches-vie…
StanleyGoldman Nov 2, 2017
0ab5306
Merge branch 'features/using-cache-manager' into stanley/branches-vie…
StanleyGoldman Nov 2, 2017
4d44b46
Code cleanup
StanleyGoldman Nov 3, 2017
4a3db62
Preventing render if there are no nodes
StanleyGoldman Nov 3, 2017
1740385
Merge branch 'features/using-cache-manager' into stanley/branches-vie…
StanleyGoldman Nov 6, 2017
0b96c44
Fixes needed after merge
StanleyGoldman Nov 6, 2017
532621b
Merge branch 'master' into stanley/branches-view-fixes
StanleyGoldman Nov 9, 2017
4cfcb06
Merge pull request #378 from github-for-unity/stanley/branches-view-f…
shana Nov 15, 2017
98ca39f
Use ITreeData to represent data so that the Tree object can be reused…
shana Nov 15, 2017
bb7ef0b
Merge fixes/switching-views into branches-view
shana Nov 15, 2017
484d2ef
Don't need this anymore, Load always happens before Render
shana Nov 15, 2017
5d5b0c5
A tree control. Fix scrolling.
shana Nov 15, 2017
b743069
Icons needs to be embedded in the project
shana Nov 16, 2017
c477ef6
This was probably a bad copy-paste
shana Nov 16, 2017
e9181df
A serializable Texture2D wrapper to fix icon loading
shana Nov 16, 2017
f5b4fae
Cleanup some dead code and whitespace
shana Nov 16, 2017
0c34765
Merge branch 'master' into branches-view
StanleyGoldman Nov 20, 2017
fff2fce
Merge branch 'master' into branches-view
StanleyGoldman Nov 22, 2017
14f11ce
Merge branch 'enhancements/repository-watcher-refactor' into enhancem…
StanleyGoldman Nov 27, 2017
412fee8
Merge branch 'enhancements/branches-view-rollup' into branches-view
StanleyGoldman Nov 27, 2017
33379b5
Merge remote-tracking branch 'remotes/origin/branches-view' into fixe…
StanleyGoldman Nov 27, 2017
5dce3eb
Making sure to capture the rect returned by the remote tree branch
StanleyGoldman Nov 27, 2017
cd88b4b
Merge remote-tracking branch 'remotes/origin/branches-view' into enha…
StanleyGoldman Nov 27, 2017
a96c288
Merge branch 'fixes/remote-branches-list-error' into enhancements/bra…
StanleyGoldman Nov 27, 2017
a7119b7
Merge branch 'fixes/cache-events-on-main-thread' into enhancements/br…
StanleyGoldman Nov 27, 2017
1410a01
Merge branch 'enhancements/branches-view-rollup' into branches-view
StanleyGoldman Nov 27, 2017
658a4a8
Merge branch 'branches-view' into enhancements/branches-view-right-click
StanleyGoldman Nov 27, 2017
e0aedab
Adding a right click handler to Tree.Render(...)
StanleyGoldman Nov 27, 2017
c2a4989
Creating a context menu for local and remote branch nodes
StanleyGoldman Nov 27, 2017
f119dde
Merge branch 'branches-view' into fixes/branches-view-cleanup
StanleyGoldman Nov 27, 2017
90e9965
Removing references to Favorites
StanleyGoldman Nov 27, 2017
a22725f
Adding right click handlers for delete/create branch functionality
StanleyGoldman Nov 27, 2017
b112b6a
Adding functionality to checkout a remote branch via right click
StanleyGoldman Nov 27, 2017
ed8820e
Merge branch 'master' into enhancements/branches-view-rollup
StanleyGoldman Nov 27, 2017
0366037
Adding braces
StanleyGoldman Nov 27, 2017
b32901f
Merge branch 'fixes/remote-branches-list-error' into fixes/branches-v…
StanleyGoldman Nov 27, 2017
8107b88
Isolating the toggle image width for the toggle button
StanleyGoldman Nov 27, 2017
a5bc4b2
Preventing double and right click functionality on branch folders
StanleyGoldman Nov 27, 2017
73d841e
Cleanup GitBranch
StanleyGoldman Nov 28, 2017
f1daf3e
/branches-view-rollup:
StanleyGoldman Nov 28, 2017
65da890
Preventing serialization of some fields that don't change
StanleyGoldman Nov 28, 2017
87c63f0
Using GUIContent.none instead of an empty string
StanleyGoldman Nov 28, 2017
4105c91
Merge branch 'branches-view' into fixes/branches-view-cleanup
StanleyGoldman Nov 28, 2017
7c20494
Merge branch 'branches-view' into fixes/branches-view-expands-on-reload
StanleyGoldman Nov 28, 2017
cfd433c
Undoing some code cleanup
StanleyGoldman Nov 28, 2017
5d80511
Merge branch 'fixes/branches-view-cleanup' into fixes/branches-view-e…
StanleyGoldman Nov 28, 2017
6a7631b
Using a TreeNodeDictionary because it's more convenient
StanleyGoldman Nov 28, 2017
2c0f583
Merge remote-tracking branch 'remotes/origin/master' into enhancement…
StanleyGoldman Nov 29, 2017
22931e2
Merge branch 'enhancements/branches-view-rollup' into branches-view
StanleyGoldman Nov 29, 2017
3a71d36
Fixing focus typo
StanleyGoldman Nov 29, 2017
0f49079
Removing redundant if statement
StanleyGoldman Nov 29, 2017
02c4ed9
Merge branch 'branches-view' into fixes/branches-view-remove-serializ…
StanleyGoldman Nov 29, 2017
8143fa9
Merge branch 'fixes/remote-branches-list-error' into fixes/branches-v…
StanleyGoldman Nov 29, 2017
8198c74
Merge pull request #151 from github-for-unity/branches-view
StanleyGoldman Nov 29, 2017
cde9c2f
Merge branch 'enhancements/branches-view-rollup' into fixes/remote-br…
StanleyGoldman Nov 29, 2017
210e473
Merge branch 'enhancements/branches-view-rollup' into fixes/branches-…
StanleyGoldman Nov 29, 2017
7289324
Merge pull request #465 from github-for-unity/fixes/remote-branches-l…
StanleyGoldman Nov 29, 2017
ea44651
Merge pull request #468 from github-for-unity/fixes/branches-view-cle…
StanleyGoldman Nov 29, 2017
684990d
Merge branch 'enhancements/branches-view-rollup' into enhancements/br…
StanleyGoldman Nov 29, 2017
c4d641c
Merge branch 'enhancements/branches-view-rollup' into fixes/branches-…
StanleyGoldman Nov 29, 2017
1ac71e8
Some code cleanup
StanleyGoldman Nov 29, 2017
daa4ef6
Making constants out of context menu items labels
StanleyGoldman Nov 29, 2017
970a25f
Merge pull request #470 from github-for-unity/fixes/branches-view-fol…
StanleyGoldman Nov 29, 2017
fd4b6ed
Merge pull request #467 from github-for-unity/enhancements/branches-v…
StanleyGoldman Nov 29, 2017
1caab07
Seeing what happens if we don't serialize textures at all
StanleyGoldman Nov 29, 2017
ca6dc4b
Trying to reload the icons
StanleyGoldman Nov 29, 2017
924a28d
Using HideFlags.HideAndDontSave on Texture2D objects
StanleyGoldman Nov 29, 2017
f98db05
Merge branch 'enhancements/branches-view-rollup' into fixes/branches-…
StanleyGoldman Nov 29, 2017
821b8dc
Subclassing Tree in order to provide custom styling for a BranchTree
StanleyGoldman Nov 29, 2017
33b8780
Maintaining collapsed folder nodes appropriately during reload
StanleyGoldman Nov 29, 2017
3dcc13e
Merge branch 'fixes/branches-view-remove-serialized-texture2d' into f…
StanleyGoldman Nov 29, 2017
440175d
Preventing instance from getting replaced needlessly
StanleyGoldman Nov 29, 2017
2ce451c
Merge branch 'fixes/branches-view-remove-serialized-texture2d' into f…
StanleyGoldman Nov 29, 2017
ae4825a
Adding functionality to alternate the icon for remote branch trees
StanleyGoldman Nov 29, 2017
0b81ed4
Conslidating icon update logic
StanleyGoldman Nov 29, 2017
03d85a8
Moving BranchesTree to the bottom of the file
StanleyGoldman Nov 29, 2017
9dc931a
Simplifying logic
StanleyGoldman Nov 29, 2017
9922975
Merge commit '03d85a800838f06e03cbb4a4150bb5980516408f' into fixes/br…
StanleyGoldman Nov 29, 2017
9409168
Merge branch 'fixes/branches-view-remove-serialized-texture2d' into f…
StanleyGoldman Nov 29, 2017
cd3a65a
Renaming fields
StanleyGoldman Nov 29, 2017
95586c5
Merge pull request #478 from github-for-unity/fixes/branches-view-exp…
StanleyGoldman Nov 30, 2017
7839904
Merge remote-tracking branch 'remotes/origin/enhancements/branches-vi…
StanleyGoldman Nov 30, 2017
9f23c84
Merge pull request #479 from github-for-unity/fixes/branches-view-rem…
StanleyGoldman Nov 30, 2017
8713981
Merge branch 'enhancements/branches-view-rollup' into fixes/branches-…
StanleyGoldman Nov 30, 2017
27adae4
Renaming variable
StanleyGoldman Nov 30, 2017
1d3bdf1
Merge pull request #469 from github-for-unity/fixes/branches-view-glo…
StanleyGoldman Nov 30, 2017
83ddb4b
Merge branch 'master' into enhancements/branches-view-rollup
StanleyGoldman Dec 1, 2017
5506401
Merge branch 'fixes/update-after-push' into enhancements/branches-vie…
StanleyGoldman Dec 1, 2017
4b972ff
Merge branch 'master' into enhancements/branches-view-rollup
StanleyGoldman Dec 4, 2017
b7972d2
Merge branch 'fixes/default-struct-null-check' into enhancements/bran…
StanleyGoldman Dec 4, 2017
ca7296a
Merge branch 'fixes/application-cache-invalidation' into enhancements…
StanleyGoldman Dec 4, 2017
4d739e5
Merge branch 'fixes/user-update' into enhancements/branches-view-rollup
StanleyGoldman Dec 4, 2017
3f6e57e
Merge branch 'fixes/cache-update-event' into enhancements/branches-vi…
StanleyGoldman Dec 4, 2017
fd1e2ab
Switching to create branch mode and enabling the button at the right …
StanleyGoldman Dec 4, 2017
d3315fd
Merge pull request #499 from github-for-unity/fixes/create-branch-mode
StanleyGoldman Dec 4, 2017
8628674
Merge branch 'master' into enhancements/branches-view-rollup
StanleyGoldman Dec 4, 2017
77411b9
Merge branch 'fixes/menu-header-disappears' into enhancements/branche…
StanleyGoldman Dec 4, 2017
fc2653b
Merge branch 'fixes/split-status-cache' into enhancements/branches-vi…
StanleyGoldman Dec 4, 2017
e9d487e
Adding functionality to update styles
StanleyGoldman Dec 4, 2017
f7c6ca3
Merge branch 'fixes/changes-view-reload' into enhancements/branches-v…
StanleyGoldman Dec 5, 2017
14d16fe
Fixing styles that get used in the Tree
StanleyGoldman Dec 5, 2017
3b9521d
Merge branch 'enhancements/branches-view-rollup' into fixes/change-se…
StanleyGoldman Dec 5, 2017
0395bd6
Deferring the right click action to the next OnGui
StanleyGoldman Dec 5, 2017
4d5387f
Nit picking code
StanleyGoldman Dec 5, 2017
281ae99
Merge pull request #506 from github-for-unity/fixes/change-selection-…
StanleyGoldman Dec 5, 2017
5a896c7
Merge branch 'master' into enhancements/branches-view-rollup
StanleyGoldman Dec 5, 2017
a3a5bf4
Merge remote-tracking branch 'remotes/origin/fixes/tree-style-reloadi…
StanleyGoldman Dec 5, 2017
8a1cd93
Preventing checkout request when branch is already checked out
StanleyGoldman Dec 5, 2017
ba4f7f7
Remembering the last selected node when reloading the tree
StanleyGoldman Dec 5, 2017
73341b3
Merge pull request #508 from github-for-unity/fixes/last-few-fixes
StanleyGoldman Dec 5, 2017
5b67ea1
Preventing the render of nodes that are not visible
StanleyGoldman Dec 5, 2017
d12b1d4
Merge pull request #509 from github-for-unity/enhancements/skip-rende…
StanleyGoldman Dec 6, 2017
28e156d
Undoing unintentional change
StanleyGoldman Dec 6, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/GitHub.Api/Git/GitBranch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace GitHub.Unity
{
interface ITreeData
public interface ITreeData
{
string Name { get; }
bool IsActive { get; }
Expand All @@ -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");
Expand All @@ -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}";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
<Compile Include="UI\LoadingView.cs" />
<Compile Include="UI\PublishView.cs" />
<Compile Include="UI\InitProjectView.cs" />
<Compile Include="UI\TreeControl.cs" />
<Compile Include="UI\UserSettingsView.cs" />
<Compile Include="UI\GitPathView.cs" />
<Compile Include="UI\SettingsView.cs" />
Expand Down Expand Up @@ -207,6 +208,10 @@
</None>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="IconsAndLogos\globe%402x.png" />
<EmbeddedResource Include="IconsAndLogos\globe.png" />
</ItemGroup>
<Import Project="..\..\..\..\..\common\nativelibraries.props" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Expand All @@ -217,4 +222,4 @@
</Target>
-->
<Import Project="..\..\..\..\..\common\build.targets" />
</Project>
</Project>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
77 changes: 76 additions & 1 deletion src/UnityExtension/Assets/Editor/GitHub.Unity/Misc/Styles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@ class Styles
MinCommitTreePadding = 20f,
FoldoutWidth = 11f,
FoldoutIndentation = -2f,
TreePadding = 12f,
TreeIndentation = 12f,
TreeRootIndentation = -5f,
TreeVerticalSpacing = 3f,
CommitIconSize = 16f,
CommitIconHorizontalPadding = -5f,
BranchListIndentation = 20f,
BranchListSeperation = 15f,
BranchListSeparation = 15f,
RemotesTotalHorizontalMargin = 37f,
RemotesNameRatio = .2f,
RemotesUserRatio = .2f,
Expand Down Expand Up @@ -829,5 +830,79 @@ public static Texture2D DropdownListIcon
return dropdownListIcon;
}
}

private static Texture2D globeIcon;
public static Texture2D GlobeIcon
{
get
{
if (globeIcon == null)
{
globeIcon = Utility.GetIcon("globe.png", "globe@2x.png");
}
return globeIcon;
}
}

private static GUIStyle foldout;
public static GUIStyle Foldout
{
get
{
if (foldout == null)
{
foldout = new GUIStyle(EditorStyles.foldout);
foldout.name = "CustomFoldout";

foldout.focused.textColor = Color.white;
foldout.onFocused.textColor = Color.white;
foldout.focused.background = foldout.active.background;
foldout.onFocused.background = foldout.onActive.background;
}

return foldout;
}
}

private static GUIStyle treeNode;
public static GUIStyle TreeNode
{
get
{
if (treeNode == null)
{
treeNode = new GUIStyle(GUI.skin.label);
treeNode.name = "Custom TreeNode";

var color = new Color(62f / 255f, 125f / 255f, 231f / 255f);
var texture = Utility.GetTextureFromColor(color);
treeNode.focused.background = texture;
treeNode.onFocused.background = texture;
treeNode.focused.textColor = Color.white;
treeNode.onFocused.textColor = Color.white;
}

return treeNode;
}
}

private static GUIStyle treeNodeActive;
public static GUIStyle TreeNodeActive
{
get
{
if (treeNodeActive == null)
{
treeNodeActive = new GUIStyle(TreeNode);
treeNodeActive.name = "Custom TreeNode Active";
treeNodeActive.fontStyle = FontStyle.Bold;
treeNodeActive.focused.textColor = Color.white;
treeNodeActive.active.textColor = Color.white;
}

return treeNodeActive;
}
}

}
}
32 changes: 29 additions & 3 deletions src/UnityExtension/Assets/Editor/GitHub.Unity/Misc/Utility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,38 @@ public static Texture2D GetIcon(string filename, string filename2x = "")
filename = filename2x;
}

Texture2D texture2D = null;

var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("GitHub.Unity.IconsAndLogos." + filename);
if (stream != null)
return stream.ToTexture2D();
{
texture2D = stream.ToTexture2D();
}
else
{
var iconPath = EntryPoint.Environment.ExtensionInstallPath.Combine("IconsAndLogos", filename).ToString(SlashMode.Forward);
texture2D = AssetDatabase.LoadAssetAtPath<Texture2D>(iconPath);
}

if (texture2D != null)
{
texture2D.hideFlags = HideFlags.HideAndDontSave;
}

return texture2D;
}

public static Texture2D GetTextureFromColor(Color color)
{
Color[] pix = new Color[1];
pix[0] = color;

Texture2D result = new Texture2D(1, 1);
result.hideFlags = HideFlags.HideAndDontSave;
result.SetPixels(pix);
result.Apply();

var iconPath = EntryPoint.Environment.ExtensionInstallPath.Combine("IconsAndLogos", filename).ToString(SlashMode.Forward);
return AssetDatabase.LoadAssetAtPath<Texture2D>(iconPath);
return result;
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using GitHub.Unity;

namespace GitHub.Unity
{
Expand Down
Loading