Utils: Unify the different Bookmark icons

The variant in Bookmarks was left aligned, which is obsolete due to the
textmark overview tooltip. Bookmarks and Help now use the same icon which
is in Utils.

Change-Id: I0f7899de2f7a8803aa8493659d2991ac13739144
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Alessandro Portale
2016-10-10 16:16:27 +02:00
parent 60e4cec473
commit 22d40f4dc6
17 changed files with 22 additions and 42 deletions

View File

Before

Width:  |  Height:  |  Size: 134 B

After

Width:  |  Height:  |  Size: 134 B

View File

Before

Width:  |  Height:  |  Size: 162 B

After

Width:  |  Height:  |  Size: 162 B

View File

@@ -150,5 +150,7 @@
<file>images/iconoverlay_warning@2x.png</file> <file>images/iconoverlay_warning@2x.png</file>
<file>images/iconoverlay_warning_background.png</file> <file>images/iconoverlay_warning_background.png</file>
<file>images/iconoverlay_warning_background@2x.png</file> <file>images/iconoverlay_warning_background@2x.png</file>
<file>images/bookmark.png</file>
<file>images/bookmark@2x.png</file>
</qresource> </qresource>
</RCC> </RCC>

View File

@@ -57,6 +57,12 @@ const Icon BROKEN({
const Icon ERROR({ const Icon ERROR({
{QLatin1String(":/utils/images/warningfill.png"), Theme::BackgroundColorNormal}, {QLatin1String(":/utils/images/warningfill.png"), Theme::BackgroundColorNormal},
{QLatin1String(":/utils/images/error.png"), Theme::IconsErrorColor}}, Icon::Tint); {QLatin1String(":/utils/images/error.png"), Theme::IconsErrorColor}}, Icon::Tint);
const Icon BOOKMARK({
{QLatin1String(":/utils/images/bookmark.png"), Theme::PanelTextColorMid}}, Icon::Tint);
const Icon BOOKMARK_TOOLBAR({
{QLatin1String(":/utils/images/bookmark.png"), Theme::IconsBaseColor}});
const Icon BOOKMARK_TEXTEDITOR({
{QLatin1String(":/utils/images/bookmark.png"), Theme::Bookmarks_TextMarkColor}}, Icon::Tint);
const Icon NEWFILE( const Icon NEWFILE(
QLatin1String(":/utils/images/filenew.png")); QLatin1String(":/utils/images/filenew.png"));

View File

@@ -45,6 +45,9 @@ QTCREATOR_UTILS_EXPORT extern const Icon OK;
QTCREATOR_UTILS_EXPORT extern const Icon NOTLOADED; QTCREATOR_UTILS_EXPORT extern const Icon NOTLOADED;
QTCREATOR_UTILS_EXPORT extern const Icon BROKEN; QTCREATOR_UTILS_EXPORT extern const Icon BROKEN;
QTCREATOR_UTILS_EXPORT extern const Icon ERROR; QTCREATOR_UTILS_EXPORT extern const Icon ERROR;
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 NEWFILE; QTCREATOR_UTILS_EXPORT extern const Icon NEWFILE;
QTCREATOR_UTILS_EXPORT extern const Icon OPENFILE; QTCREATOR_UTILS_EXPORT extern const Icon OPENFILE;

View File

@@ -42,6 +42,7 @@
#include <utils/checkablemessagebox.h> #include <utils/checkablemessagebox.h>
#include <utils/theme/theme.h> #include <utils/theme/theme.h>
#include <utils/dropsupport.h> #include <utils/dropsupport.h>
#include <utils/utilsicons.h>
#include <QAction> #include <QAction>
#include <QContextMenuEvent> #include <QContextMenuEvent>
@@ -319,8 +320,7 @@ void BookmarkView::gotoBookmark(const QModelIndex &index)
//// ////
BookmarkManager::BookmarkManager() : BookmarkManager::BookmarkManager() :
m_bookmarkIcon(Utils::Icon({{QLatin1String(":/bookmarks/images/bookmark.png"), m_bookmarkIcon(Utils::Icons::BOOKMARK_TEXTEDITOR.pixmap()),
Theme::Bookmarks_TextMarkColor}}, Icon::Tint).pixmap()),
m_selectionModel(new QItemSelectionModel(this, this)) m_selectionModel(new QItemSelectionModel(this, this))
{ {
connect(ICore::instance(), &ICore::contextChanged, connect(ICore::instance(), &ICore::contextChanged,

View File

@@ -8,5 +8,3 @@ HEADERS += bookmarksplugin.h \
SOURCES += bookmarksplugin.cpp \ SOURCES += bookmarksplugin.cpp \
bookmark.cpp \ bookmark.cpp \
bookmarkmanager.cpp bookmarkmanager.cpp
RESOURCES += bookmarks.qrc

View File

@@ -1,6 +0,0 @@
<RCC>
<qresource prefix="/bookmarks" >
<file>images/bookmark.png</file>
<file>images/bookmark@2x.png</file>
</qresource>
</RCC>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 162 B

View File

@@ -4,8 +4,6 @@
<file>images/book.png</file> <file>images/book.png</file>
<file>images/home.png</file> <file>images/home.png</file>
<file>images/home@2x.png</file> <file>images/home@2x.png</file>
<file>images/bookmark.png</file>
<file>images/bookmark@2x.png</file>
<file>images/category_help.png</file> <file>images/category_help.png</file>
<file>images/mode_help.png</file> <file>images/mode_help.png</file>
<file>images/mode_help@2x.png</file> <file>images/mode_help@2x.png</file>

View File

@@ -34,6 +34,7 @@
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <coreplugin/helpmanager.h> #include <coreplugin/helpmanager.h>
#include <utils/algorithm.h> #include <utils/algorithm.h>
#include <utils/utilsicons.h>
#include <QIcon> #include <QIcon>
#include <QSqlDatabase> #include <QSqlDatabase>
@@ -54,7 +55,7 @@ HelpIndexFilter::HelpIndexFilter()
setIncludedByDefault(false); setIncludedByDefault(false);
setShortcutString(QString(QLatin1Char('?'))); setShortcutString(QString(QLatin1Char('?')));
m_icon = Icons::BOOKMARK.icon(); m_icon = Utils::Icons::BOOKMARK.icon();
connect(HelpManager::instance(), &HelpManager::setupFinished, connect(HelpManager::instance(), &HelpManager::setupFinished,
this, &HelpIndexFilter::invalidateCache); this, &HelpIndexFilter::invalidateCache);
connect(HelpManager::instance(), &HelpManager::documentationChanged, connect(HelpManager::instance(), &HelpManager::documentationChanged,

View File

@@ -180,7 +180,7 @@ HelpWidget::HelpWidget(const Core::Context &context, WidgetStyle style, QWidget
button->setPopupMode(QToolButton::DelayedPopup); button->setPopupMode(QToolButton::DelayedPopup);
layout->addWidget(button); layout->addWidget(button);
m_addBookmarkAction = new QAction(Icons::BOOKMARK_TOOLBAR.icon(), tr("Add Bookmark"), this); m_addBookmarkAction = new QAction(Utils::Icons::BOOKMARK_TOOLBAR.icon(), tr("Add Bookmark"), this);
cmd = Core::ActionManager::registerAction(m_addBookmarkAction, Constants::HELP_ADDBOOKMARK, context); cmd = Core::ActionManager::registerAction(m_addBookmarkAction, Constants::HELP_ADDBOOKMARK, context);
cmd->setDefaultKeySequence(QKeySequence(Core::UseMacShortcuts ? tr("Meta+M") : tr("Ctrl+M"))); cmd->setDefaultKeySequence(QKeySequence(Core::UseMacShortcuts ? tr("Meta+M") : tr("Ctrl+M")));
connect(m_addBookmarkAction, &QAction::triggered, this, &HelpWidget::addBookmark); connect(m_addBookmarkAction, &QAction::triggered, this, &HelpWidget::addBookmark);

View File

@@ -24,10 +24,11 @@
****************************************************************************/ ****************************************************************************/
#include "xbelsupport.h" #include "xbelsupport.h"
#include "helpicons.h"
#include <bookmarkmanager.h> #include <bookmarkmanager.h>
#include <utils/utilsicons.h>
#include <QCoreApplication> #include <QCoreApplication>
using namespace Help::Internal; using namespace Help::Internal;
@@ -97,7 +98,7 @@ XbelReader::XbelReader(BookmarkModel *tree, BookmarkModel *list)
, treeModel(tree) , treeModel(tree)
, listModel(list) , listModel(list)
{ {
bookmarkIcon = Icons::BOOKMARK.icon(); bookmarkIcon = Utils::Icons::BOOKMARK.icon();
folderIcon = QApplication::style()->standardIcon(QStyle::SP_DirClosedIcon); folderIcon = QApplication::style()->standardIcon(QStyle::SP_DirClosedIcon);
} }

View File

@@ -24,7 +24,6 @@
****************************************************************************/ ****************************************************************************/
#include "bookmarkmanager.h" #include "bookmarkmanager.h"
#include "helpicons.h"
#include <localhelpmanager.h> #include <localhelpmanager.h>
@@ -32,6 +31,7 @@
#include <utils/fancylineedit.h> #include <utils/fancylineedit.h>
#include <utils/styledbar.h> #include <utils/styledbar.h>
#include <utils/utilsicons.h>
#include <QMenu> #include <QMenu>
#include <QIcon> #include <QIcon>
@@ -566,7 +566,7 @@ Qt::ItemFlags BookmarkModel::flags(const QModelIndex &index) const
BookmarkManager::BookmarkManager() BookmarkManager::BookmarkManager()
: m_folderIcon(QApplication::style()->standardIcon(QStyle::SP_DirClosedIcon)) : m_folderIcon(QApplication::style()->standardIcon(QStyle::SP_DirClosedIcon))
, m_bookmarkIcon(Help::Icons::BOOKMARK.icon()) , m_bookmarkIcon(Utils::Icons::BOOKMARK.icon())
, treeModel(new BookmarkModel(0, 1, this)) , treeModel(new BookmarkModel(0, 1, this))
, listModel(new BookmarkModel(0, 1, this)) , listModel(new BookmarkModel(0, 1, this))
{ {

View File

@@ -30,10 +30,6 @@
namespace Help { namespace Help {
namespace Icons { namespace Icons {
const Utils::Icon BOOKMARK({
{QLatin1String(":/help/images/bookmark.png"), Utils::Theme::PanelTextColorMid}}, Utils::Icon::Tint);
const Utils::Icon BOOKMARK_TOOLBAR({
{QLatin1String(":/help/images/bookmark.png"), Utils::Theme::IconsBaseColor}});
const Utils::Icon HOME_TOOLBAR({ const Utils::Icon HOME_TOOLBAR({
{QLatin1String(":/help/images/home.png"), Utils::Theme::IconsBaseColor}}); {QLatin1String(":/help/images/home.png"), Utils::Theme::IconsBaseColor}});
const Utils::Icon MODE_HELP_CLASSIC( const Utils::Icon MODE_HELP_CLASSIC(

View File

@@ -3001,7 +3001,7 @@
transform="translate(336,208)" /> transform="translate(336,208)" />
</g> </g>
<g <g
id="src/plugins/help/images/bookmark"> id="src/libs/utils/images/bookmark">
<rect <rect
id="rect6782-96" id="rect6782-96"
height="16" height="16"
@@ -3051,25 +3051,6 @@
cy="576" cy="576"
r="6" /> r="6" />
</g> </g>
<g
id="src/plugins/bookmarks/images/bookmark">
<rect
style="display:inline;fill:#ffffff;fill-opacity:1"
x="1016"
y="568"
width="16"
height="16"
id="rect6782-96-0" />
<use
transform="translate(61,0)"
height="100%"
width="100%"
id="use4979"
xlink:href="#bookmarkribbon"
y="0"
x="0"
style="display:inline" />
</g>
<g <g
style="display:inline" style="display:inline"
id="src/plugins/debugger/images/qml/app-on-top" id="src/plugins/debugger/images/qml/app-on-top"

Before

Width:  |  Height:  |  Size: 212 KiB

After

Width:  |  Height:  |  Size: 211 KiB