diff options
| author | Danilo M. <danix@danix.xyz> | 2026-08-28 19:00:59 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-08-28 19:00:59 +0200 |
| commit | ae74237ca11640ceb68887b2c6d09ecf1befb342 (patch) | |
| tree | 6ae37c5ed27eeb27c55a17febe16d03fa3553503 /src/messageview.h | |
| parent | 46acb489691e5298181ce52bfe847889ee06fe68 (diff) | |
| download | qtmaildir-ae74237ca11640ceb68887b2c6d09ecf1befb342.tar.gz qtmaildir-ae74237ca11640ceb68887b2c6d09ecf1befb342.zip | |
feat: show the dashboard when a conversation is selected
A thread row has no message to render, so the pane shows the conversation
instead. A thread of one message still opens its message on one click, and
the automatic mark-read is not armed for a row that displays nothing.
Diffstat (limited to 'src/messageview.h')
| -rw-r--r-- | src/messageview.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/messageview.h b/src/messageview.h index c81a4f6..10b9430 100644 --- a/src/messageview.h +++ b/src/messageview.h @@ -29,10 +29,13 @@ #include "marks.h" #include "mimeparser.h" #include "searchterm.h" +#include "threaddigest.h" class QLabel; class QMenu; +class QStackedWidget; class QToolBar; +class ThreadDashboard; class QWebEnginePage; class QPushButton; class QWebEngineView; @@ -123,6 +126,29 @@ public: /// re-render it with fresh counts without guessing what is on screen. bool showingPlaceholder() const { return m_showingPlaceholder; } + /// Shows the conversation dashboard instead of a message (item 177). + /// + /// A thread row stands for the conversation, so there is no single message + /// to render. The heading, account and tags come from the summary and are + /// set separately: the digest is built from the index by the worker and + /// carries none of them. + void showDashboard(const ThreadDigest &digest); + + /// The heading the dashboard displays. Separate from showDashboard() + /// because the summary is known at selection time and the digest arrives + /// afterwards, so the pane can be right before the round trip returns. + void setDashboardThread(const QString &subject, const QString &accountLabel, + const QStringList &tags); + + /// True while the dashboard is what the pane is showing. + /// + /// The pane's content is asserted through this and through the dashboard's + /// own accessors, never by rendering: see "Rendering probes lie". + bool showingDashboard() const; + + /// The dashboard itself, so the window can connect its signals. Never null. + ThreadDashboard *dashboard() const { return m_dashboard; } + /// Supplies the tag strip's colours. Not owned; must outlive the view. void setTagColors(const TagColors *colours); @@ -410,6 +436,17 @@ private: /// Gates queryRequested(), so a link in a message body cannot run a query. bool m_showingPlaceholder = false; + /// The two things this pane can be: a message, or the conversation it + /// belongs to. A stack rather than show/hide over eight widgets, so + /// switching cannot leave half of one pane visible behind the other. + QStackedWidget *m_stack = nullptr; + QWidget *m_messagePage = nullptr; + ThreadDashboard *m_dashboard = nullptr; + + /// Puts the message page back on top. Every route that renders a message + /// passes through it, so the dashboard cannot survive into a message. + void showMessagePage(); + QWebEngineProfile *m_profile = nullptr; QWebEngineView *m_view = nullptr; RequestInterceptor *m_interceptor = nullptr; |
