@@ -66,8 +66,6 @@ public partial class MainWindow : Window
66
66
string defaultDateFormat = "dd/MM/yyyy HH:mm:ss" ;
67
67
string adbLogCatArgs = defaultAdbLogCatArgs ;
68
68
69
- Dictionary < string , SolidColorBrush > origResourceColors = new Dictionary < string , SolidColorBrush > ( ) ;
70
-
71
69
string currentBuildReportProjectPath = null ;
72
70
string currentBuildPluginsRelativePath = null ;
73
71
//List<List<string>> buildReports = new List<List<string>>();
@@ -168,12 +166,6 @@ void Start()
168
166
// build notifyicon (using windows.forms)
169
167
notifyIcon . MouseClick += new System . Windows . Forms . MouseEventHandler ( NotifyIcon_MouseClick ) ;
170
168
171
- // get original colors
172
- foreach ( DictionaryEntry item in Application . Current . Resources . MergedDictionaries [ 0 ] )
173
- {
174
- origResourceColors [ item . Key . ToString ( ) ] = ( SolidColorBrush ) item . Value ;
175
- }
176
-
177
169
ApplyTheme ( txtCustomThemeFile . Text ) ;
178
170
179
171
// for autostart with minimized
@@ -198,7 +190,7 @@ void Start()
198
190
if ( Settings . Default . disableUnityHubLaunch == true ) StartHubPipe ( ) ;
199
191
200
192
isInitializing = false ;
201
- }
193
+ } // Start()
202
194
203
195
private static NamedPipeServerStream hubPipeServer ;
204
196
private CancellationTokenSource _hubCancellationTokenSource ;
@@ -2762,9 +2754,12 @@ void ApplyTheme(string themeFile)
2762
2754
2763
2755
void ResetTheme ( )
2764
2756
{
2765
- foreach ( KeyValuePair < string , SolidColorBrush > item in origResourceColors )
2757
+ foreach ( DictionaryEntry item in Application . Current . Resources . MergedDictionaries [ 0 ] )
2766
2758
{
2767
- Application . Current . Resources [ item . Key ] = item . Value ;
2759
+ if ( item . Key is string key && item . Value is SolidColorBrush brush )
2760
+ {
2761
+ Application . Current . Resources [ key ] = brush ;
2762
+ }
2768
2763
}
2769
2764
}
2770
2765
0 commit comments