From 6c29a1d98a490e585d0e9d9a4eb4824e72756390 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Wed, 7 Dec 2011 15:30:55 +0100 Subject: Fix icon boundaries issue The size of the icon boundaries should be as minimal as possible. The patch for fixing the zooming-issues with the selection resulted into a minor regression where the icon boundaries might be too large. This patch remembers the original size of the pixmap to be able to scale m_iconRect. --- src/kitemviews/kitemlistwidget.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/kitemviews/kitemlistwidget.cpp') diff --git a/src/kitemviews/kitemlistwidget.cpp b/src/kitemviews/kitemlistwidget.cpp index 687367adb..4934da84f 100644 --- a/src/kitemviews/kitemlistwidget.cpp +++ b/src/kitemviews/kitemlistwidget.cpp @@ -124,7 +124,7 @@ void KItemListWidget::paint(QPainter* painter, const QStyleOptionGraphicsItem* o const QRect iconBounds = iconRect().toRect(); const QRect textBounds = textRect().toRect(); - if (iconBounds.bottom() >= textBounds.top()) { + if (iconBounds.bottom() > textBounds.top()) { viewItemOption.rect = textBounds; } else { // See KItemListWidget::drawItemStyleOption(): The selection rectangle @@ -439,7 +439,7 @@ void KItemListWidget::drawItemStyleOption(QPainter* painter, QWidget* widget, QS viewItemOption.state = styleState; viewItemOption.viewItemPosition = QStyleOptionViewItemV4::OnlyOne; - if (iconBounds.bottom() >= textBounds.top()) { + if (iconBounds.bottom() > textBounds.top()) { viewItemOption.rect = iconBounds | textBounds; widget->style()->drawPrimitive(QStyle::PE_PanelItemViewItem, &viewItemOption, painter, widget); } else { -- cgit v1.3