Commit 43e91521 authored by Eugene Popov's avatar Eugene Popov 🇺🇦 Committed by Felix Ernst
Browse files

Revert "[DetailsView] Improve zooming"

This reverts commit 7908aff3.

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
parent 9d08bb5b
Pipeline #132293 skipped
......@@ -226,22 +226,8 @@ void KStandardItemListWidgetInformant::calculateCompactLayoutItemSizeHints(QVect
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;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment