Add "New Search" tool button to search results pane

Task-number: QTCREATORBUG-17870
Change-Id: If939e71cb74b5a0b6811e435b02e86c5053bd067
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Eike Ziller
2018-03-05 11:38:11 +01:00
parent 835d4e92f3
commit 7112ca1c56
7 changed files with 33 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

View File

@@ -157,6 +157,8 @@
<file>images/collapse@2x.png</file>
<file>images/expand.png</file>
<file>images/expand@2x.png</file>
<file>images/iconoverlay_add_small.png</file>
<file>images/iconoverlay_add_small@2x.png</file>
<file>images/iconoverlay_add.png</file>
<file>images/iconoverlay_add@2x.png</file>
<file>images/iconoverlay_add_background.png</file>

View File

@@ -82,6 +82,9 @@ const Icon BOOKMARK_TEXTEDITOR({
{QLatin1String(":/utils/images/bookmark.png"), Theme::Bookmarks_TextMarkColor}}, Icon::Tint);
const Icon SNAPSHOT_TOOLBAR({
{QLatin1String(":/utils/images/snapshot.png"), Theme::IconsBaseColor}});
const Icon NEWSEARCH_TOOLBAR({
{QLatin1String(":/utils/images/zoom.png"), Theme::IconsBaseColor},
{QLatin1String(":/utils/images/iconoverlay_add_small.png"), Theme::IconsRunColor}});
const Icon NEWFILE({
{QLatin1String(":/utils/images/filenew.png"), Theme::PanelTextColorMid}}, Icon::Tint);

View File

@@ -55,6 +55,7 @@ QTCREATOR_UTILS_EXPORT extern const Icon BOOKMARK;
QTCREATOR_UTILS_EXPORT extern const Icon BOOKMARK_TOOLBAR;
QTCREATOR_UTILS_EXPORT extern const Icon BOOKMARK_TEXTEDITOR;
QTCREATOR_UTILS_EXPORT extern const Icon SNAPSHOT_TOOLBAR;
QTCREATOR_UTILS_EXPORT extern const Icon NEWSEARCH_TOOLBAR;
QTCREATOR_UTILS_EXPORT extern const Icon NEWFILE;
QTCREATOR_UTILS_EXPORT extern const Icon OPENFILE;

View File

@@ -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};
}

View File

@@ -8168,6 +8168,23 @@
cy="578"
r="5" />
</g>
<g
id="src/libs/utils/images/iconoverlay_add_small"
transform="translate(96)">
<rect
id="rect5759-5-9-0-8-6-3-7"
height="16"
width="16"
y="363"
x="570"
style="fill:#ffffff" />
<path
style="fill:#000000;fill-opacity:1"
d="m 582,370 v 3 h 3 v 2 h -3 v 3 h -2 v -3 h -3 v -2 h 3 v -3 z"
id="path5157-7-5"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccccccccc" />
</g>
<g
id="src/libs/utils/images/iconoverlay_add"
transform="translate(112,0)">

Before

Width:  |  Height:  |  Size: 323 KiB

After

Width:  |  Height:  |  Size: 324 KiB