┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Uwe Broulik <[email protected]>2023-08-17 12:57:26 +0200
committerKai Uwe Broulik <[email protected]>2023-08-20 20:08:58 +0000
commit21cd9da8fd128723d73745606724f6f77625aac0 (patch)
treec8ac503c953875e3c1094462818e7b3a81fae33f
parentb7e859827d405ff15b6039f35cefa869868d2733 (diff)
KItemListView: Use own palette rather than go hunt for the scene
Documentation for `QGraphicsWidget::palette` says: > When a widget's palette changes, it resolves its entries against its > parent widget, or if it doesn't have a parent widget, it resolves against the scene. So I don't see why we would need to do that ourselves. More importantly, though, it seems in Qt 6 the palette isn't updated in time, so when changing color schemes, Dolphin picks the old color instead of the new one, leading to illegible font when e.g. switching between Breeze Light and Dark.
-rw-r--r--src/kitemviews/kitemlistview.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/kitemviews/kitemlistview.cpp b/src/kitemviews/kitemlistview.cpp
index 7a3cbbcb6..6c60ed648 100644
--- a/src/kitemviews/kitemlistview.cpp
+++ b/src/kitemviews/kitemlistview.cpp
@@ -1034,12 +1034,9 @@ void KItemListView::updateFont()
void KItemListView::updatePalette()
{
- if (scene() && !scene()->views().isEmpty()) {
- KItemListStyleOption option = styleOption();
- option.palette = scene()->views().first()->palette();
-
- setStyleOption(option);
- }
+ KItemListStyleOption option = styleOption();
+ option.palette = palette();
+ setStyleOption(option);
}
void KItemListView::slotItemsInserted(const KItemRangeList &itemRanges)