Manager: Fix style not reacting to Windows light/dark mode change

Add a native event filter for dark mode update, move the function
that queries the current theme to qt_util.cpp and make widgets
with custom stylesheets update their style on update
This commit is contained in:
Alexander Babikov
2025-08-05 20:16:09 +05:00
parent 7bf7d341d4
commit 5de3af3df7
17 changed files with 337 additions and 64 deletions

View File

@@ -116,6 +116,9 @@ VMManagerMainWindow(QWidget *parent)
// Inform the main view when preferences are updated
connect(this, &VMManagerMainWindow::preferencesUpdated, vmm, &VMManagerMain::onPreferencesUpdated);
connect(this, &VMManagerMainWindow::languageUpdated, vmm, &VMManagerMain::onLanguageUpdated);
#ifdef Q_OS_WINDOWS
connect(this, &VMManagerMainWindow::darkModeUpdated, vmm, &VMManagerMain::onDarkModeUpdated);
#endif
}
@@ -178,6 +181,15 @@ VMManagerMainWindow::updateLanguage()
emit languageUpdated();
}
#ifdef Q_OS_WINDOWS
void
VMManagerMainWindow::updateDarkMode()
{
emit darkModeUpdated();
}
#endif
void
VMManagerMainWindow::changeEvent(QEvent *event)
{