diff options
author | Eike Ziller <eike.ziller@qt.io> | 2018-03-05 11:38:11 +0100 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2018-03-09 13:03:38 +0000 |
commit | 7112ca1c56f3ca9b458bcc3561a69b3193d7d69e (patch) | |
tree | 68440435f8da195446a450762aff55fe1d7b14fd /src/plugins/coreplugin/find | |
parent | 835d4e92f3fafc1ec2de1ee1aa5e8982b1a2b99f (diff) | |
download | qt-creator-7112ca1c56f3ca9b458bcc3561a69b3193d7d69e.tar.gz |
Add "New Search" tool button to search results pane
Task-number: QTCREATORBUG-17870
Change-Id: If939e71cb74b5a0b6811e435b02e86c5053bd067
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Diffstat (limited to 'src/plugins/coreplugin/find')
-rw-r--r-- | src/plugins/coreplugin/find/searchresultwindow.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/plugins/coreplugin/find/searchresultwindow.cpp b/src/plugins/coreplugin/find/searchresultwindow.cpp index ce3d0e2a08..5de04e87d2 100644 --- a/src/plugins/coreplugin/find/searchresultwindow.cpp +++ b/src/plugins/coreplugin/find/searchresultwindow.cpp @@ -26,6 +26,7 @@ #include "searchresultwindow.h" #include "searchresultwidget.h" #include "searchresultcolor.h" +#include "textfindconstants.h" #include <coreplugin/icore.h> #include <coreplugin/actionmanager/actionmanager.h> @@ -90,6 +91,7 @@ namespace Internal { SearchResultWindow *q; QList<Internal::SearchResultWidget *> m_searchResultWidgets; QToolButton *m_expandCollapseButton; + QToolButton *m_newSearchButton; QAction *m_expandCollapseAction; static const bool m_initiallyExpand = false; QWidget *m_spacer; @@ -141,6 +143,13 @@ namespace Internal { cmd->setAttribute(Command::CA_UpdateText); m_expandCollapseButton->setDefaultAction(cmd->action()); + QAction *newSearchAction = new QAction(tr("New Search"), this); + newSearchAction->setIcon(Utils::Icons::NEWSEARCH_TOOLBAR.icon()); + cmd = ActionManager::command(Constants::ADVANCED_FIND); + m_newSearchButton = Command::toolButtonWithAppendedShortcut(newSearchAction, cmd); + if (QTC_GUARD(cmd && cmd->action())) + connect(m_newSearchButton, &QToolButton::triggered, cmd->action(), &QAction::trigger); + connect(m_expandCollapseAction, &QAction::toggled, this, &SearchResultWindowPrivate::handleExpandCollapseToolButton); @@ -340,7 +349,7 @@ QWidget *SearchResultWindow::outputWidget(QWidget *) */ QList<QWidget*> SearchResultWindow::toolBarWidgets() const { - return {d->m_expandCollapseButton, d->m_spacer, + return {d->m_expandCollapseButton, d->m_newSearchButton, d->m_spacer, d->m_historyLabel, d->m_spacer2, d->m_recentSearchesBox}; } |