@@ -96,33 +96,6 @@ class Styles
96
96
locksViewLockedByStyle ,
97
97
locksViewLockedBySelectedStyle ;
98
98
99
- private static Texture2D branchIcon ,
100
- activeBranchIcon ,
101
- trackingBranchIcon ,
102
- favoriteIconOn ,
103
- favoriteIconOff ,
104
- smallLogoIcon ,
105
- bigLogoIcon ,
106
- folderIcon ,
107
- mergeIcon ,
108
- dotIcon ,
109
- localCommitIcon ,
110
- repoIcon ,
111
- lockIcon ,
112
- emptyStateInit ,
113
- dropdownListIcon ,
114
- globeIcon ,
115
- spinnerInside ,
116
- spinnerOutside ,
117
- code ,
118
- rocket ,
119
- merge ,
120
- spinnerInsideInverted ,
121
- spinnerOutsideInverted ,
122
- codeInverted ,
123
- rocketInverted ,
124
- mergeInverted ;
125
-
126
99
public static Texture2D GetFileStatusIcon ( GitFileStatus status , bool isLocked )
127
100
{
128
101
if ( isLocked )
@@ -833,330 +806,207 @@ public static Texture2D ActiveBranchIcon
833
806
{
834
807
get
835
808
{
836
- if ( activeBranchIcon == null )
837
- {
838
- activeBranchIcon = Utility . GetIcon ( "current-branch-indicator.png" , "current-branch-indicator@2x.png" ) ;
839
- }
840
- return activeBranchIcon ;
809
+ return Utility . GetIcon ( "current-branch-indicator.png" , "current-branch-indicator@2x.png" , Utility . IsDarkTheme ) ;
841
810
}
842
811
}
843
812
844
813
public static Texture2D BranchIcon
845
814
{
846
815
get
847
816
{
848
- if ( branchIcon == null )
849
- {
850
- branchIcon = Utility . GetIcon ( "branch.png" , "branch@2x.png" ) ;
851
- }
852
- return branchIcon ;
817
+ return Utility . GetIcon ( "branch.png" , "branch@2x.png" ) ;
853
818
}
854
819
}
855
820
856
821
public static Texture2D TrackingBranchIcon
857
822
{
858
823
get
859
824
{
860
- if ( trackingBranchIcon == null )
861
- {
862
- trackingBranchIcon = Utility . GetIcon ( "tracked-branch-indicator.png" ) ;
863
- }
864
-
865
- return trackingBranchIcon ;
825
+ return Utility . GetIcon ( "tracked-branch-indicator.png" ) ;
866
826
}
867
827
}
868
828
869
829
public static Texture2D FavoriteIconOn
870
830
{
871
831
get
872
832
{
873
- if ( favoriteIconOn == null )
874
- {
875
- favoriteIconOn = Utility . GetIcon ( "favorite-branch-indicator.png" ) ;
876
- }
877
-
878
- return favoriteIconOn ;
833
+ return Utility . GetIcon ( "favorite-branch-indicator.png" ) ;
879
834
}
880
835
}
881
836
882
837
public static Texture2D FavoriteIconOff
883
838
{
884
839
get
885
840
{
886
- if ( favoriteIconOff == null )
887
- {
888
- favoriteIconOff = FolderIcon ;
889
- }
890
-
891
- return favoriteIconOff ;
841
+ return FolderIcon ;
892
842
}
893
843
}
894
844
895
845
public static Texture2D SmallLogo
896
846
{
897
847
get
898
848
{
899
- if ( smallLogoIcon == null )
900
- {
901
- smallLogoIcon = Utility . GetIcon ( "small-logo.png" ) ;
902
- }
903
-
904
- return smallLogoIcon ;
849
+ return Utility . IsDarkTheme ? Utility . GetIcon ( "small-logo-light.png" , "small-logo-light@2x.png" ) : Utility . GetIcon ( "small-logo.png" , "small-logo@2x.png" ) ;
905
850
}
906
851
}
907
852
908
853
public static Texture2D BigLogo
909
854
{
910
855
get
911
856
{
912
- if ( bigLogoIcon == null )
913
- {
914
- var defaultTextColor = Label . normal . textColor ;
915
- if ( defaultTextColor . r > 0.5f && defaultTextColor . g > 0.5f && defaultTextColor . b > 0.5f )
916
- bigLogoIcon = Utility . GetIcon ( "big-logo-light.png" ) ;
917
- else
918
- bigLogoIcon = Utility . GetIcon ( "big-logo.png" ) ;
919
- }
920
-
921
- return bigLogoIcon ;
857
+ return Utility . IsDarkTheme ? Utility . GetIcon ( "big-logo-light.png" , "big-logo-light@2x.png" ) : Utility . GetIcon ( "big-logo.png" , "big-logo@2x.png" ) ;
922
858
}
923
859
}
924
860
925
861
public static Texture2D MergeIcon
926
862
{
927
863
get
928
864
{
929
- if ( mergeIcon == null )
930
- {
931
- mergeIcon = Utility . GetIcon ( "git-merge.png" , "git-merge@2x.png" ) ;
932
- }
933
-
934
- return mergeIcon ;
865
+ return Utility . GetIcon ( "git-merge.png" , "git-merge@2x.png" ) ;
935
866
}
936
867
}
937
868
938
869
public static Texture2D DotIcon
939
870
{
940
871
get
941
872
{
942
- if ( dotIcon == null )
943
- {
944
- dotIcon = Utility . GetIcon ( "dot.png" , "dot@2x.png" ) ;
945
- }
946
-
947
- return dotIcon ;
873
+ return Utility . GetIcon ( "dot.png" , "dot@2x.png" , Utility . IsDarkTheme ) ;
948
874
}
949
875
}
950
876
951
877
public static Texture2D LocalCommitIcon
952
878
{
953
879
get
954
880
{
955
- if ( localCommitIcon == null )
956
- {
957
- localCommitIcon = Utility . GetIcon ( "local-commit-icon.png" , "local-commit-icon@2x.png" ) ;
958
- }
959
-
960
- return localCommitIcon ;
881
+ return Utility . GetIcon ( "local-commit-icon.png" , "local-commit-icon@2x.png" , Utility . IsDarkTheme ) ;
961
882
}
962
883
}
963
884
964
885
public static Texture2D FolderIcon
965
886
{
966
887
get
967
888
{
968
- if ( folderIcon == null )
969
- {
970
- folderIcon = EditorGUIUtility . FindTexture ( "Folder Icon" ) ;
971
- }
972
-
973
- return folderIcon ;
889
+ return EditorGUIUtility . FindTexture ( "Folder Icon" ) ;
974
890
}
975
891
}
976
892
977
893
public static Texture2D RepoIcon
978
894
{
979
895
get
980
896
{
981
- if ( repoIcon == null )
982
- {
983
- repoIcon = Utility . GetIcon ( "repo.png" , "repo@2x.png" ) ;
984
- }
985
- return repoIcon ;
897
+ return Utility . GetIcon ( "repo.png" , "repo@2x.png" , Utility . IsDarkTheme ) ;
986
898
}
987
899
}
988
900
989
901
public static Texture2D LockIcon
990
902
{
991
903
get
992
904
{
993
- if ( lockIcon == null )
994
- {
995
- lockIcon = Utility . GetIcon ( "lock.png" , "lock@2x.png" ) ;
996
- }
997
- return lockIcon ;
905
+ return Utility . GetIcon ( "lock.png" , "lock@2x.png" ) ;
998
906
}
999
907
}
1000
908
1001
909
public static Texture2D EmptyStateInit
1002
910
{
1003
- get
1004
- {
1005
- if ( emptyStateInit == null )
911
+ get
1006
912
{
1007
- emptyStateInit = Utility . GetIcon ( "empty-state-init.png" , "empty-state-init@2x.png" ) ;
913
+ return Utility . GetIcon ( "empty-state-init.png" , "empty-state-init@2x.png" ) ;
1008
914
}
1009
- return emptyStateInit ;
1010
- }
1011
-
1012
915
}
1013
916
1014
917
public static Texture2D DropdownListIcon
1015
918
{
1016
919
get
1017
920
{
1018
- if ( dropdownListIcon == null )
1019
- {
1020
- dropdownListIcon = Utility . GetIcon ( "dropdown-list-icon.png" , "dropdown-list-icon@2x.png" ) ;
1021
- }
1022
- return dropdownListIcon ;
921
+ return Utility . GetIcon ( "dropdown-list-icon.png" , "dropdown-list-icon@2x.png" ) ;
1023
922
}
1024
923
}
1025
924
1026
925
public static Texture2D GlobeIcon
1027
926
{
1028
927
get
1029
928
{
1030
- if ( globeIcon == null )
1031
- {
1032
- globeIcon = Utility . GetIcon ( "globe.png" , "globe@2x.png" ) ;
1033
- }
1034
- return globeIcon ;
929
+ return Utility . GetIcon ( "globe.png" , "globe@2x.png" , Utility . IsDarkTheme ) ;
1035
930
}
1036
931
}
1037
932
1038
933
public static Texture2D SpinnerInside
1039
934
{
1040
935
get
1041
936
{
1042
- if ( spinnerInside == null )
1043
- {
1044
- spinnerInside = Utility . GetIcon ( "spinner-inside.png" , "spinner-inside@2x.png" ) ;
1045
- }
1046
- return spinnerInside ;
937
+ return Utility . GetIcon ( "spinner-inside.png" , "spinner-inside@2x.png" ) ;
1047
938
}
1048
939
}
1049
940
1050
941
public static Texture2D SpinnerOutside
1051
942
{
1052
943
get
1053
944
{
1054
- if ( spinnerOutside == null )
1055
- {
1056
- spinnerOutside = Utility . GetIcon ( "spinner-outside.png" , "spinner-outside@2x.png" ) ;
1057
- }
1058
- return spinnerOutside ;
945
+ return Utility . GetIcon ( "spinner-outside.png" , "spinner-outside@2x.png" ) ;
1059
946
}
1060
947
}
1061
948
1062
949
public static Texture2D Code
1063
950
{
1064
951
get
1065
952
{
1066
- if ( code == null )
1067
- {
1068
- code = Utility . GetIcon ( "code.png" , "code@2x.png" ) ;
1069
- }
1070
- return code ;
953
+ return Utility . GetIcon ( "code.png" , "code@2x.png" ) ;
1071
954
}
1072
955
}
1073
956
1074
957
public static Texture2D Rocket
1075
958
{
1076
959
get
1077
960
{
1078
- if ( rocket == null )
1079
- {
1080
- rocket = Utility . GetIcon ( "rocket.png" , "rocket@2x.png" ) ;
1081
- }
1082
- return rocket ;
961
+ return Utility . GetIcon ( "rocket.png" , "rocket@2x.png" ) ;
1083
962
}
1084
963
}
1085
964
1086
965
public static Texture2D Merge
1087
966
{
1088
967
get
1089
968
{
1090
- if ( merge == null )
1091
- {
1092
- merge = Utility . GetIcon ( "merge.png" , "merge@2x.png" ) ;
1093
- }
1094
- return merge ;
969
+ return Utility . GetIcon ( "merge.png" , "merge@2x.png" ) ;
1095
970
}
1096
971
}
1097
972
1098
973
public static Texture2D SpinnerInsideInverted
1099
974
{
1100
975
get
1101
976
{
1102
- if ( spinnerInsideInverted == null )
1103
- {
1104
- spinnerInsideInverted = Utility . GetIcon ( "spinner-inside.png" , "spinner-inside@2x.png" ) ;
1105
- spinnerInsideInverted . InvertColors ( ) ;
1106
- }
1107
- return spinnerInsideInverted ;
977
+ return Utility . GetIcon ( "spinner-inside.png" , "spinner-inside@2x.png" , true ) ;
1108
978
}
1109
979
}
1110
980
1111
981
public static Texture2D SpinnerOutsideInverted
1112
982
{
1113
983
get
1114
984
{
1115
- if ( spinnerOutsideInverted == null )
1116
- {
1117
- spinnerOutsideInverted = Utility . GetIcon ( "spinner-outside.png" , "spinner-outside@2x.png" ) ;
1118
- spinnerOutsideInverted . InvertColors ( ) ;
1119
- }
1120
- return spinnerOutsideInverted ;
985
+ return Utility . GetIcon ( "spinner-outside.png" , "spinner-outside@2x.png" , true ) ;
1121
986
}
1122
987
}
1123
988
1124
989
public static Texture2D CodeInverted
1125
990
{
1126
991
get
1127
992
{
1128
- if ( codeInverted == null )
1129
- {
1130
- codeInverted = Utility . GetIcon ( "code.png" , "code@2x.png" ) ;
1131
- codeInverted . InvertColors ( ) ;
1132
- }
1133
- return codeInverted ;
993
+ return Utility . GetIcon ( "code.png" , "code@2x.png" , true ) ;
1134
994
}
1135
995
}
1136
996
1137
997
public static Texture2D RocketInverted
1138
998
{
1139
999
get
1140
1000
{
1141
- if ( rocketInverted == null )
1142
- {
1143
- rocketInverted = Utility . GetIcon ( "rocket.png" , "rocket@2x.png" ) ;
1144
- rocketInverted . InvertColors ( ) ;
1145
- }
1146
- return rocketInverted ;
1001
+ return Utility . GetIcon ( "rocket.png" , "rocket@2x.png" , true ) ;
1147
1002
}
1148
1003
}
1149
1004
1150
1005
public static Texture2D MergeInverted
1151
1006
{
1152
1007
get
1153
1008
{
1154
- if ( mergeInverted == null )
1155
- {
1156
- mergeInverted = Utility . GetIcon ( "merge.png" , "merge@2x.png" ) ;
1157
- mergeInverted . InvertColors ( ) ;
1158
- }
1159
- return mergeInverted ;
1009
+ return Utility . GetIcon ( "merge.png" , "merge@2x.png" , true ) ;
1160
1010
}
1161
1011
}
1162
1012
private static GUIStyle foldout ;
0 commit comments