mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2026-01-06 03:29:55 -06:00
Respect system colour scheme for title bar colour (#109)
This commit is contained in:
6
UnleashedRecomp/os/linux/user_linux.cpp
Normal file
6
UnleashedRecomp/os/linux/user_linux.cpp
Normal file
@@ -0,0 +1,6 @@
|
||||
#include <os/user_detail.h>
|
||||
|
||||
bool os::user::detail::IsDarkTheme()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
7
UnleashedRecomp/os/user.cpp
Normal file
7
UnleashedRecomp/os/user.cpp
Normal file
@@ -0,0 +1,7 @@
|
||||
#include <os/user.h>
|
||||
#include <os/user_detail.h>
|
||||
|
||||
bool os::user::IsDarkTheme()
|
||||
{
|
||||
return detail::IsDarkTheme();
|
||||
}
|
||||
6
UnleashedRecomp/os/user.h
Normal file
6
UnleashedRecomp/os/user.h
Normal file
@@ -0,0 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
namespace os::user
|
||||
{
|
||||
bool IsDarkTheme();
|
||||
}
|
||||
6
UnleashedRecomp/os/user_detail.h
Normal file
6
UnleashedRecomp/os/user_detail.h
Normal file
@@ -0,0 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
namespace os::user::detail
|
||||
{
|
||||
bool IsDarkTheme();
|
||||
}
|
||||
23
UnleashedRecomp/os/win32/user_win32.cpp
Normal file
23
UnleashedRecomp/os/win32/user_win32.cpp
Normal file
@@ -0,0 +1,23 @@
|
||||
#include <os/user_detail.h>
|
||||
|
||||
bool os::user::detail::IsDarkTheme()
|
||||
{
|
||||
HKEY hKey;
|
||||
|
||||
if (RegOpenKeyExA(HKEY_CURRENT_USER, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize", 0, KEY_READ, &hKey) == ERROR_SUCCESS)
|
||||
{
|
||||
DWORD value = 0;
|
||||
DWORD valueSize = sizeof(value);
|
||||
|
||||
if (RegQueryValueExA(hKey, "AppsUseLightTheme", nullptr, nullptr, (LPBYTE)&value, &valueSize) == ERROR_SUCCESS)
|
||||
{
|
||||
RegCloseKey(hKey);
|
||||
|
||||
return value == 0;
|
||||
}
|
||||
|
||||
RegCloseKey(hKey);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
Reference in New Issue
Block a user