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

Commit 1bd5a07

Browse files
committed
Fix icon colors on the dark theme
1 parent f98513d commit 1bd5a07

File tree

2 files changed

+18
-13
lines changed

2 files changed

+18
-13
lines changed

src/UnityExtension/Assets/Editor/GitHub.Unity/Misc/Styles.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,7 @@ public static Texture2D ActiveBranchIcon
806806
{
807807
get
808808
{
809-
return Utility.GetIcon("current-branch-indicator.png", "[email protected]");
809+
return Utility.GetIcon("current-branch-indicator.png", "[email protected]", Utility.IsDarkTheme);
810810
}
811811
}
812812

@@ -846,15 +846,15 @@ public static Texture2D SmallLogo
846846
{
847847
get
848848
{
849-
return Utility.GetIcon("small-logo.png");
849+
return Utility.IsDarkTheme ? Utility.GetIcon("small-logo-light.png", "[email protected]") : Utility.GetIcon("small-logo.png", "small-logo@2x.png");
850850
}
851851
}
852852

853853
public static Texture2D BigLogo
854854
{
855855
get
856856
{
857-
return Utility.IsDarkTheme ? Utility.GetIcon("big-logo-light.png") : Utility.GetIcon("big-logo.png");
857+
return Utility.IsDarkTheme ? Utility.GetIcon("big-logo-light.png", "[email protected]") : Utility.GetIcon("big-logo.png", "big-logo@2x.png");
858858
}
859859
}
860860

@@ -870,15 +870,15 @@ public static Texture2D DotIcon
870870
{
871871
get
872872
{
873-
return Utility.GetIcon("dot.png", "[email protected]");
873+
return Utility.GetIcon("dot.png", "[email protected]", Utility.IsDarkTheme);
874874
}
875875
}
876876

877877
public static Texture2D LocalCommitIcon
878878
{
879879
get
880880
{
881-
return Utility.GetIcon("local-commit-icon.png", "[email protected]");
881+
return Utility.GetIcon("local-commit-icon.png", "[email protected]", Utility.IsDarkTheme);
882882
}
883883
}
884884

@@ -894,7 +894,7 @@ public static Texture2D RepoIcon
894894
{
895895
get
896896
{
897-
return Utility.GetIcon("repo.png", "[email protected]");
897+
return Utility.GetIcon("repo.png", "[email protected]", Utility.IsDarkTheme);
898898
}
899899
}
900900

@@ -908,10 +908,10 @@ public static Texture2D LockIcon
908908

909909
public static Texture2D EmptyStateInit
910910
{
911-
get
912-
{
913-
return Utility.GetIcon("empty-state-init.png", "[email protected]");
914-
}
911+
get
912+
{
913+
return Utility.GetIcon("empty-state-init.png", "[email protected]");
914+
}
915915
}
916916

917917
public static Texture2D DropdownListIcon
@@ -926,7 +926,7 @@ public static Texture2D GlobeIcon
926926
{
927927
get
928928
{
929-
return Utility.GetIcon("globe.png", "[email protected]");
929+
return Utility.GetIcon("globe.png", "[email protected]", Utility.IsDarkTheme);
930930
}
931931
}
932932

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class Window : BaseWindow
1616
[NonSerialized] private Spinner spinner;
1717
[NonSerialized] private IProgress repositoryProgress;
1818
[NonSerialized] private IProgress appManagerProgress;
19+
[NonSerialized] private bool firstOnGUI = true;
1920

2021
[SerializeField] private double progressMessageClearTime = -1;
2122
[SerializeField] private double notificationClearTime = -1;
@@ -112,8 +113,6 @@ public override void Initialize(IApplicationManager applicationManager)
112113
LocksView.InitializeView(this);
113114
InitProjectView.InitializeView(this);
114115

115-
titleContent = new GUIContent(Title, Styles.SmallLogo);
116-
117116
if (!HasRepository)
118117
{
119118
changeTab = activeTab = SubTab.InitProject;
@@ -213,6 +212,12 @@ private void ValidateCachedData(IRepository repository)
213212

214213
private void MaybeUpdateData()
215214
{
215+
if (firstOnGUI)
216+
{
217+
titleContent = new GUIContent(Title, Styles.SmallLogo);
218+
}
219+
firstOnGUI = false;
220+
216221
UriString host = null;
217222
if (!HasRepository || String.IsNullOrEmpty(Repository.CloneUrl))
218223
{

0 commit comments

Comments
 (0)