aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-08-03 14:58:45 +0200
committerDanilo M. <danix@danix.xyz>2026-08-03 14:58:45 +0200
commitdf9b3a47f125e65c5610c62a14894c8c7514f954 (patch)
tree31f255d0e3221342e5a8e8bb608edc69d134ffcc
parent1371a3901857a8d2ac4fcf235fb29e7caaf63cae (diff)
downloadqtmaildir-df9b3a47f125e65c5610c62a14894c8c7514f954.tar.gz
qtmaildir-df9b3a47f125e65c5610c62a14894c8c7514f954.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.
-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,