Skip to content

Commit bbf9a41

Browse files
committed
QOL
1 parent f7ee44b commit bbf9a41

3 files changed

Lines changed: 107 additions & 11977 deletions

File tree

Taskplay/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ static class Program
2222
{
2323
static bool windowsDarkMode = Microsoft.Win32.Registry.GetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize", "AppsUseLightTheme", 1).ToString() == "0";
2424
static bool _isMusicPlaying = true; // Bool to keep in check if the user is playing music
25-
static bool IsDarkModeOn => GetSettingState("DarkMode");
25+
static bool IsDarkModeOn => GetSettingState("DarkMode", !(Microsoft.Win32.Registry.GetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize", "AppsUseLightTheme", 1).ToString() == "0"));
2626
static bool showNextButton => GetSettingState("ShowNextButton", true);
2727
static bool showPrevButton => GetSettingState("ShowPrevButton", true);
2828
static bool IsSyncEnabled => GetSettingState("SyncEnabled", true);

Taskplay/SettingsForm.cs

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1-
using System;
1+
using MetroFramework;
2+
using System;
23
using System.Diagnostics;
34
using System.Runtime.InteropServices;
45
using System.Windows.Forms;
56

67
namespace Taskplay
78
{
9+
public struct ThemeSettings
10+
{
11+
public bool systemDarkMode;
12+
}
13+
814
public partial class SettingsForm : Form
915
{
1016
Microsoft.Win32.RegistryKey autorun;
@@ -37,9 +43,18 @@ public SettingsForm(bool isDarkModeOn, bool showNextButton, bool showPrevButton,
3743
this.syncInterval = syncInterval;
3844
this.waitAfterClickSync = waitAfterClickSync;
3945
this.showSongChangeButtonsWhilePaused = showSongChangeButtonsWhilePaused;
40-
41-
42-
46+
//get system accent color using winUISettings
47+
var uiSettings = new Windows.UI.ViewManagement.UISettings();
48+
var accentColor = uiSettings.GetColorValue(Windows.UI.ViewManagement.UIColorType.Accent);
49+
//Figure out for later
50+
if (Microsoft.Win32.Registry.GetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize", "AppsUseLightTheme", 1).ToString() == "0")
51+
{
52+
metroStyleManager1.Style = MetroFramework.MetroColorStyle.White;
53+
}
54+
else
55+
{
56+
metroStyleManager1.Style = MetroFramework.MetroColorStyle.Black;
57+
}
4358
}
4459

4560
private void SettingsForm_Load(object sender, EventArgs e)
@@ -130,6 +145,7 @@ protected override void OnHandleCreated(EventArgs e)
130145
{
131146
if (Microsoft.Win32.Registry.GetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize", "AppsUseLightTheme", 1).ToString() == "0")
132147
{
148+
133149
if (DwmSetWindowAttribute(Handle, 19, new[] { 1 }, 4) != 0)
134150
DwmSetWindowAttribute(Handle, 20, new[] { 1 }, 4);
135151
}

0 commit comments

Comments
 (0)