┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/dolphintabwidget.cpp2
-rw-r--r--src/selectionmode/backgroundcolorhelper.cpp13
-rw-r--r--src/selectionmode/backgroundcolorhelper.h7
3 files changed, 17 insertions, 5 deletions
diff --git a/src/dolphintabwidget.cpp b/src/dolphintabwidget.cpp
index 32e251f02..9bfd6076a 100644
--- a/src/dolphintabwidget.cpp
+++ b/src/dolphintabwidget.cpp
@@ -23,9 +23,9 @@
DolphinTabWidget::DolphinTabWidget(DolphinNavigatorsWidgetAction *navigatorsWidget, QWidget *parent)
: QTabWidget(parent)
+ , m_dragAndDropHelper{this}
, m_lastViewedTab(nullptr)
, m_navigatorsWidget{navigatorsWidget}
- , m_dragAndDropHelper{this}
{
KAcceleratorManager::setNoAccel(this);
diff --git a/src/selectionmode/backgroundcolorhelper.cpp b/src/selectionmode/backgroundcolorhelper.cpp
index fa3e55ac4..d1a25bace 100644
--- a/src/selectionmode/backgroundcolorhelper.cpp
+++ b/src/selectionmode/backgroundcolorhelper.cpp
@@ -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, qApp, [=]() {
- slotPaletteChanged();
- });
+ qApp->installEventFilter(this);
}
void BackgroundColorHelper::slotPaletteChanged()
diff --git a/src/selectionmode/backgroundcolorhelper.h b/src/selectionmode/backgroundcolorhelper.h
index 3450c8e19..4f8ce81f5 100644
--- a/src/selectionmode/backgroundcolorhelper.h
+++ b/src/selectionmode/backgroundcolorhelper.h
@@ -9,6 +9,7 @@
#define BACKGROUNDCOLORHELPER_H
#include <QColor>
+#include <QObject>
#include <QPointer>
#include <memory>
@@ -21,8 +22,9 @@ namespace SelectionMode
/**
* @brief A Singleton class for managing the colors of selection mode widgets.
*/
-class BackgroundColorHelper
+class BackgroundColorHelper : public QObject
{
+ Q_OBJECT
public:
static BackgroundColorHelper *instance();
@@ -32,6 +34,9 @@ public:
*/
void controlBackgroundColor(QWidget *widget);
+protected:
+ bool eventFilter(QObject *obj, QEvent *event) override;
+
private:
BackgroundColorHelper();