forked from qt-creator/qt-creator
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:
BIN
src/libs/utils/images/iconoverlay_add_small.png
Normal file
BIN
src/libs/utils/images/iconoverlay_add_small.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 99 B |
BIN
src/libs/utils/images/iconoverlay_add_small@2x.png
Normal file
BIN
src/libs/utils/images/iconoverlay_add_small@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 102 B |
@@ -157,6 +157,8 @@
|
|||||||
<file>images/collapse@2x.png</file>
|
<file>images/collapse@2x.png</file>
|
||||||
<file>images/expand.png</file>
|
<file>images/expand.png</file>
|
||||||
<file>images/expand@2x.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.png</file>
|
||||||
<file>images/iconoverlay_add@2x.png</file>
|
<file>images/iconoverlay_add@2x.png</file>
|
||||||
<file>images/iconoverlay_add_background.png</file>
|
<file>images/iconoverlay_add_background.png</file>
|
||||||
|
@@ -82,6 +82,9 @@ const Icon BOOKMARK_TEXTEDITOR({
|
|||||||
{QLatin1String(":/utils/images/bookmark.png"), Theme::Bookmarks_TextMarkColor}}, Icon::Tint);
|
{QLatin1String(":/utils/images/bookmark.png"), Theme::Bookmarks_TextMarkColor}}, Icon::Tint);
|
||||||
const Icon SNAPSHOT_TOOLBAR({
|
const Icon SNAPSHOT_TOOLBAR({
|
||||||
{QLatin1String(":/utils/images/snapshot.png"), Theme::IconsBaseColor}});
|
{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({
|
const Icon NEWFILE({
|
||||||
{QLatin1String(":/utils/images/filenew.png"), Theme::PanelTextColorMid}}, Icon::Tint);
|
{QLatin1String(":/utils/images/filenew.png"), Theme::PanelTextColorMid}}, Icon::Tint);
|
||||||
|
@@ -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_TOOLBAR;
|
||||||
QTCREATOR_UTILS_EXPORT extern const Icon BOOKMARK_TEXTEDITOR;
|
QTCREATOR_UTILS_EXPORT extern const Icon BOOKMARK_TEXTEDITOR;
|
||||||
QTCREATOR_UTILS_EXPORT extern const Icon SNAPSHOT_TOOLBAR;
|
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 NEWFILE;
|
||||||
QTCREATOR_UTILS_EXPORT extern const Icon OPENFILE;
|
QTCREATOR_UTILS_EXPORT extern const Icon OPENFILE;
|
||||||
|
@@ -26,6 +26,7 @@
|
|||||||
#include "searchresultwindow.h"
|
#include "searchresultwindow.h"
|
||||||
#include "searchresultwidget.h"
|
#include "searchresultwidget.h"
|
||||||
#include "searchresultcolor.h"
|
#include "searchresultcolor.h"
|
||||||
|
#include "textfindconstants.h"
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
@@ -90,6 +91,7 @@ namespace Internal {
|
|||||||
SearchResultWindow *q;
|
SearchResultWindow *q;
|
||||||
QList<Internal::SearchResultWidget *> m_searchResultWidgets;
|
QList<Internal::SearchResultWidget *> m_searchResultWidgets;
|
||||||
QToolButton *m_expandCollapseButton;
|
QToolButton *m_expandCollapseButton;
|
||||||
|
QToolButton *m_newSearchButton;
|
||||||
QAction *m_expandCollapseAction;
|
QAction *m_expandCollapseAction;
|
||||||
static const bool m_initiallyExpand = false;
|
static const bool m_initiallyExpand = false;
|
||||||
QWidget *m_spacer;
|
QWidget *m_spacer;
|
||||||
@@ -141,6 +143,13 @@ namespace Internal {
|
|||||||
cmd->setAttribute(Command::CA_UpdateText);
|
cmd->setAttribute(Command::CA_UpdateText);
|
||||||
m_expandCollapseButton->setDefaultAction(cmd->action());
|
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,
|
connect(m_expandCollapseAction, &QAction::toggled,
|
||||||
this, &SearchResultWindowPrivate::handleExpandCollapseToolButton);
|
this, &SearchResultWindowPrivate::handleExpandCollapseToolButton);
|
||||||
|
|
||||||
@@ -340,7 +349,7 @@ QWidget *SearchResultWindow::outputWidget(QWidget *)
|
|||||||
*/
|
*/
|
||||||
QList<QWidget*> SearchResultWindow::toolBarWidgets() const
|
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};
|
d->m_historyLabel, d->m_spacer2, d->m_recentSearchesBox};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -8168,6 +8168,23 @@
|
|||||||
cy="578"
|
cy="578"
|
||||||
r="5" />
|
r="5" />
|
||||||
</g>
|
</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
|
<g
|
||||||
id="src/libs/utils/images/iconoverlay_add"
|
id="src/libs/utils/images/iconoverlay_add"
|
||||||
transform="translate(112,0)">
|
transform="translate(112,0)">
|
||||||
|
Before Width: | Height: | Size: 323 KiB After Width: | Height: | Size: 324 KiB |
Reference in New Issue
Block a user