@@ -16,27 +16,62 @@ public static class AppThemeResourcesHelper
16
16
public static void LoadAppResources ( this IResourcesService service , IAppearanceSettingsService appearance )
17
17
{
18
18
var useCompactStyles = appearance . UseCompactStyles ;
19
- var appThemeBackgroundColor = ColorHelper . ToColor ( appearance . AppThemeBackgroundColor ) ;
19
+ var appThemeBackgroundColor = appearance . AppThemeBackgroundColor ;
20
20
var appThemeAddressBarBackgroundColor = appearance . AppThemeAddressBarBackgroundColor ;
21
21
var appThemeSidebarBackgroundColor = appearance . AppThemeSidebarBackgroundColor ;
22
22
var appThemeFileAreaBackgroundColor = appearance . AppThemeFileAreaBackgroundColor ;
23
23
var appThemeFontFamily = appearance . AppThemeFontFamily ;
24
24
25
25
service . SetCompactSpacing ( useCompactStyles ) ;
26
- service . SetAppThemeBackgroundColor ( appThemeBackgroundColor . FromWindowsColor ( ) ) ;
26
+ try
27
+ {
28
+ service . SetAppThemeBackgroundColor ( ColorHelper . ToColor ( appThemeBackgroundColor ) . FromWindowsColor ( ) ) ;
29
+ }
30
+ catch
31
+ {
32
+ appearance . AppThemeBackgroundColor = "#00000000" ; //migrate to new default
33
+ service . SetAppThemeBackgroundColor ( ColorHelper . ToColor ( "#00000000" ) . FromWindowsColor ( ) ) ;
34
+ }
27
35
28
36
if ( ! string . IsNullOrWhiteSpace ( appThemeAddressBarBackgroundColor ) && appThemeAddressBarBackgroundColor != "#00000000" )
29
- service . SetAppThemeAddressBarBackgroundColor ( ColorHelper . ToColor ( appThemeAddressBarBackgroundColor ) . FromWindowsColor ( ) ) ;
37
+ {
38
+ try
39
+ {
40
+ service . SetAppThemeAddressBarBackgroundColor ( ColorHelper . ToColor ( appThemeAddressBarBackgroundColor ) . FromWindowsColor ( ) ) ;
41
+ }
42
+ catch
43
+ {
44
+ appearance . AppThemeAddressBarBackgroundColor = "" ; //migrate to new default
45
+ }
46
+ }
30
47
else
31
48
appearance . AppThemeAddressBarBackgroundColor = "" ; //migrate to new default
32
49
33
- if ( ! string . IsNullOrWhiteSpace ( appThemeSidebarBackgroundColor ) && appThemeAddressBarBackgroundColor != "#00000000" )
34
- service . SetAppThemeSidebarBackgroundColor ( ColorHelper . ToColor ( appThemeSidebarBackgroundColor ) . FromWindowsColor ( ) ) ;
50
+ if ( ! string . IsNullOrWhiteSpace ( appThemeSidebarBackgroundColor ) && appThemeSidebarBackgroundColor != "#00000000" )
51
+ {
52
+ try
53
+ {
54
+ service . SetAppThemeSidebarBackgroundColor ( ColorHelper . ToColor ( appThemeSidebarBackgroundColor ) . FromWindowsColor ( ) ) ;
55
+ }
56
+ catch
57
+ {
58
+ appearance . AppThemeSidebarBackgroundColor = "" ; //migrate to new default
59
+ }
60
+ }
35
61
else
36
62
appearance . AppThemeSidebarBackgroundColor = "" ; //migrate to new default
37
63
38
- if ( ! string . IsNullOrWhiteSpace ( appThemeFileAreaBackgroundColor ) && appThemeAddressBarBackgroundColor != "#00000000" )
39
- service . SetAppThemeFileAreaBackgroundColor ( ColorHelper . ToColor ( appThemeFileAreaBackgroundColor ) . FromWindowsColor ( ) ) ;
64
+ if ( ! string . IsNullOrWhiteSpace ( appThemeFileAreaBackgroundColor ) && appThemeFileAreaBackgroundColor != "#00000000" )
65
+ {
66
+ try
67
+ {
68
+ service . SetAppThemeFileAreaBackgroundColor ( ColorHelper . ToColor ( appThemeFileAreaBackgroundColor ) . FromWindowsColor ( ) ) ;
69
+ }
70
+ catch
71
+ {
72
+ appearance . AppThemeFileAreaBackgroundColor = "" ; //migrate to new default
73
+ }
74
+ }
40
75
else
41
76
appearance . AppThemeFileAreaBackgroundColor = "" ; //migrate to new default
42
77
0 commit comments