summaryrefslogtreecommitdiff
path: root/src/plugins/coreplugin/find
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2018-03-08 10:21:47 +0100
committerEike Ziller <eike.ziller@qt.io>2018-03-20 11:03:22 +0000
commit5acb6caa8ac3474ab24b2ada706a5c9f5934356a (patch)
tree184d917a7fabb315529ff00e336cc3d5f855b800 /src/plugins/coreplugin/find
parent5d79e1dcee768442efbb19c825ec6b50f03c441d (diff)
downloadqt-creator-5acb6caa8ac3474ab24b2ada706a5c9f5934356a.tar.gz
Search Results: Fix expand all button state at startup
It was enabled at startup even though it should only be enabled if actual search results are shown. Do not set the enabled state on the button, but on the local action instead. The button has the Command's action as its default action, and the state of that action can be overridden by the local action's state at context change. Change-Id: I045d022836b12375dc49d4ee0ffd4802d795db3b Reviewed-by: David Schulz <david.schulz@qt.io>
Diffstat (limited to 'src/plugins/coreplugin/find')
-rw-r--r--src/plugins/coreplugin/find/searchresultwindow.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/plugins/coreplugin/find/searchresultwindow.cpp b/src/plugins/coreplugin/find/searchresultwindow.cpp
index 5de04e87d2..7c790df2fa 100644
--- a/src/plugins/coreplugin/find/searchresultwindow.cpp
+++ b/src/plugins/coreplugin/find/searchresultwindow.cpp
@@ -139,6 +139,7 @@ namespace Internal {
m_expandCollapseAction->setCheckable(true);
m_expandCollapseAction->setIcon(Utils::Icons::EXPAND_ALL_TOOLBAR.icon());
+ m_expandCollapseAction->setEnabled(false);
Command *cmd = ActionManager::registerAction(m_expandCollapseAction, "Find.ExpandAll");
cmd->setAttribute(Command::CA_UpdateText);
m_expandCollapseButton->setDefaultAction(cmd->action());
@@ -165,12 +166,12 @@ namespace Internal {
if (!isSearchVisible()) {
if (focus)
m_widget->currentWidget()->setFocus();
- m_expandCollapseButton->setEnabled(false);
+ m_expandCollapseAction->setEnabled(false);
} else {
if (focus)
m_searchResultWidgets.at(visibleSearchIndex())->setFocusInternally();
m_searchResultWidgets.at(visibleSearchIndex())->notifyVisibilityChanged(true);
- m_expandCollapseButton->setEnabled(true);
+ m_expandCollapseAction->setEnabled(true);
}
q->navigateStateChanged();
}
@@ -433,7 +434,7 @@ void SearchResultWindow::clearContents()
d->m_currentIndex = 0;
d->m_widget->currentWidget()->setFocus();
- d->m_expandCollapseButton->setEnabled(false);
+ d->m_expandCollapseAction->setEnabled(false);
navigateStateChanged();
}