aboutsummaryrefslogtreecommitdiffstats
path: root/src/mainwindow.h
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-08-03 16:33:13 +0200
committerDanilo M. <danix@danix.xyz>2026-08-03 16:33:13 +0200
commitea90e69d5e974960c653e65a5bb9ca1359f2d52c (patch)
tree87410a035212f0e8e5997722662803c17a3320d8 /src/mainwindow.h
parentec390fb46e1a36d8406dde487228bbb0f348a20a (diff)
parent2c33529fb665cb54c31e54230fcb7b2491cf8565 (diff)
downloadqtmaildir-ea90e69d5e974960c653e65a5bb9ca1359f2d52c.tar.gz
qtmaildir-ea90e69d5e974960c653e65a5bb9ca1359f2d52c.zip
Merge branch 'feature/ui-state-persistence'
Persistence cluster from the post-0.1.0 usability backlog: window, splitter and column geometry survive restart, the message pane owns its zoom and remembers it, and the startup query is chosen by name instead of by alphabetical accident. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'src/mainwindow.h')
-rw-r--r--src/mainwindow.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/mainwindow.h b/src/mainwindow.h
index 4445894..f4186ff 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -38,6 +38,7 @@ class QLabel;
class QPushButton;
class QComboBox;
class QPlainTextEdit;
+class QSplitter;
class ThreadListModel;
class MessageView;
@@ -63,6 +64,15 @@ public:
/// cid: references from resolving to another's.
static QString cidPrefixForIndex(int index);
+ /// Path of the machine-written UI state file. Deliberately not
+ /// Config::defaultPath(): the config is hand-edited and must never gain a
+ /// base64 geometry blob, nor be rewritten on exit (QSettings does not
+ /// preserve comments or key order).
+ static QString uiStatePath();
+
+protected:
+ void closeEvent(QCloseEvent *event) override;
+
private slots:
void runCurrentQuery();
void onThreadsReady(const QVector<ThreadSummary> &threads, quint64 generation);
@@ -74,6 +84,12 @@ private slots:
private:
void buildUi();
+
+ /// 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();
void buildMenus();
void wireWorker();
@@ -116,6 +132,7 @@ private:
QLineEdit *m_queryEdit = nullptr;
QTableView *m_threadView = nullptr;
+ QSplitter *m_splitter = nullptr;
QComboBox *m_accountBox = nullptr;
QPushButton *m_syncButton = nullptr;
QLabel *m_statusLabel = nullptr;