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

@@ -349,7 +349,7 @@ illegal_chars:
});
// Initial default details view
vm_details = new VMManagerDetails();
vm_details = new VMManagerDetails(ui->detailsArea);
ui->detailsArea->layout()->addWidget(vm_details);
const QItemSelectionModel *selection_model = ui->listView->selectionModel();
@@ -785,6 +785,14 @@ VMManagerMain::onLanguageUpdated()
vm_details->updateData(selected_sysconfig);
}
#ifdef Q_OS_WINDOWS
void
VMManagerMain::onDarkModeUpdated()
{
vm_details->updateStyle();
}
#endif
int
VMManagerMain::getActiveMachineCount()
{