mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-18 21:05:19 +00:00
Qt: use default colors for native styles
This commit is contained in:
parent
bc9f0fe56c
commit
50214a6a07
16 changed files with 98 additions and 66 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue