aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mainwindow.cpp11
-rw-r--r--src/mainwindow.h8
2 files changed, 19 insertions, 0 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index cb02652..11de1d4 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -585,6 +585,17 @@ void MainWindow::buildUi()
m_splitter->addWidget(m_threadView);
m_splitter->addWidget(m_messageView);
m_splitter->setStretchFactor(1, 2);
+ // A splitter position is saved in PIXELS, so one saved in a wide window
+ // does not fit a narrower one: QSplitter restores the first pane's size
+ // verbatim and gives the second whatever is left. A real 1285/1252 split
+ // restored into a 1136px window left the message pane 29px wide, a sliver
+ // of rendered mail beside a full-width thread list. A floor on the pane
+ // covers that and the equivalent drag, and needs no restore-time repair.
+ // Only the message pane: a minimum on the thread view as well would leave
+ // a narrow window unable to satisfy either, the same fault from the other
+ // side.
+ m_splitter->setCollapsible(1, false);
+ m_messageView->setMinimumWidth(kMinMessagePaneWidth);
layout->addWidget(m_splitter, 1);
layout->addWidget(m_syncLogPane);
diff --git a/src/mainwindow.h b/src/mainwindow.h
index 490467f..d8401a3 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -211,6 +211,7 @@ private:
/// Restores window geometry, splitter and thread-list header widths.
/// A missing or rejected blob leaves the buildUi() defaults in place.
void restoreUiState();
+
void saveUiState() const;
void registerActions();
@@ -415,6 +416,13 @@ private:
/// menu bar does.
QMenu *m_threadContextMenu = nullptr;
QSplitter *m_splitter = nullptr;
+
+ /// Below this the message pane shows a sliver of a rendered mail and is
+ /// not worth the space it occupies. This is a floor, reached only when a
+ /// restored position does not fit, so it is set at the width mail is
+ /// readable at rather than the width it is merely visible at: at 200 the
+ /// placeholder's own text wraps every couple of words.
+ static constexpr int kMinMessagePaneWidth = 300;
QComboBox *m_accountBox = nullptr;
QLabel *m_statusLabel = nullptr;