Never stretch the last (=date) column in the file dialog.
authorAndreas Hartmetz <ahartmetz@gmail.com>
Sat, 12 Nov 2016 17:42:08 +0000 (18:42 +0100)
committerMaximiliano Curia <maxy@debian.org>
Wed, 5 Apr 2017 08:10:59 +0000 (09:10 +0100)
Stretching the date column makes it appear to need the excessive
width when adding up non-name column widths in expandNameColumn().
The name column consequently became too narrow.
Now why could the date column expand if the names needed a lot of
space? It probably has something to do with expandNameColumn()
being called several times while the directory model is loading
and the exact order in which things are updated. Needs a more
detailed analysis if this change causes a regression or still
doesn't completely fix the problem.

BUG: 312747

Gbp-Pq: Name Never-stretch-the-last-date-column-in-the-file-dialog.patch

src/filewidgets/kdiroperatordetailview.cpp

index 247f97c3289d93fa9c08da4838049cbdd7be0fe9..491aea57846ccd9b9580becd5cc53eb420c32a4c 100644 (file)
@@ -91,7 +91,6 @@ bool KDirOperatorDetailView::setViewMode(KFile::FileView viewMode)
     // using KDirOperator in horizontally limited parts of an app.
     if (tree && m_hideDetailColumns) {
         header()->setSectionResizeMode(QHeaderView::ResizeToContents);
-        header()->setStretchLastSection(false);
     }
 
     return true;
@@ -102,7 +101,7 @@ bool KDirOperatorDetailView::event(QEvent *event)
     if (event->type() == QEvent::Polish) {
         QHeaderView *headerView = header();
         headerView->setSectionResizeMode(QHeaderView::Interactive);
-        headerView->setStretchLastSection(true);
+        headerView->setStretchLastSection(false);
         headerView->setSectionsMovable(false);
 
         setColumnHidden(KDirModel::Size, m_hideDetailColumns);