]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/selectionmode/backgroundcolorhelper.cpp
SVN_SILENT made messages (.desktop file) - always resolve ours
[dolphin.git] / src / selectionmode / backgroundcolorhelper.cpp
index 74f5bda1a9c23c41774dd4cb364b84adffe892aa..42ccb64bd32d496b5dd2f10d406b621bf38d799d 100644 (file)
@@ -43,12 +43,19 @@ void BackgroundColorHelper::controlBackgroundColor(QWidget *widget)
     m_colorControlledWidgets.emplace_back(widget);
 }
 
+bool BackgroundColorHelper::eventFilter(QObject *obj, QEvent *event)
+{
+    Q_UNUSED(obj);
+    if (event->type() == QEvent::ApplicationPaletteChange) {
+        slotPaletteChanged();
+    }
+    return false;
+}
+
 BackgroundColorHelper::BackgroundColorHelper()
 {
     updateBackgroundColor();
-    QObject::connect(qApp, &QGuiApplication::paletteChanged, [=]() {
-        slotPaletteChanged();
-    });
+    qApp->installEventFilter(this);
 }
 
 void BackgroundColorHelper::slotPaletteChanged()
@@ -92,3 +99,5 @@ void BackgroundColorHelper::updateBackgroundColor()
 }
 
 BackgroundColorHelper *BackgroundColorHelper::s_instance = nullptr;
+
+#include "moc_backgroundcolorhelper.cpp"