┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews/kitemlistheader.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2012-03-25 22:56:13 +0200
committerPeter Penz <[email protected]>2012-03-25 22:58:16 +0200
commite70c2f8aa472c01433f9416c363c698677c5b45f (patch)
tree46ae0ce49bf98749ce3a3d6a4b06e6129a7c706d /src/kitemviews/kitemlistheader.cpp
parent1cbe55b97c3b8fd9265ad6b40ce6cc169d4451c1 (diff)
Details view: Don't reset to automatic resizing when adding columns
Until now when a new column is added in the case where custom column widths are used, the automatic resizing has been turned on again. The patch fixes this so that the current widths stay and the new column gets a proper default width.
Diffstat (limited to 'src/kitemviews/kitemlistheader.cpp')
-rw-r--r--src/kitemviews/kitemlistheader.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/kitemviews/kitemlistheader.cpp b/src/kitemviews/kitemlistheader.cpp
index 9c617840a..be7a09c8f 100644
--- a/src/kitemviews/kitemlistheader.cpp
+++ b/src/kitemviews/kitemlistheader.cpp
@@ -30,7 +30,8 @@ void KItemListHeader::setAutomaticColumnResizing(bool automatic)
if (m_headerWidget->automaticColumnResizing() != automatic) {
m_headerWidget->setAutomaticColumnResizing(automatic);
if (automatic) {
- m_view->resizeColumnWidths();
+ m_view->applyAutomaticColumnWidths();
+ m_view->doLayout(KItemListView::NoAnimation);
}
}
}
@@ -45,6 +46,7 @@ void KItemListHeader::setColumnWidth(const QByteArray& role, qreal width)
if (!m_headerWidget->automaticColumnResizing()) {
m_headerWidget->setColumnWidth(role, width);
m_view->applyColumnWidthsFromHeader();
+ m_view->doLayout(KItemListView::NoAnimation);
}
}
@@ -62,6 +64,7 @@ void KItemListHeader::setColumnWidths(const QHash<QByteArray, qreal>& columnWidt
}
m_view->applyColumnWidthsFromHeader();
+ m_view->doLayout(KItemListView::NoAnimation);
}
}