aboutsummaryrefslogtreecommitdiffstats
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-08-03 14:58:45 +0200
committerDanilo M. <danix@danix.xyz>2026-08-04 12:53:24 +0200
commit9a423ea8fafdea38cfa15ddc3614cc64bc239d7c (patch)
tree31f255d0e3221342e5a8e8bb608edc69d134ffcc /src/mainwindow.cpp
parent85bb759c46aef929beb66613159e4b23fcaf75fb (diff)
downloadqtmaildir-9a423ea8fafdea38cfa15ddc3614cc64bc239d7c.tar.gz
qtmaildir-9a423ea8fafdea38cfa15ddc3614cc64bc239d7c.zip
fix: let the thread list columns be resized again
Tags, Date and From were set to ResizeToContents while fixing the pushed-off-screen Tags column. That mode computes the width itself and discards a drag, so the columns stopped being resizable. Verified: with ResizeToContents a request for 250px yields 150, with Stretch 478, with Interactive 250. The reorder alone already fixed the original bug, since Subject stretches and is last, so nothing can be pushed past it. Locking the other three was unnecessary and also blocked the saved-column-widths item, which needs widths a user can actually set. They are Interactive again, with starting widths a drag overrides.
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 915c1ae..bebe379 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -169,16 +169,21 @@ void MainWindow::buildUi()
m_threadView->setSelectionMode(QAbstractItemView::ExtendedSelection);
m_threadView->verticalHeader()->hide();
m_threadView->horizontalHeader()->setStretchLastSection(false);
- // Subject is the last column and takes the leftover width; the three
- // fixed-width ones size to their contents. Nothing sits to the right of
- // the stretching column, so no column can be pushed out of view.
+ // Subject is last and takes the leftover width, so no column can be
+ // pushed off the right edge. The other three stay Interactive: both
+ // ResizeToContents and Stretch ignore a drag, and the user resizes these.
m_threadView->horizontalHeader()->setSectionResizeMode(
ThreadListModel::SubjectColumn, QHeaderView::Stretch);
for (int column : { ThreadListModel::TagsColumn, ThreadListModel::DateColumn,
ThreadListModel::AuthorsColumn }) {
m_threadView->horizontalHeader()->setSectionResizeMode(
- column, QHeaderView::ResizeToContents);
+ column, QHeaderView::Interactive);
}
+ // Starting widths only; a drag overrides them, and they are what the
+ // saved-widths item will persist.
+ m_threadView->setColumnWidth(ThreadListModel::TagsColumn, 160);
+ m_threadView->setColumnWidth(ThreadListModel::DateColumn, 130);
+ m_threadView->setColumnWidth(ThreadListModel::AuthorsColumn, 180);
connect(m_threadView->selectionModel(),
&QItemSelectionModel::currentRowChanged,