Commit 199dfee4 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Update color when we change theme

parent 02d60acd
Pipeline #158886 passed with stage
in 4 minutes and 55 seconds
......@@ -428,8 +428,9 @@ void SummaryViewPart::initGUI(KontactInterface::Core *core)
mMainWidget->setFocusPolicy(Qt::StrongFocus);
setWidget(sa);
// KF5: port it
// connect(KGlobalSettings::self(), &KGlobalSettings::kdisplayPaletteChanged, this, &SummaryViewPart::slotAdjustPalette);
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
connect(qApp, &QApplication::paletteChanged, this, &SummaryViewPart::slotAdjustPalette);
#endif
slotAdjustPalette();
mMainLayout = new QVBoxLayout(mMainWidget);
......@@ -506,3 +507,13 @@ QString SummaryViewPart::widgetName(QWidget *widget) const
return {};
}
bool SummaryViewPart::event(QEvent *e)
{
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
if (e->type() == QEvent::ApplicationPaletteChange) {
slotAdjustPalette();
}
#endif
return KParts::Part::event(e);
}
......@@ -49,6 +49,7 @@ Q_SIGNALS:
protected:
void partActivateEvent(KParts::PartActivateEvent *event) override;
bool event(QEvent *e) override;
protected Q_SLOTS:
void slotConfigure();
void updateWidgets();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment