From e70c2f8aa472c01433f9416c363c698677c5b45f Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sun, 25 Mar 2012 22:56:13 +0200 Subject: 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. --- src/kitemviews/kitemlistheader.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/kitemviews/kitemlistheader.cpp') 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& columnWidt } m_view->applyColumnWidthsFromHeader(); + m_view->doLayout(KItemListView::NoAnimation); } } -- cgit v1.3