[DolphinView] Use correct color group

Use the inactive color group when the window is inactive and update when window state changes.

CCBUG: 404053

Differential Revision: https://phabricator.kde.org/D18811
This commit is contained in:
Kai Uwe Broulik 2019-02-08 09:01:38 +01:00
parent bf44548ad1
commit 585cc994e6

View file

@ -711,7 +711,7 @@ void DolphinView::stopLoading()
void DolphinView::updatePalette()
{
QColor color = KColorScheme(QPalette::Active, KColorScheme::View).background().color();
QColor color = KColorScheme(isActiveWindow() ? QPalette::Active : QPalette::Inactive, KColorScheme::View).background().color();
if (!m_active) {
color.setAlpha(150);
}
@ -740,6 +740,11 @@ bool DolphinView::eventFilter(QObject* watched, QEvent* event)
QPixmapCache::clear();
break;
case QEvent::WindowActivate:
case QEvent::WindowDeactivate:
updatePalette();
break;
case QEvent::KeyPress:
if (GeneralSettings::useTabForSwitchingSplitView()) {
QKeyEvent* keyEvent = static_cast<QKeyEvent*>(event);