]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/kitemlistgroupheader.cpp
Merge branch 'release/22.04'
[dolphin.git] / src / kitemviews / kitemlistgroupheader.cpp
index 80dd94149b6bea2b62cc15ce8f11e314ee0806f6..f0ff52503de4313ef8b372cc346fbd9b3c109733 100644 (file)
@@ -161,6 +161,7 @@ void KItemListGroupHeader::resizeEvent(QGraphicsSceneResizeEvent* event)
     if (event->oldSize().height() != event->newSize().height()) {
         m_dirtyCache = true;
     }
+    updateSize();
 }
 
 void KItemListGroupHeader::updateCache()
@@ -174,6 +175,13 @@ void KItemListGroupHeader::updateCache()
     m_separatorColor = mixedColor(c1, c2, 10);
     m_roleColor = mixedColor(c1, c2, 60);
 
+    updateSize();
+
+    m_dirtyCache = false;
+}
+
+void KItemListGroupHeader::updateSize()
+{
     const int padding = qMax(1, m_styleOption.padding);
     const int horizontalMargin = qMax(2, m_styleOption.horizontalMargin);
 
@@ -187,7 +195,7 @@ void KItemListGroupHeader::updateCache()
                           size().width() - 2 * padding - horizontalMargin,
                           roleHeight);
 
-    m_dirtyCache = false;
+    update();
 }
 
 QColor KItemListGroupHeader::mixedColor(const QColor& c1, const QColor& c2, int c1Percent)