Core: Set FindToolBar's prev/next buttons disabled on document close

If the current document closes, all items of the find toolbar (except
"Advanced...") are supposed to be disabled. The previous and next
buttons however remained enabled, which is now fixed with this change.

Change-Id: I33f978f23970280f04fb4f6237b733d5109043c1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Alessandro Portale
2020-01-23 17:47:16 +01:00
parent d2bdd5fc40
commit 0675ece793

View File

@@ -421,7 +421,9 @@ void FindToolBar::updateToolBar()
m_ui.findLabel->setVisible(showAllControls); m_ui.findLabel->setVisible(showAllControls);
m_ui.findEdit->setEnabled(enabled); m_ui.findEdit->setEnabled(enabled);
m_ui.findEdit->setPlaceholderText(showAllControls ? QString() : tr("Search for...")); m_ui.findEdit->setPlaceholderText(showAllControls ? QString() : tr("Search for..."));
m_ui.findPreviousButton->setEnabled(enabled);
m_ui.findPreviousButton->setVisible(showAllControls); m_ui.findPreviousButton->setVisible(showAllControls);
m_ui.findNextButton->setEnabled(enabled);
m_ui.findNextButton->setVisible(showAllControls); m_ui.findNextButton->setVisible(showAllControls);
m_ui.horizontalSpacer->changeSize((showAllControls ? FINDBUTTON_SPACER_WIDTH : 0), 0, m_ui.horizontalSpacer->changeSize((showAllControls ? FINDBUTTON_SPACER_WIDTH : 0), 0,
QSizePolicy::Expanding, QSizePolicy::Ignored); QSizePolicy::Expanding, QSizePolicy::Ignored);