summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllen Winter <winter@kde.org>2012-05-25 16:32:32 (GMT)
committerAllen Winter <winter@kde.org>2012-05-25 16:36:17 (GMT)
commit167f33cf7642b798b72f743c633b06f5fc343aba (patch)
treef5e0bfcce7c32ded5acc1da717991393c83a50b4
parentf03191a0d920c691d2e6a464b46a758ea2944be4 (diff)
Fix the last column width problems.
Yashin, thanks for your work on this. Not resolving the bug yet since we may still want to save/restore column widths. But this patch does improve things. CCBUG: 261957 MERGE: 4.8 (cherry picked from commit 9345245335b5341bff9de06778652338006fc405)
-rw-r--r--akregator/src/articlelistview.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/akregator/src/articlelistview.cpp b/akregator/src/articlelistview.cpp
index bc3a079..5e68c37 100644
--- a/akregator/src/articlelistview.cpp
+++ b/akregator/src/articlelistview.cpp
@@ -275,14 +275,6 @@ void ArticleListView::setGroupMode()
if ( m_columnMode == GroupMode )
return;
- // The next line (used three times in this file) is a workaround for a
- // possible Qt 4.4.3 bug that causes the last column to expand beyond
- // the viewport width. QHeaderViewPrivate::lastSectionSize may not be
- // initialised when QHeaderViewPrivate::resizeSections() is called,
- // doing the resizeSection() here ensures that it has a sensible value.
- // This may not be necessary with Qt 4.5.
- header()->resizeSection( header()->logicalIndex( header()->count() - 1 ), 1 );
-
if ( model() )
m_feedHeaderState = header()->saveState();
m_columnMode = GroupMode;
@@ -294,7 +286,6 @@ void ArticleListView::setFeedMode()
if ( m_columnMode == FeedMode )
return;
- header()->resizeSection( header()->logicalIndex( header()->count() - 1 ), 1 );
if ( model() )
m_groupHeaderState = header()->saveState();
m_columnMode = FeedMode;
@@ -322,10 +313,12 @@ void ArticleListView::restoreHeaderState()
// - hide the feed column in feed mode (no need to see the same feed title over and over)
// - set the date column wide enough to fit all possible dates
header()->setSectionHidden( ArticleModel::FeedTitleColumn, m_columnMode == FeedMode );
+ header()->setStretchLastSection( false );
header()->resizeSection( ArticleModel::DateColumn, maxDateColumnWidth(fontMetrics()) );
}
- header()->setStretchLastSection( false );
+ if ( header()->sectionSize( ArticleModel::DateColumn ) == 1 )
+ header()->resizeSection( ArticleModel::DateColumn, maxDateColumnWidth(fontMetrics()) );
startResizingTitleColumn();
}