Fix Bug 334696 - File/directory icons/names move to the right when opening/refreshing contents of Dolphin

Take the scrollbar spacing into account.

BUG: 334696
REVIEW: 118319
FIXED-IN: 4.13.2
This commit is contained in:
Emmanuel Pescosta 2014-05-25 18:30:37 +02:00
parent fb69036dbd
commit 96c34cfe65

View file

@ -1048,11 +1048,17 @@ void KItemListView::slotItemsInserted(const KItemRangeList& itemRanges)
(!verticalScrollOrientation && maximumScrollOffset() > size().width());
if (decreaseLayouterSize) {
const int scrollBarExtent = style()->pixelMetric(QStyle::PM_ScrollBarExtent);
int scrollbarSpacing = 0;
if (style()->styleHint(QStyle::SH_ScrollView_FrameOnlyAroundContents)) {
scrollbarSpacing = style()->pixelMetric(QStyle::PM_ScrollView_ScrollBarSpacing);
}
QSizeF layouterSize = m_layouter->size();
if (verticalScrollOrientation) {
layouterSize.rwidth() -= scrollBarExtent;
layouterSize.rwidth() -= scrollBarExtent + scrollbarSpacing;
} else {
layouterSize.rheight() -= scrollBarExtent;
layouterSize.rheight() -= scrollBarExtent + scrollbarSpacing;
}
m_layouter->setSize(layouterSize);
}