mirror of
https://github.com/Qv2ray/Qv2ray.git
synced 2025-05-20 02:40:20 +08:00
[impl] windows implementation of darkmode detector
This commit is contained in:
parent
1fafee72b6
commit
692d9229c7
@ -1,12 +1,15 @@
|
||||
#include "DarkmodeDetector.hpp"
|
||||
#ifdef Q_OS_WIN32
|
||||
#include <QSettings>
|
||||
|
||||
namespace Qv2ray::components::darkmode
|
||||
{
|
||||
// Referenced from github.com/keepassxreboot/keepassxc. Licensed under GPL2/3.
|
||||
// Copyright (C) 2020 KeePassXC Team <team@keepassxc.org>
|
||||
bool detectDarkmode()
|
||||
{
|
||||
// TODO: expand this stub
|
||||
return false;
|
||||
QSettings settings(R"(HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize)", QSettings::NativeFormat);
|
||||
return settings.value("AppsUseLightTheme", 1).toInt() == 0;
|
||||
}
|
||||
} // namespace Qv2ray::components::darkmode
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user