mirror of
https://invent.kde.org/system/dolphin
synced 2024-11-05 18:47:12 +00:00
[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:
parent
eb31ded156
commit
86d2aa321d
2 changed files with 4 additions and 1 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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:
|
||||||
|
|
Loading…
Reference in a new issue