From cd0be6dc5e4741c2ad180d6bf6a275f000ab943a Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Mon, 3 Aug 2026 15:41:16 +0200 Subject: feat: render tags as chips instead of a text column Spelled out per row, tags ran to 500 pixels of largely repeated text and took most of the thread list's width. The column is gone; tags render as coloured chips split by what they actually mean. An account tag says which mailbox a thread arrived in, and draws as a chip in front of the subject. A functional tag says what state a thread is in, and those fill one row under the message pane. One row keeps the message area from shifting between threads with different tag counts, so whatever does not fit collapses into a +N chip that names the rest in its tooltip. TagColors resolves a colour by exact tag first, then by top-level prefix, so a single "shopping" entry covers shopping/amazon and shopping/nike while shopping/amazon can still override its own. That matters at 96 tags. Built-in defaults cover the usual state tags, and anything left unconfigured falls back to a hash of the name, stable so a chip does not change colour as the list scrolls. --- src/messageview.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/messageview.h') diff --git a/src/messageview.h b/src/messageview.h index f3bd96f..9570db5 100644 --- a/src/messageview.h +++ b/src/messageview.h @@ -30,6 +30,8 @@ class QPushButton; class QWebEngineView; class QWebEngineProfile; class CidSchemeHandler; +class TagColors; +class TagStrip; class RequestInterceptor; /// The message pane: thread header, body, attachment bar. @@ -57,6 +59,12 @@ public: void showError(const QString &text, const QString &filePath); void clear(); + /// Supplies the tag strip's colours. Not owned; must outlive the view. + void setTagColors(const TagColors *colours); + + /// Tags of the thread on display, shown as chips along the bottom. + void setTags(const QStringList &tags); + public slots: void toggleHtml(); void loadRemoteContent(); @@ -81,4 +89,5 @@ private: QLabel *m_blockedLabel = nullptr; QPushButton *m_loadRemoteButton = nullptr; QWidget *m_attachmentBar = nullptr; + TagStrip *m_tagStrip = nullptr; }; -- cgit v1.2.3