mirror of
https://invent.kde.org/system/dolphin
synced 2024-10-05 16:19:10 +00:00
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:
parent
fb69036dbd
commit
96c34cfe65
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue