mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-05 08:52:36 +00:00
parent
ac757e272a
commit
e2dbef12c7
@ -1167,5 +1167,32 @@ bool MainWindow::eventFilter(QObject* obj, QEvent* event) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (event->type() == QEvent::ApplicationPaletteChange) {
|
||||
if (ui->setThemeSystem->isChecked()) {
|
||||
|
||||
bool isSystemDarkMode;
|
||||
|
||||
#ifdef __linux__
|
||||
const QPalette defaultPalette;
|
||||
const auto text = defaultPalette.color(QPalette::WindowText);
|
||||
const auto window = defaultPalette.color(QPalette::Window);
|
||||
isSystemDarkMode = (text.lightness() > window.lightness());
|
||||
#else
|
||||
isSystemDarkMode =
|
||||
(QGuiApplication::styleHints()->colorScheme() == Qt::ColorScheme::Dark);
|
||||
#endif
|
||||
if (isSystemDarkMode) {
|
||||
if (isIconBlack) {
|
||||
SetUiIcons(false);
|
||||
isIconBlack = false;
|
||||
}
|
||||
} else {
|
||||
if (!isIconBlack) {
|
||||
SetUiIcons(true);
|
||||
isIconBlack = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return QMainWindow::eventFilter(obj, event);
|
||||
}
|
@ -538,7 +538,6 @@ void SettingsDialog::UpdateSettings() {
|
||||
foreach (QWidget* widget, QApplication::topLevelWidgets()) {
|
||||
widget->update();
|
||||
}
|
||||
QCoreApplication::processEvents();
|
||||
}
|
||||
|
||||
void SettingsDialog::ResetInstallFolders() {
|
||||
|
Loading…
Reference in New Issue
Block a user