Qt: use default colors for native styles

This commit is contained in:
Megamouse 2023-12-22 03:25:19 +01:00
parent bc9f0fe56c
commit 50214a6a07
16 changed files with 98 additions and 66 deletions

View file

@ -37,6 +37,7 @@
#include <QMessageBox>
#include <QTextDocument>
#include <QStyleFactory>
#include <QStyleHints>
#include <clocale>
@ -293,6 +294,8 @@ void gui_application::InitializeConnects()
connect(this, &gui_application::OnEmulatorReady, m_main_window, &main_window::OnEmuReady);
connect(this, &gui_application::OnEnableDiscEject, m_main_window, &main_window::OnEnableDiscEject);
connect(this, &gui_application::OnEnableDiscInsert, m_main_window, &main_window::OnEnableDiscInsert);
connect(QGuiApplication::styleHints(), &QStyleHints::colorSchemeChanged, this, [this](){ OnChangeStyleSheetRequest(); });
}
#ifdef WITH_DISCORD_RPC
@ -789,11 +792,13 @@ void gui_application::OnChangeStyleSheetRequest()
};
gui_log.notice("Changing stylesheet to '%s'", stylesheet_name);
gui::custom_stylesheet_active = false;
if (stylesheet_name.isEmpty() || stylesheet_name == gui::DefaultStylesheet)
{
gui_log.notice("Using default stylesheet");
setStyleSheet(gui::stylesheets::default_style_sheet);
gui::custom_stylesheet_active = true;
}
else if (stylesheet_name == gui::NoStylesheet)
{
@ -871,6 +876,8 @@ void gui_application::OnChangeStyleSheetRequest()
gui_log.error("Could not find stylesheet '%s'. Using default.", stylesheet_name);
setStyleSheet(gui::stylesheets::default_style_sheet);
}
gui::custom_stylesheet_active = true;
}
gui::stylesheet = styleSheet();