mirror of
https://invent.kde.org/system/dolphin
synced 2024-11-05 18:47:12 +00:00
Don't let KItemListView decide itself whether to show the header
The header should be turned on or off by the user of the KItemListView classes.
This commit is contained in:
parent
8d44ebc148
commit
0ebf2d1fe0
2 changed files with 17 additions and 12 deletions
|
@ -148,7 +148,6 @@ void KItemListView::setItemSize(const QSizeF& itemSize)
|
|||
m_layouter->setItemSize(itemSize);
|
||||
}
|
||||
}
|
||||
setHeaderShown(emptySize);
|
||||
|
||||
m_sizeHintResolver->clearCache();
|
||||
updateLayout();
|
||||
|
@ -1460,7 +1459,7 @@ void KItemListView::updateVisibleRolesSizes(const KItemRangeList& itemRanges)
|
|||
|
||||
if (itemCount == rangesItemCount) {
|
||||
m_visibleRolesSizes = visibleRolesSizes(itemRanges);
|
||||
|
||||
if (m_header) {
|
||||
// Assure the the sizes are not smaller than the minimum defined by the header
|
||||
// TODO: Currently only implemented for a top-aligned header
|
||||
const qreal minHeaderRoleWidth = m_header->minimumRoleWidth();
|
||||
|
@ -1473,6 +1472,7 @@ void KItemListView::updateVisibleRolesSizes(const KItemRangeList& itemRanges)
|
|||
m_visibleRolesSizes.insert(it.key(), newSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Only a sub range of the roles need to be determined.
|
||||
// The chances are good that the sizes of the sub ranges
|
||||
|
|
|
@ -189,11 +189,16 @@ void DolphinItemListContainer::setItemLayout(KFileItemListView::Layout layout)
|
|||
|
||||
switch (layout) {
|
||||
case KFileItemListView::IconsLayout:
|
||||
m_fileItemListView->setScrollOrientation(Qt::Vertical);
|
||||
m_fileItemListView->setHeaderShown(false);
|
||||
break;
|
||||
case KFileItemListView::DetailsLayout:
|
||||
m_fileItemListView->setScrollOrientation(Qt::Vertical);
|
||||
m_fileItemListView->setHeaderShown(true);
|
||||
break;
|
||||
case KFileItemListView::CompactLayout:
|
||||
m_fileItemListView->setScrollOrientation(Qt::Horizontal);
|
||||
m_fileItemListView->setHeaderShown(false);
|
||||
break;
|
||||
default:
|
||||
Q_ASSERT(false);
|
||||
|
|
Loading…
Reference in a new issue