From 5cb6815bf3e7925089e5336df34250109d330019 Mon Sep 17 00:00:00 2001 From: Megamouse Date: Sat, 2 Sep 2017 03:02:46 +0200 Subject: [PATCH] GUI: Fix Repaint on stylesheet change --- rpcs3/rpcs3_app.cpp | 1 + rpcs3/rpcs3qt/main_window.cpp | 15 +++++++++------ rpcs3/rpcs3qt/main_window.h | 2 ++ 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/rpcs3/rpcs3_app.cpp b/rpcs3/rpcs3_app.cpp index 2c62e7b08d..d180471c2f 100644 --- a/rpcs3/rpcs3_app.cpp +++ b/rpcs3/rpcs3_app.cpp @@ -338,6 +338,7 @@ void rpcs3_app::OnChangeStyleSheetRequest(const QString& sheetFilePath) file.close(); } GUI::stylesheet = styleSheet(); + RPCS3MainWin->RepaintGui(); } /** diff --git a/rpcs3/rpcs3qt/main_window.cpp b/rpcs3/rpcs3qt/main_window.cpp index 7c9a0f2ce0..27d1c24d1d 100644 --- a/rpcs3/rpcs3qt/main_window.cpp +++ b/rpcs3/rpcs3qt/main_window.cpp @@ -1040,6 +1040,14 @@ void main_window::AddRecentAction(const q_string_pair& entry) guiSettings->SetValue(GUI::rg_entries, guiSettings->List2Var(m_rg_entries)); } +void main_window::RepaintGui() +{ + gameListFrame->RepaintIcons(true); + gameListFrame->RepaintToolBarIcons(); + RepaintToolbar(); + RepaintToolBarIcons(); +} + void main_window::RepaintToolbar() { if (guiSettings->GetValue(GUI::m_enableUIColors).toBool()) @@ -1138,12 +1146,7 @@ void main_window::CreateConnects() connect(&dlg, &settings_dialog::GuiSettingsSaveRequest, this, &main_window::SaveWindowState); connect(&dlg, &settings_dialog::GuiSettingsSyncRequest, [=]() {ConfigureGuiFromSettings(true); }); connect(&dlg, &settings_dialog::GuiStylesheetRequest, this, &main_window::RequestGlobalStylesheetChange); - connect(&dlg, &settings_dialog::GuiRepaintRequest, [this](){ - gameListFrame->RepaintIcons(true); - gameListFrame->RepaintToolBarIcons(); - RepaintToolbar(); - RepaintToolBarIcons(); - }); + connect(&dlg, &settings_dialog::GuiRepaintRequest, this, &main_window::RepaintGui); dlg.exec(); }; connect(ui->confCPUAct, &QAction::triggered, [=]() { openSettings(0); }); diff --git a/rpcs3/rpcs3qt/main_window.h b/rpcs3/rpcs3qt/main_window.h index d4efa3f3c0..fca919b29c 100644 --- a/rpcs3/rpcs3qt/main_window.h +++ b/rpcs3/rpcs3qt/main_window.h @@ -73,6 +73,8 @@ public Q_SLOTS: void OnEmuPause(); void OnEmuReady(); + void RepaintGui(); + private Q_SLOTS: void BootElf(); void BootGame();