aboutsummaryrefslogtreecommitdiffstats
path: root/src/composewindow.h
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-08-24 11:47:52 +0200
committerDanilo M. <danix@danix.xyz>2026-08-24 11:47:52 +0200
commita4e8c837a07014be3863a40f371d02a492b7efb7 (patch)
treecc045386b83015c348b982cf46947d63ca2211cb /src/composewindow.h
parent55fe1bca09242220e514394acbddb53be796fe40 (diff)
downloadqtmaildir-a4e8c837a07014be3863a40f371d02a492b7efb7.tar.gz
qtmaildir-a4e8c837a07014be3863a40f371d02a492b7efb7.zip
feat(compose): lay the composer out by scope
Items 142, 143, 144 and 145, to the layout the user described. The composer had one addToolBar carrying three scopes at once: text formatting, message composition, and the terminal action. It read as a menu bar that is not one. There is now no window toolbar at all. From: [.............] +--------+ To: [.........] [v Cc/Bcc] | Send | Subject: [...........................] + [B][I][</>][S][link]["] [Attach] [Send as HTML] +---------------------------------------------+ | message text | +---------------------------------------------+ [Remove] * report.pdf <- only when attached Send is a large icon-above-text button beside the headers: it is the terminal action and carries the weight to match. Formatting is a toolbar widget in the central column directly above the text it formats, icon-only with the words kept as tooltips, which is where a tooltip stops being decoration. Attach and the HTML toggle ride the right end of that bar, past a stretch, because neither formats text. Remove attachment sits with the list it acts on and appears only once something is attached. "Also send a formatted copy" becomes "Send as HTML": the old label described a mechanism without naming it, leaving the reader to infer that "formatted" meant HTML and that "copy" meant a MIME part rather than a second message. Cc and Bcc hide behind a disclosure beside To:. revealCcBccIfUsed() only ever shows, never hides, so nothing but the user's own click can make a field holding an address invisible: a hidden recipient is a message going somewhere the sender cannot see, which is worse than the clutter this removes. The label is hidden with each field, since a QFormLayout holds the two as separate items and hiding the line edit alone strands a "Cc:" over empty space. Two send-lock faults, one predicted and one not. The backlog warned that setInputsEnabled() disabled the single toolbar wholesale, so the send-path test was strengthened to name every control BEFORE the split; it then caught Attach live during a countdown, where a file appended after MessageBuilder has run is either dropped or added to bytes already sent, silently either way. With every control named it failed again on format_bold: disabling a QToolBar greys its buttons but leaves each QAction enabled, so Ctrl+B during a send would have edited a message already being built, through a button that looked unavailable. setInputsEnabled() now walks the bar's actions too. The Italian translation is refreshed; lrelease reports 477 finished, 0 unfinished.
Diffstat (limited to 'src/composewindow.h')
-rw-r--r--src/composewindow.h23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/composewindow.h b/src/composewindow.h
index af50be6..c44fcda 100644
--- a/src/composewindow.h
+++ b/src/composewindow.h
@@ -19,6 +19,8 @@
#pragma once
#include <QMainWindow>
+
+#include <functional>
#include <QStringList>
#include <memory>
@@ -38,6 +40,8 @@ class QListWidget;
class QPlainTextEdit;
class QTimer;
class QToolBar;
+class QAbstractButton;
+class QToolButton;
class QTemporaryDir;
class QWidget;
@@ -117,6 +121,15 @@ public:
/// server, which this application cannot know, so the user decides.
void attachFile(const QString &path);
+ /// Shows Cc and Bcc when either already carries a value, and leaves them
+ /// shown. Called after seeding and after a draft is loaded.
+ ///
+ /// The load-bearing half of item 145: a hidden field holding an address is
+ /// a message going somewhere the sender cannot see, which is worse than
+ /// the clutter the disclosure removes. Never hides: only the user's own
+ /// click does that.
+ void revealCcBccIfUsed();
+
/// A byte count as a figure a person reads.
///
/// Static and public so the formatting is testable without a modal. The
@@ -200,12 +213,20 @@ private:
std::unique_ptr<QTemporaryDir> m_forwardedParts;
QLineEdit *m_to = nullptr;
+ QWidget *m_attachmentRow = nullptr;
+ QToolButton *m_detachButton = nullptr;
+ int m_editorBarIndex = -1;
+ std::function<void(bool)> m_setCcBccVisible;
+ QWidget *m_ccRow = nullptr;
+ QWidget *m_bccRow = nullptr;
+ QToolButton *m_ccBccDisclosure = nullptr;
+ QToolButton *m_sendButton = nullptr;
QLineEdit *m_cc = nullptr;
QLineEdit *m_bcc = nullptr;
QLineEdit *m_subject = nullptr;
QComboBox *m_from = nullptr;
QPlainTextEdit *m_body = nullptr;
- QCheckBox *m_sendHtml = nullptr;
+ QToolButton *m_sendHtml = nullptr;
QLabel *m_banner = nullptr;
QListWidget *m_attachmentList = nullptr;
QWidget *m_sendLogPane = nullptr;