┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews/kfileitemlistwidget.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2011-09-23 19:09:01 +0200
committerPeter Penz <[email protected]>2011-09-23 19:11:05 +0200
commit56852cff392f33ee731129fd9a755544d817e590 (patch)
tree235588444cec355da4093fc405cc8072715a3e15 /src/kitemviews/kfileitemlistwidget.cpp
parentccd92b76e74a00aef0f5186af7d797a63c6b80c6 (diff)
Allow resizing of columns by the user
Still open: - Column content is not clipped correctly - First column is not automatically increased to the available width like in Dolphin 1.7
Diffstat (limited to 'src/kitemviews/kfileitemlistwidget.cpp')
-rw-r--r--src/kitemviews/kfileitemlistwidget.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/kitemviews/kfileitemlistwidget.cpp b/src/kitemviews/kfileitemlistwidget.cpp
index a9193fbc7..49c5db5fd 100644
--- a/src/kitemviews/kfileitemlistwidget.cpp
+++ b/src/kitemviews/kfileitemlistwidget.cpp
@@ -578,7 +578,9 @@ void KFileItemListWidget::updateDetailsLayoutTextCache()
const int scaledIconSize = widgetHeight - 2 * option.margin;
const int fontHeight = option.fontMetrics.height();
- qreal x = m_expansionArea.right() + option.margin * 3 + scaledIconSize;
+ const qreal columnMargin = option.margin * 3;
+ const qreal firstColumnInc = m_expansionArea.right() + option.margin * 2 + scaledIconSize;
+ qreal x = firstColumnInc;
const qreal y = qMax(qreal(option.margin), (widgetHeight - fontHeight) / 2);
foreach (const QByteArray& role, m_sortedVisibleRoles) {
@@ -588,7 +590,7 @@ void KFileItemListWidget::updateDetailsLayoutTextCache()
m_text[textId].setText(text);
const qreal requiredWidth = option.fontMetrics.width(text);
- m_textPos[textId] = QPointF(x, y);
+ m_textPos[textId] = QPointF(x + columnMargin, y);
const qreal columnWidth = visibleRolesSizes().value(role, QSizeF(0, 0)).width();
x += columnWidth;
@@ -596,16 +598,16 @@ void KFileItemListWidget::updateDetailsLayoutTextCache()
switch (textId) {
case Name: {
m_textBoundingRect = QRectF(m_textPos[textId].x() - option.margin, 0,
- requiredWidth + 2 * option.margin, size().height());
+ requiredWidth + 2 * option.margin, size().height());
// The column after the name should always be aligned on the same x-position independent
// from the expansion-level shown in the name column
- x -= m_expansionArea.right();
+ x -= firstColumnInc;
break;
}
case Size:
// The values for the size should be right aligned
- m_textPos[textId].rx() += columnWidth - requiredWidth - 2 * option.margin;
+ m_textPos[textId].rx() += columnWidth - requiredWidth - 2 * columnMargin;
break;
default: