[KStandardItemListWidget] Update icon when palette changes

We can colorize icons based on the user's palette, so clear the pixmap cache when it changes.

Differential Revision: https://phabricator.kde.org/D3937
This commit is contained in:
Kai Uwe Broulik 2017-02-06 19:12:48 +01:00
parent eb31ded156
commit 86d2aa321d
2 changed files with 4 additions and 1 deletions

View file

@ -852,7 +852,8 @@ void KStandardItemListWidget::hideEvent(QHideEvent* event)
bool KStandardItemListWidget::event(QEvent *event) bool KStandardItemListWidget::event(QEvent *event)
{ {
if (event->type() == QEvent::WindowDeactivate || event->type() == QEvent::WindowActivate) { if (event->type() == QEvent::WindowDeactivate || event->type() == QEvent::WindowActivate
|| event->type() == QEvent::PaletteChange) {
m_dirtyContent = true; m_dirtyContent = true;
} }

View file

@ -29,6 +29,7 @@
#include <QGraphicsSceneDragDropEvent> #include <QGraphicsSceneDragDropEvent>
#include <QTimer> #include <QTimer>
#include <QScrollBar> #include <QScrollBar>
#include <QPixmapCache>
#include <QPointer> #include <QPointer>
#include <QMenu> #include <QMenu>
#include <QVBoxLayout> #include <QVBoxLayout>
@ -731,6 +732,7 @@ bool DolphinView::eventFilter(QObject* watched, QEvent* event)
switch (event->type()) { switch (event->type()) {
case QEvent::PaletteChange: case QEvent::PaletteChange:
updatePalette(); updatePalette();
QPixmapCache::clear();
break; break;
case QEvent::KeyPress: case QEvent::KeyPress: