X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/e8eca7c26671bfc711a782afd85ab387ff2cba53..6dcbb8127c:/src/kitemviews/private/kitemlistviewlayouter.cpp diff --git a/src/kitemviews/private/kitemlistviewlayouter.cpp b/src/kitemviews/private/kitemlistviewlayouter.cpp index 9da5384d4..d54457908 100644 --- a/src/kitemviews/private/kitemlistviewlayouter.cpp +++ b/src/kitemviews/private/kitemlistviewlayouter.cpp @@ -22,7 +22,7 @@ #include #include "kitemlistsizehintresolver.h" -#include +#include "dolphindebug.h" // #define KITEMLISTVIEWLAYOUTER_DEBUG @@ -239,6 +239,7 @@ QRectF KItemListViewLayouter::itemRect(int index) const // to get the physical horizontal direction QPointF pos(y, x); pos.rx() -= m_scrollOffset; + sizeHint.transpose(); return QRectF(pos, sizeHint); } @@ -282,7 +283,9 @@ QRectF KItemListViewLayouter::groupHeaderRect(int index) const break; } - const qreal itemWidth = m_sizeHintResolver->sizeHint(index).width(); + const qreal itemWidth = (m_scrollOrientation == Qt::Vertical) + ? m_sizeHintResolver->sizeHint(index).width() + : m_sizeHintResolver->sizeHint(index).height(); if (itemWidth > headerWidth) { headerWidth = itemWidth; @@ -461,7 +464,7 @@ void KItemListViewLayouter::doLayout() while (index < itemCount && column < m_columnCount) { qreal requiredItemHeight = itemSize.height(); const QSizeF sizeHint = m_sizeHintResolver->sizeHint(index); - const qreal sizeHintHeight = horizontalScrolling ? sizeHint.width() : sizeHint.height(); + const qreal sizeHintHeight = sizeHint.height(); if (sizeHintHeight > requiredItemHeight) { requiredItemHeight = sizeHintHeight; } @@ -513,7 +516,7 @@ void KItemListViewLayouter::doLayout() } #ifdef KITEMLISTVIEWLAYOUTER_DEBUG - kDebug() << "[TIME] doLayout() for " << m_model->count() << "items:" << timer.elapsed(); + qCDebug(DolphinDebug) << "[TIME] doLayout() for " << m_model->count() << "items:" << timer.elapsed(); #endif m_dirty = false; } @@ -618,4 +621,3 @@ qreal KItemListViewLayouter::minimumGroupHeaderWidth() const return 100; } -#include "kitemlistviewlayouter.moc"