From 612eb64871de7e00f21a9b7ebf33d8179caa16bc Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Fri, 14 Aug 2026 18:02:38 +0200 Subject: 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 --- src/mainwindow.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/mainwindow.cpp') 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(); -- cgit v1.2.3