Qt/Windows: Match system color scheme.
Use windowsvista style for light, dark fusion scheme for dark.
This commit is contained in:
parent
cfabbd7f97
commit
c9b90655bd
@ -6,6 +6,7 @@
|
||||
#include <clocale>
|
||||
#include <qnamespace.h>
|
||||
#include <QStyle>
|
||||
#include <QStyleHints>
|
||||
|
||||
#ifndef _WIN32
|
||||
#include <csignal>
|
||||
@ -27,6 +28,8 @@ int main(int argc, char *argv[])
|
||||
QGuiApplication::setDesktopFileName("snes9x-gtk");
|
||||
|
||||
if (emu.qtapp->platformName() == "windows")
|
||||
{
|
||||
if (emu.qtapp->styleHints()->colorScheme() == Qt::ColorScheme::Dark)
|
||||
{
|
||||
emu.qtapp->setStyle("fusion");
|
||||
|
||||
@ -58,6 +61,11 @@ int main(int argc, char *argv[])
|
||||
darkPalette.setColor(QPalette::Disabled, QPalette::Light, darkGray);
|
||||
emu.qtapp->setPalette(darkPalette);
|
||||
}
|
||||
else
|
||||
{
|
||||
emu.qtapp->setStyle("windowsvista");
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef _WIN32
|
||||
auto quit_handler = [](int) { QApplication::quit(); };
|
||||
|
Loading…
Reference in New Issue
Block a user