Skip to content

Commit 5e9535c

Browse files
committed
Fixed
1 parent bd42d79 commit 5e9535c

File tree

3 files changed

+7
-22
lines changed

3 files changed

+7
-22
lines changed

Terminal.Gui/Configuration/ConfigurationManager.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -250,12 +250,6 @@ public static void Load (bool reset = false)
250250
Reset ();
251251
}
252252

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-
259253
if (Locations.HasFlag (ConfigLocations.GlobalCurrent))
260254
{
261255
Settings?.Update ($"./.tui/{_configFilename}");
@@ -295,6 +289,8 @@ public static void Load (bool reset = false)
295289
{
296290
Settings?.Update (Memory, "ConfigurationManager.Memory");
297291
}
292+
293+
ThemeManager.SelectedTheme = Settings!["Theme"].PropertyValue as string ?? "Default";
298294
}
299295

300296
/// <summary>

Terminal.Gui/Configuration/ThemeManager.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,9 @@ internal static string SelectedTheme
110110
string oldTheme = _theme;
111111
_theme = value;
112112

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))
114116
{
115117
Settings! ["Theme"].PropertyValue = _theme;
116118
Instance.OnThemeChanged (oldTheme);
@@ -148,7 +150,7 @@ internal void OnThemeChanged (string theme)
148150
internal static void Reset ()
149151
{
150152
Debug.WriteLine ("Themes.Reset()");
151-
Colors.Reset ();
153+
Colors.Reset ();
152154
Themes?.Clear ();
153155
SelectedTheme = string.Empty;
154156
}

UnitTests/Configuration/ConfigurationMangerTests.cs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public void Illustrate_DeepMemberWiseCopy_Breaks_Dictionary ()
161161
dict.Add (new (DeepCopyTest.key), "Esc");
162162
Assert.Contains (Key.Esc, dict);
163163

164-
DeepMemberWiseCopy (Key.Q.WithCtrl, DeepCopyTest.key);
164+
DeepCopyTest.key = (Key)DeepMemberWiseCopy (Key.Q.WithCtrl, DeepCopyTest.key);
165165

166166
Assert.Equal (Key.Q.WithCtrl, DeepCopyTest.key);
167167
Assert.Equal (Key.Esc, dict.Keys.ToArray () [0]);
@@ -178,19 +178,6 @@ public void Illustrate_DeepMemberWiseCopy_Breaks_Dictionary ()
178178
Assert.True (dict.ContainsKey (Key.Q.WithCtrl));
179179
}
180180

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-
194181
[Fact]
195182
public void Load_Raises_Updated ()
196183
{

0 commit comments

Comments
 (0)