mirror of
https://github.com/86Box/86Box.git
synced 2026-02-23 09:58:19 -07:00
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:
@@ -18,13 +18,10 @@
|
||||
|
||||
#include <QApplication>
|
||||
|
||||
#include "qt_util.hpp"
|
||||
#include "qt_vmmanager_listviewdelegate.hpp"
|
||||
#include "qt_vmmanager_model.hpp"
|
||||
|
||||
#ifdef Q_OS_WINDOWS
|
||||
extern bool windows_is_light_theme();
|
||||
#endif
|
||||
|
||||
|
||||
// Thanks to scopchanov https://github.com/scopchanov/SO-MessageLog
|
||||
// from https://stackoverflow.com/questions/53105343/is-it-possible-to-add-a-custom-widget-into-a-qlistview
|
||||
@@ -52,7 +49,7 @@ void VMManagerListViewDelegate::paint(QPainter *painter, const QStyleOptionViewI
|
||||
const QModelIndex &index) const {
|
||||
bool windows_light_mode = true;
|
||||
#ifdef Q_OS_WINDOWS
|
||||
windows_light_mode = windows_is_light_theme();
|
||||
windows_light_mode = util::isWindowsLightTheme();
|
||||
#endif
|
||||
QStyleOptionViewItem opt(option);
|
||||
initStyleOption(&opt, index);
|
||||
|
||||
Reference in New Issue
Block a user