This reverts commit
7908aff3b5ebe4484d391c1fc4797e9dae2300b2.
Reverting this commit will fix the issue of not being able to rename
the last file in Details View and will also make the items in Details
View and Compact View have the same height.
BUG: 447215
FIXED-IN: 21.12.2
void KStandardItemListWidgetInformant::calculateDetailsLayoutItemSizeHints(QVector<qreal>& logicalHeightHints, qreal& logicalWidthHint, const KItemListView* view) const
{
const KItemListStyleOption& option = view->styleOption();
void KStandardItemListWidgetInformant::calculateDetailsLayoutItemSizeHints(QVector<qreal>& logicalHeightHints, qreal& logicalWidthHint, const KItemListView* view) const
{
const KItemListStyleOption& option = view->styleOption();
-
- float zoomLevel = 1;
- if (option.iconSize >= KIconLoader::SizeEnormous) {
- zoomLevel = 2;
- } else if (option.iconSize >= KIconLoader::SizeHuge) {
- zoomLevel = 1.8;
- } else if (option.iconSize >= KIconLoader::SizeLarge) {
- zoomLevel = 1.6;
- } else if (option.iconSize >= KIconLoader::SizeMedium) {
- zoomLevel = 1.4;
- } else if (option.iconSize >= KIconLoader::SizeSmallMedium) {
- zoomLevel = 1.2;
- }
-
- const qreal contentHeight = qMax<qreal>(option.iconSize, zoomLevel * option.fontMetrics.height());
- logicalHeightHints.fill(contentHeight + 2 * option.padding);
+ const qreal height = option.padding * 2 + qMax(option.iconSize, option.fontMetrics.height());
+ logicalHeightHints.fill(height);
logicalWidthHint = -1.0;
}
logicalWidthHint = -1.0;
}