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
47 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
412fee8
Merge branch 'enhancements/branches-view-rollup' into branches-view
StanleyGoldman Nov 27, 2017
1410a01
Merge branch 'enhancements/branches-view-rollup' into branches-view
StanleyGoldman Nov 27, 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
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
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
2 changes: 1 addition & 1 deletion 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 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.
79 changes: 77 additions & 2 deletions 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 @@ -194,7 +195,7 @@ public static GUIStyle Label
label = new GUIStyle(GUI.skin.label);
label.name = "CustomLabel";

var hierarchyStyle = GUI.skin.FindStyle("PR Label");
GUIStyle hierarchyStyle = GUI.skin.FindStyle("PR Label");
label.onNormal.background = hierarchyStyle.onNormal.background;
label.onNormal.textColor = hierarchyStyle.onNormal.textColor;
label.onFocused.background = hierarchyStyle.onFocused.background;
Expand Down Expand Up @@ -829,5 +830,79 @@ public static Texture2D DropdownListIcon
return dropdownListIcon;
}
}

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

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;
}
}

}
}
46 changes: 46 additions & 0 deletions src/UnityExtension/Assets/Editor/GitHub.Unity/Misc/Utility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,40 @@

namespace GitHub.Unity
{
[Serializable]
public class SerializableTexture2D
{
[SerializeField] private byte[] bytes;
[SerializeField] private int height;
[SerializeField] private int width;
[SerializeField] private TextureFormat format;
[SerializeField] private bool mipmap;
[SerializeField] private Texture2D texture;

public Texture2D Texture
{
get
{
if (texture == null)
{
texture = new Texture2D(width, height, format, mipmap);
texture.LoadRawTextureData(bytes);
texture.Apply();
}
return texture;
}
set
{
texture = value;
bytes = value.GetRawTextureData();
height = value.height;
width = value.width;
format = value.format;
mipmap = value.mipmapCount > 1;
}
}
}

class Utility : ScriptableObject
{
public static Texture2D GetIcon(string filename, string filename2x = "")
Expand All @@ -23,6 +57,18 @@ public static Texture2D GetIcon(string filename, string filename2x = "")
var iconPath = EntryPoint.Environment.ExtensionInstallPath.Combine("IconsAndLogos", filename).ToString(SlashMode.Forward);
return AssetDatabase.LoadAssetAtPath<Texture2D>(iconPath);
}

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

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

return result;
}
}

static class StreamExtensions
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