File tree Expand file tree Collapse file tree 3 files changed +7
-22
lines changed
Terminal.Gui/Configuration Expand file tree Collapse file tree 3 files changed +7
-22
lines changed Original file line number Diff line number Diff line change @@ -250,12 +250,6 @@ public static void Load (bool reset = false)
250
250
Reset ( ) ;
251
251
}
252
252
253
- // Deafult is always loaded by Reset, so only load it if reset is false
254
- if ( ! reset && Locations . HasFlag ( ConfigLocations . Default ) )
255
- {
256
- Settings ? . UpdateFromResource ( typeof ( ConfigurationManager ) . Assembly , $ "Terminal.Gui.Resources.{ _configFilename } ") ;
257
- }
258
-
259
253
if ( Locations . HasFlag ( ConfigLocations . GlobalCurrent ) )
260
254
{
261
255
Settings ? . Update ( $ "./.tui/{ _configFilename } ") ;
@@ -295,6 +289,8 @@ public static void Load (bool reset = false)
295
289
{
296
290
Settings ? . Update ( Memory , "ConfigurationManager.Memory" ) ;
297
291
}
292
+
293
+ ThemeManager . SelectedTheme = Settings ! [ "Theme" ] . PropertyValue as string ?? "Default" ;
298
294
}
299
295
300
296
/// <summary>
Original file line number Diff line number Diff line change @@ -110,7 +110,9 @@ internal static string SelectedTheme
110
110
string oldTheme = _theme ;
111
111
_theme = value ;
112
112
113
- if ( ( oldTheme != _theme || oldTheme != Settings ! [ "Theme" ] . PropertyValue as string ) && Settings ! [ "Themes" ] ? . PropertyValue is Dictionary < string , ThemeScope > themes && themes . ContainsKey ( _theme ) )
113
+ if ( ( oldTheme != _theme
114
+ || oldTheme != Settings ! [ "Theme" ] . PropertyValue as string )
115
+ && Settings ! [ "Themes" ] ? . PropertyValue is Dictionary < string , ThemeScope > themes && themes . ContainsKey ( _theme ) )
114
116
{
115
117
Settings ! [ "Theme" ] . PropertyValue = _theme ;
116
118
Instance . OnThemeChanged ( oldTheme ) ;
@@ -148,7 +150,7 @@ internal void OnThemeChanged (string theme)
148
150
internal static void Reset ( )
149
151
{
150
152
Debug . WriteLine ( "Themes.Reset()" ) ;
151
- Colors . Reset ( ) ;
153
+ Colors . Reset ( ) ;
152
154
Themes ? . Clear ( ) ;
153
155
SelectedTheme = string . Empty ;
154
156
}
Original file line number Diff line number Diff line change @@ -161,7 +161,7 @@ public void Illustrate_DeepMemberWiseCopy_Breaks_Dictionary ()
161
161
dict . Add ( new ( DeepCopyTest . key ) , "Esc" ) ;
162
162
Assert . Contains ( Key . Esc , dict ) ;
163
163
164
- DeepMemberWiseCopy ( Key . Q . WithCtrl , DeepCopyTest . key ) ;
164
+ DeepCopyTest . key = ( Key ) DeepMemberWiseCopy ( Key . Q . WithCtrl , DeepCopyTest . key ) ;
165
165
166
166
Assert . Equal ( Key . Q . WithCtrl , DeepCopyTest . key ) ;
167
167
Assert . Equal ( Key . Esc , dict . Keys . ToArray ( ) [ 0 ] ) ;
@@ -178,19 +178,6 @@ public void Illustrate_DeepMemberWiseCopy_Breaks_Dictionary ()
178
178
Assert . True ( dict . ContainsKey ( Key . Q . WithCtrl ) ) ;
179
179
}
180
180
181
- //[Fact]
182
- //public void Illustrate_DeepMemberWiseCopy_ ()
183
- //{
184
- // Assert.Equal (Key.Esc, Application.QuitKey);
185
-
186
- // var o = UpdateValueFrom (Application.QuitKey);
187
- // DeepMemberWiseCopy (Key.Q.WithCtrl, Application.QuitKey);
188
-
189
- // Assert.Equal (Key.Q.WithCtrl, Application.QuitKey);
190
-
191
- // Application.ResetState (true);
192
- //}
193
-
194
181
[ Fact ]
195
182
public void Load_Raises_Updated ( )
196
183
{
You can’t perform that action at this time.
0 commit comments