summaryrefslogtreecommitdiffstats
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-08-14 18:02:38 +0200
committerDanilo M. <danix@danix.xyz>2026-08-14 18:02:38 +0200
commit612eb64871de7e00f21a9b7ebf33d8179caa16bc (patch)
treec92f928df38ae87fd233967301e01c6ef5b4dcd6 /src/mainwindow.cpp
parent78b3a9c1769d37ff7344360b6fed66b12b2f0649 (diff)
downloadqtmaildir-612eb64871de7e00f21a9b7ebf33d8179caa16bc.tar.gz
qtmaildir-612eb64871de7e00f21a9b7ebf33d8179caa16bc.zip
feat(search): push the query bar's emptiness into the panes
The menus cannot read the query bar and must not. MainWindow already watched textChanged for the Save button; the same lambda now also tells MessageView, which passes it to the details dialog at construction, where it cannot go stale. Nothing consumes it yet. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index e82e61d..bf6fc79 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -367,11 +367,16 @@ MainWindow::MainWindow(const Config &config, QWidget *parent)
// action keeps both for the menu it lives in.
m_saveQueryButton->setText(tr("Save"));
- auto updateSaveState = [this, save]() {
- save->setEnabled(!m_queryEdit->text().trimmed().isEmpty());
+ auto updateQueryState = [this, save]() {
+ const bool hasQuery = !m_queryEdit->text().trimmed().isEmpty();
+ save->setEnabled(hasQuery);
+ // The message pane greys "Exclude from search" without it: there
+ // would be nothing to exclude FROM. Both widgets exist by now,
+ // buildUi() having run before registerActions().
+ m_messageView->setHasQuery(hasQuery);
};
- connect(m_queryEdit, &QLineEdit::textChanged, this, updateSaveState);
- updateSaveState();
+ connect(m_queryEdit, &QLineEdit::textChanged, this, updateQueryState);
+ updateQueryState();
}
buildMenus();