Skip to content

Commit 93ec82b

Browse files
committed
2023-06-27_01 - Theme fixes
- Fixed windows accent option not persistent - Fixed accent color not setting properly - Fixed accent color not being used for window buttons
1 parent 38b7814 commit 93ec82b

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

TcNo-Acc-Switcher-Globals/Globals.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public partial class Globals
2727
#pragma warning disable CA2211 // Non-constant fields should not be visible - This is necessary due to it being a launch parameter.
2828
public static bool VerboseMode;
2929
#pragma warning restore CA2211 // Non-constant fields should not be visible
30-
public static readonly string Version = "2023-06-27_00";
30+
public static readonly string Version = "2023-06-27_01";
3131

3232
#region INITIALISATION
3333

TcNo-Acc-Switcher-Server/Data/AppSettings.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ public static AppSettings Instance
117117
[JsonProperty("DiscordRpcShareTotalSwitches", Order = 19)] private bool _discordRpcShare = true;
118118
[JsonProperty("PasswordHash", Order = 20)] private string _passwordHash = "";
119119
[JsonProperty("GloballyHiddenMetrics", Order = 21)] private Dictionary<string, Dictionary<string, bool>> _globallyHiddenMetrics = new();
120+
[JsonProperty("WindowsAccent", Order = 21)] private bool _windowsAccent;
120121
[JsonIgnore] private bool _desktopShortcut;
121122
[JsonIgnore] private bool _startMenu;
122123
[JsonIgnore] private bool _startMenuPlatforms;
@@ -238,8 +239,6 @@ public static async Task ShowPlatform(string platform)
238239

239240
private string _stylesheet;
240241
public static string Stylesheet { get => Instance._stylesheet; set => Instance._stylesheet = value; }
241-
242-
private bool _windowsAccent;
243242
public static bool WindowsAccent { get => Instance._windowsAccent; set => Instance._windowsAccent = value; }
244243

245244
private string _windowsAccentColor = "";
@@ -659,6 +658,7 @@ public static void WindowsAccent_Toggle()
659658
WindowsAccentColor = "";
660659
_ = AppData.ReloadPage();
661660
}
661+
SaveSettings();
662662
}
663663

664664
[SupportedOSPlatform("windows")]
@@ -669,7 +669,8 @@ private static void SetAccentColor(bool userInvoked)
669669
WindowsAccentColor = GetAccentColorHexString();
670670
var (r, g, b) = GetAccentColor();
671671
WindowsAccentColorHsl = FromRgb(r, g, b);
672-
672+
673+
SaveSettings();
673674
if (userInvoked)
674675
_ = AppData.ReloadPage();
675676
}

TcNo-Acc-Switcher-Server/Shared/DynamicStylesheet.razor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public string GetStylesheetMarkupString()
3434

3535
var (h, s, l) = AppSettings.WindowsAccentColorHsl;
3636
var (r, g, b) = AppSettings.WindowsAccentColorInt;
37-
style = $":root {{ --accentHS: {h}, {s}%; --accentL: {l}%; --accent: {AppSettings.WindowsAccentColor}}}\n\n; --accentInt: {r}, {g}, {b}" + style;
37+
style = $":root {{ --accentHS: {h}, {s}%; --accentL: {l}%; --accent: {AppSettings.WindowsAccentColor}; --accentInt: {r}, {g}, {b}}}\n\n; " + style;
3838
}
3939

4040
if (AppSettings.Rtl)

TcNo-Acc-Switcher-Server/themes/Monokai/style.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ button#LocateProgramExe,
350350
#modalBtnBack:hover,
351351
#btnRestore:hover,
352352
#btnMax:hover {
353-
background: var(--accent);
353+
background: rgba(var(--accentInt), 50%);
354354
}
355355

356356
.clearingRight {

0 commit comments

Comments
 (0)