[impl] windows implementation of darkmode detector

This commit is contained in:
DuckSoft 2020-03-10 21:38:34 +08:00 committed by Qv2ray-dev
parent 1fafee72b6
commit 692d9229c7

View File

@ -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