diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/mainwindow.cpp | 23 | ||||
| -rw-r--r-- | src/messageview.cpp | 15 | ||||
| -rw-r--r-- | src/messageview.h | 3 |
3 files changed, 31 insertions, 10 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index fd59f47..5cb1ab8 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1970,10 +1970,13 @@ void MainWindow::buildMenus() const int iconSize = m_config.toolbarIconSize(); toolBar->setIconSize(QSize(iconSize, iconSize)); - // Compose, Reply and Forward are NOT here (item 140). They act on a - // message, where everything below acts on the list or on the selection, - // and mixing the two is what made this toolbar read as the place for - // everything. They live on the message pane's own bar instead. + // Compose stays here, and Reply and Forward do not (item 140). The split + // is what the action NEEDS: composing a new message requires no message at + // all, so it belongs with the window-wide operations, while Reply and + // Forward act on whatever the pane is showing and live on its own bar. + toolBar->addAction(m_actions.value(QStringLiteral("compose"))); + toolBar->addSeparator(); + QAction *syncAction = m_actions.value(QStringLiteral("sync")); // Carried over from the QPushButton this replaced: with no command // configured the control is disabled, and the tooltip is the only thing @@ -1997,11 +2000,17 @@ void MainWindow::populateMessageBar() // The window's own QActions, shown a second time rather than copied: a // duplicate QAction would need its own enablement and would drift from the // menu entry that updateComposeActions() keeps in step. + // Reply and Forward only: Compose needs no message and sits on the main + // toolbar with the other window-wide actions. + // + // Slightly smaller than the main toolbar's icons, deriving from the + // configured size rather than hardcoding one, so the bar stays subordinate + // to the chrome above it however the user sets that key. + const int iconSize = qMax(16, (m_config.toolbarIconSize() * 7) / 8); m_messageView->setBarActions( - { m_actions.value(QStringLiteral("compose")), - m_actions.value(QStringLiteral("reply")), + { m_actions.value(QStringLiteral("reply")), m_actions.value(QStringLiteral("forward")) }, - { m_actions.value(QStringLiteral("toggle_html")) }); + { m_actions.value(QStringLiteral("toggle_html")) }, iconSize); } void MainWindow::showShortcutReference() diff --git a/src/messageview.cpp b/src/messageview.cpp index c8395f1..4c2a9d0 100644 --- a/src/messageview.cpp +++ b/src/messageview.cpp @@ -342,6 +342,7 @@ MessageView::MessageView(QWidget *parent) qApp->installEventFilter(this); m_headerLabel = new QLabel(this); + m_headerLabel->setObjectName(QStringLiteral("messageHeader")); m_headerLabel->setTextFormat(Qt::RichText); m_headerLabel->setWordWrap(true); m_headerLabel->setTextInteractionFlags(Qt::TextSelectableByMouse); @@ -470,13 +471,20 @@ MessageView::MessageView(QWidget *parent) style()->styleHint(QStyle::SH_ToolButtonStyle, nullptr, m_messageBar))); m_messageBar->setMovable(false); m_messageBar->hide(); + // Set by MainWindow, which owns the configured size this is derived from. + // Left at the style's own default until then, which is what a MessageView + // built on its own in a test gets. auto *layout = new QVBoxLayout(this); - layout->addWidget(m_messageBar); layout->addLayout(headerRow); layout->addWidget(m_blockedBar); layout->addWidget(m_receiveOnlyRibbon); layout->addWidget(m_staleBar); + // Directly above the message it acts on, below the subject and details + // rows: the bar belongs to the body, not to the pane's heading. The + // transient notice bars stay above it, since they explain the message + // rather than offer an action on it. + layout->addWidget(m_messageBar); layout->addWidget(m_view, 1); layout->addWidget(m_attachmentBar); layout->addWidget(m_tagStrip); @@ -583,9 +591,12 @@ void MessageView::applyNoticeBarStyles() } void MessageView::setBarActions(const QList<QAction *> &messageActions, - const QList<QAction *> &viewControls) + const QList<QAction *> &viewControls, + int iconSize) { m_messageBar->clear(); + if (iconSize > 0) + m_messageBar->setIconSize(QSize(iconSize, iconSize)); for (QAction *action : messageActions) { if (action) diff --git a/src/messageview.h b/src/messageview.h index b28dcdc..c81a4f6 100644 --- a/src/messageview.h +++ b/src/messageview.h @@ -253,7 +253,8 @@ public: /// and changing how it is displayed are different scopes, which is the /// confusion the bar exists to remove one level up. void setBarActions(const QList<QAction *> &messageActions, - const QList<QAction *> &viewControls); + const QList<QAction *> &viewControls, + int iconSize = 0); /// Tells the pane whether the query bar currently holds anything. /// |
