@@ -21,20 +21,20 @@ public void SwitchThemeBasedOnTime()
2121 {
2222 ThemeToLight ( ) ;
2323 MainWindow . ThemeSettingDark = false ;
24- Console . WriteLine ( "Theme to Light" ) ;
24+ // Console.WriteLine("Theme to Light");
2525 }
2626 if ( minute >= darkStart [ 1 ] )
2727 {
2828 ThemeToDark ( ) ;
2929 MainWindow . ThemeSettingDark = true ;
30- Console . WriteLine ( "Theme to Dark" ) ;
30+ // Console.WriteLine("Theme to Dark");
3131 }
3232 }
3333 else
3434 {
3535 ThemeToDark ( ) ;
3636 MainWindow . ThemeSettingDark = true ;
37- Console . WriteLine ( "Theme to Dark" ) ;
37+ // Console.WriteLine("Theme to Dark");
3838 }
3939 }
4040 else if ( hour >= lightStart [ 0 ] || hour < darkStart [ 0 ] )
@@ -45,20 +45,20 @@ public void SwitchThemeBasedOnTime()
4545 {
4646 ThemeToDark ( ) ;
4747 MainWindow . ThemeSettingDark = true ;
48- Console . WriteLine ( "Theme to Dark" ) ;
48+ // Console.WriteLine("Theme to Dark");
4949 }
5050 if ( minute >= lightStart [ 1 ] )
5151 {
5252 ThemeToLight ( ) ;
5353 MainWindow . ThemeSettingDark = false ;
54- Console . WriteLine ( "Theme to Light" ) ;
54+ // Console.WriteLine("Theme to Light");
5555 }
5656 }
5757 else
5858 {
5959 ThemeToLight ( ) ;
6060 MainWindow . ThemeSettingDark = false ;
61- Console . WriteLine ( "Theme to Light" ) ;
61+ // Console.WriteLine("Theme to Light");
6262 }
6363 }
6464 }
@@ -68,15 +68,23 @@ public void ThemeToDark()
6868 if ( Properties . Settings . Default . AppThemeChange . Equals ( 0 ) ) AppTheme ( 0 ) ;
6969 if ( Properties . Settings . Default . SystemThemeChange . Equals ( 0 ) ) SystemTheme ( 0 ) ;
7070 if ( Properties . Settings . Default . EdgeThemeChange . Equals ( 0 ) ) EdgeTheme ( 1 ) ;
71- if ( Properties . Settings . Default . AccentColor && Properties . Settings . Default . SystemThemeChange . Equals ( 0 ) ) ColorPrevalence ( 1 ) ;
71+ if ( Properties . Settings . Default . AccentColor && Properties . Settings . Default . SystemThemeChange . Equals ( 0 ) )
72+ {
73+ System . Threading . Thread . Sleep ( 1000 ) ;
74+ ColorPrevalence ( 1 ) ;
75+ }
7276 }
7377
7478 public void ThemeToLight ( )
7579 {
80+ if ( Properties . Settings . Default . AccentColor && Properties . Settings . Default . SystemThemeChange . Equals ( 0 ) )
81+ {
82+ ColorPrevalence ( 0 ) ;
83+ System . Threading . Thread . Sleep ( 1000 ) ;
84+ }
7685 if ( Properties . Settings . Default . AppThemeChange . Equals ( 0 ) ) AppTheme ( 1 ) ;
7786 if ( Properties . Settings . Default . SystemThemeChange . Equals ( 0 ) ) SystemTheme ( 1 ) ;
7887 if ( Properties . Settings . Default . EdgeThemeChange . Equals ( 0 ) ) EdgeTheme ( 0 ) ;
79- if ( Properties . Settings . Default . AccentColor && Properties . Settings . Default . SystemThemeChange . Equals ( 0 ) ) ColorPrevalence ( 0 ) ;
8088 }
8189
8290 public void AppTheme ( int theme )
@@ -139,14 +147,7 @@ public void AddAutoStart()
139147 public void RemoveAutoStart ( )
140148 {
141149 RegistryKey registryKey = Registry . CurrentUser . OpenSubKey ( @"Software\Microsoft\Windows\CurrentVersion\Run" , true ) ;
142- try
143- {
144- registryKey . DeleteValue ( "AutoDarkMode" ) ;
145- }
146- catch
147- {
148-
149- }
150+ registryKey . DeleteValue ( "AutoDarkMode" , false ) ;
150151 }
151152 }
152- }
153+ }
0 commit comments