[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kio] src/filewidgets: Never stretch the last (=date) column in the file dialog.
From:       Andreas Hartmetz <ahartmetz () gmail ! com>
Date:       2016-11-12 18:22:07
Message-ID: E1c5cwJ-0006PS-IE () code ! kde ! org
[Download RAW message or body]

Git commit 9a997fba312f4d9596cc880685ec1e28deb7a665 by Andreas Hartmetz.
Committed on 12/11/2016 at 18:19.
Pushed by ahartmetz into branch 'master'.

Never stretch the last (=date) column in the file dialog.

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

M  +1    -2    src/filewidgets/kdiroperatordetailview.cpp

http://commits.kde.org/kio/9a997fba312f4d9596cc880685ec1e28deb7a665

diff --git a/src/filewidgets/kdiroperatordetailview.cpp b/src/filewidgets/kdiroperatordetailview.cpp
index e6becae..f1015b3 100644
--- a/src/filewidgets/kdiroperatordetailview.cpp
+++ b/src/filewidgets/kdiroperatordetailview.cpp
@@ -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);

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic