Commit fdad4bf7 authored by Alessandro Portale's avatar Alessandro Portale

New file overlay icons

Change-Id: Icba67a1404b6e4604aef56def00bfe2098b8c8fe
Reviewed-by: Eike Ziller's avatarEike Ziller <eike.ziller@qt.io>
parent 600693af
......@@ -155,11 +155,10 @@ QIcon icon(QFileIconProvider::IconType type)
*/
QPixmap overlayIcon(const QPixmap &baseIcon, const QIcon &overlayIcon)
{
QPixmap iconPixmap = baseIcon;
QPainter painter(&iconPixmap);
painter.drawPixmap(0, 0, overlayIcon.pixmap(baseIcon.size()));
painter.end();
return iconPixmap;
QPixmap result = baseIcon;
QPainter painter(&result);
overlayIcon.paint(&painter, QRect(QPoint(), result.size() / result.devicePixelRatio()));
return result;
}
/*!
......
......@@ -46,6 +46,4 @@ equals(TEST, 1) {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
RESOURCES += designer.qrc
DISTFILES += README.txt
......@@ -29,7 +29,6 @@ QtcPlugin {
files: [
"README.txt",
"codemodelhelpers.cpp", "codemodelhelpers.h",
"designer.qrc",
"designer_export.h",
"designerconstants.h",
"designercontext.cpp", "designercontext.h",
......
......@@ -29,6 +29,7 @@
#include <coreplugin/coreconstants.h>
#include <coreplugin/fileiconprovider.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <QCoreApplication>
#include <QDebug>
......@@ -45,7 +46,7 @@ FormEditorFactory::FormEditorFactory()
setDisplayName(qApp->translate("Designer", C_DESIGNER_XML_DISPLAY_NAME));
addMimeType(FORM_MIMETYPE);
FileIconProvider::registerIconOverlayForSuffix(":/formeditor/images/qt_ui.png", "ui");
FileIconProvider::registerIconOverlayForSuffix(ProjectExplorer::Constants::FILEOVERLAY_UI, "ui");
}
IEditor *FormEditorFactory::createEditor()
......
......@@ -69,5 +69,21 @@
<file>images/targetchangebutton2@2x.png</file>
<file>images/desktopdevice.png</file>
<file>images/desktopdevice@2x.png</file>
<file>images/fileoverlay_qml.png</file>
<file>images/fileoverlay_qml@2x.png</file>
<file>images/fileoverlay_qrc.png</file>
<file>images/fileoverlay_qrc@2x.png</file>
<file>images/fileoverlay_qt.png</file>
<file>images/fileoverlay_qt@2x.png</file>
<file>images/fileoverlay_ui.png</file>
<file>images/fileoverlay_ui@2x.png</file>
<file>images/fileoverlay_scxml.png</file>
<file>images/fileoverlay_scxml@2x.png</file>
<file>images/fileoverlay_cpp.png</file>
<file>images/fileoverlay_cpp@2x.png</file>
<file>images/fileoverlay_h.png</file>
<file>images/fileoverlay_h@2x.png</file>
<file>images/fileoverlay_unknown.png</file>
<file>images/fileoverlay_unknown@2x.png</file>
</qresource>
</RCC>
......@@ -263,5 +263,15 @@ const char DEBUG_RUN_MODE_WITH_BREAK_ON_MAIN[]="RunConfiguration.DebugRunModeWit
// Navigation Widget
const char PROJECTTREE_ID[] = "Projects";
// File icon overlays
const char FILEOVERLAY_QT[]=":/projectexplorer/images/fileoverlay_qt.png";
const char FILEOVERLAY_QML[]=":/projectexplorer/images/fileoverlay_qml.png";
const char FILEOVERLAY_UI[]=":/projectexplorer/images/fileoverlay_ui.png";
const char FILEOVERLAY_QRC[]=":/projectexplorer/images/fileoverlay_qrc.png";
const char FILEOVERLAY_CPP[]=":/projectexplorer/images/fileoverlay_cpp.png";
const char FILEOVERLAY_H[]=":/projectexplorer/images/fileoverlay_h.png";
const char FILEOVERLAY_SCXML[]=":/projectexplorer/images/fileoverlay_scxml.png";
const char FILEOVERLAY_UNKNOWN[]=":/projectexplorer/images/fileoverlay_unknown.png";
} // namespace Constants
} // namespace ProjectExplorer
......@@ -809,7 +809,7 @@ bool QbsProjectNode::showInSimpleTree() const
void QbsProjectNode::ctor()
{
if (m_projectIcon.isNull())
m_projectIcon = generateIcon(QString::fromLatin1(QtSupport::Constants::ICON_QT_PROJECT));
m_projectIcon = generateIcon(QString::fromLatin1(ProjectExplorer::Constants::FILEOVERLAY_QT));
setIcon(m_projectIcon);
addFileNodes(QList<ProjectExplorer::FileNode *>()
......
......@@ -94,7 +94,7 @@ bool QbsProjectManagerPlugin::initialize(const QStringList &arguments, QString *
const Core::Context projectContext(::QbsProjectManager::Constants::PROJECT_ID);
Core::FileIconProvider::registerIconOverlayForSuffix(QtSupport::Constants::ICON_QT_PROJECT, "qbs");
Core::FileIconProvider::registerIconOverlayForSuffix(ProjectExplorer::Constants::FILEOVERLAY_QT, "qbs");
//create and register objects
addAutoReleasedObject(new QbsManager);
......
......@@ -35,6 +35,7 @@
#include <coreplugin/fileiconprovider.h>
#include <extensionsystem/pluginmanager.h>
#include <qtsupport/qtsupportconstants.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <texteditor/texteditoractionhandler.h>
#include <texteditor/textdocument.h>
#include <utils/qtcassert.h>
......@@ -201,7 +202,7 @@ ProFileEditorFactory::ProFileEditorFactory()
addHoverHandler(new ProFileHoverHandler(keywords));
setSyntaxHighlighterCreator([keywords]() { return new ProFileHighlighter(keywords); });
const QString defaultOverlay = QLatin1String(QtSupport::Constants::ICON_QT_PROJECT);
const QString defaultOverlay = QLatin1String(ProjectExplorer::Constants::FILEOVERLAY_QT);
Core::FileIconProvider::registerIconOverlayForSuffix(
creatorTheme()->imageFile(Theme::IconOverlayPro, defaultOverlay).toLatin1().data(), "pro");
Core::FileIconProvider::registerIconOverlayForSuffix(
......
......@@ -32,6 +32,7 @@
#include <projectexplorer/nodesvisitor.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/editormanager/ieditor.h>
#include <coreplugin/fileiconprovider.h>
......@@ -94,19 +95,19 @@ struct FileTypeDataStorage {
static const FileTypeDataStorage fileTypeDataStorage[] = {
{ HeaderType, Theme::ProjectExplorerHeader, QT_TRANSLATE_NOOP("QmakeProjectManager::QmakePriFileNode", "Headers"),
":/qmakeprojectmanager/images/headers.png", "*.h; *.hh; *.hpp; *.hxx;"},
ProjectExplorer::Constants::FILEOVERLAY_H, "*.h; *.hh; *.hpp; *.hxx;"},
{ SourceType, Theme::ProjectExplorerSource, QT_TRANSLATE_NOOP("QmakeProjectManager::QmakePriFileNode", "Sources"),
":/qmakeprojectmanager/images/sources.png", "*.c; *.cc; *.cpp; *.cp; *.cxx; *.c++;" },
ProjectExplorer::Constants::FILEOVERLAY_CPP, "*.c; *.cc; *.cpp; *.cp; *.cxx; *.c++;" },
{ FormType, Theme::ProjectExplorerForm, QT_TRANSLATE_NOOP("QmakeProjectManager::QmakePriFileNode", "Forms"),
":/qtsupport/images/forms.png", "*.ui;" },
Constants::FILEOVERLAY_UI, "*.ui;" },
{ StateChartType, Theme::ProjectExplorerForm, QT_TRANSLATE_NOOP("QmakeProjectManager::QmakePriFileNode", "State charts"),
":/qtsupport/images/statecharts.png", "*.scxml;" },
ProjectExplorer::Constants::FILEOVERLAY_SCXML, "*.scxml;" },
{ ResourceType, Theme::ProjectExplorerResource, QT_TRANSLATE_NOOP("QmakeProjectManager::QmakePriFileNode", "Resources"),
":/qtsupport/images/qt_qrc.png", "*.qrc;" },
ProjectExplorer::Constants::FILEOVERLAY_QRC, "*.qrc;" },
{ QMLType, Theme::ProjectExplorerQML, QT_TRANSLATE_NOOP("QmakeProjectManager::QmakePriFileNode", "QML"),
":/qtsupport/images/qml.png", "*.qml; *.qml.ui" },
ProjectExplorer::Constants::FILEOVERLAY_QML, "*.qml;" },
{ UnknownFileType, Theme::ProjectExplorerOtherFiles, QT_TRANSLATE_NOOP("QmakeProjectManager::QmakePriFileNode", "Other files"),
":/qmakeprojectmanager/images/unknown.png", "*;" }
ProjectExplorer::Constants::FILEOVERLAY_UNKNOWN, "*;" }
};
class SortByPath
......@@ -171,7 +172,7 @@ QmakeNodeStaticData::QmakeNodeStaticData()
}
// Project icon
const QString fileName = creatorTheme()->imageFile(Theme::ProjectFileIcon,
QLatin1String(":/qtsupport/images/qt_project.png"));
QLatin1String(ProjectExplorer::Constants::FILEOVERLAY_QT));
const QIcon projectBaseIcon(fileName);
const QPixmap projectPixmap = FileIconProvider::overlayIcon(dirPixmap, projectBaseIcon);
projectIcon.addPixmap(projectPixmap);
......
......@@ -69,18 +69,6 @@ QtcPlugin {
]
}
Group {
name: "Images"
prefix: "images/"
files: [
"headers.png",
"run_qmake.png",
"run_qmake_small.png",
"sources.png",
"unknown.png",
]
}
Group {
name: "Wizards"
prefix: "wizards/"
......
<RCC>
<qresource prefix="/qmakeprojectmanager">
<file>images/run_qmake.png</file>
<file>images/run_qmake_small.png</file>
<file>QmakeProjectManager.mimetypes.xml</file>
<file>images/headers.png</file>
<file>images/sources.png</file>
<file>images/unknown.png</file>
<file>images/dark_headers.png</file>
<file>images/dark_sources.png</file>
<file>images/dark_unknown.png</file>
......
......@@ -61,8 +61,6 @@ SOURCES += \
qmljswrapinloader.cpp \
qmljseditordocument.cpp
RESOURCES += qmljseditor.qrc
FORMS += \
quicktoolbarsettingspage.ui \
qmljscomponentnamedialog.ui
......@@ -28,7 +28,6 @@ QtcPlugin {
"qmljscomponentnamedialog.ui",
"qmljseditor.cpp",
"qmljseditor.h",
"qmljseditor.qrc",
"qmljseditor_global.h",
"qmljseditorconstants.h",
"qmljseditordocument.cpp",
......@@ -72,7 +71,6 @@ QtcPlugin {
"quicktoolbarsettingspage.cpp",
"quicktoolbarsettingspage.h",
"quicktoolbarsettingspage.ui",
"images/qmlfile.png",
]
Export {
......
<RCC>
<qresource prefix="/qmljseditor">
<file>images/qmlfile.png</file>
</qresource>
</RCC>
......@@ -50,6 +50,7 @@
#include <coreplugin/actionmanager/command.h>
#include <coreplugin/editormanager/editormanager.h>
#include <projectexplorer/taskhub.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <texteditor/texteditorconstants.h>
#include <utils/qtcassert.h>
#include <utils/json.h>
......@@ -186,7 +187,7 @@ bool QmlJSEditorPlugin::initialize(const QStringList & /*arguments*/, QString *e
errorMessage->clear();
FileIconProvider::registerIconOverlayForSuffix(":/qmljseditor/images/qmlfile.png", "qml");
FileIconProvider::registerIconOverlayForSuffix(ProjectExplorer::Constants::FILEOVERLAY_QML, "qml");
registerQuickFixes(this);
......
......@@ -102,11 +102,6 @@ QtcPlugin {
"showbuildlog.ui",
"uicgenerator.cpp",
"uicgenerator.h",
"images/forms.png",
"images/qml.png",
"images/qt_project.png",
"images/qt_qrc.png",
"images/statecharts.png",
]
Group {
......
<RCC>
<qresource prefix="/qtsupport">
<file>images/forms.png</file>
<file>images/statecharts.png</file>
<file>images/qml.png</file>
<file>images/qt_project.png</file>
<file>images/qt_qrc.png</file>
<file>images/dark_forms.png</file>
<file>images/dark_qml.png</file>
<file>images/dark_qt_project.png</file>
......
......@@ -59,9 +59,6 @@ const char FEATURE_QT_CONSOLE[] = "QtSupport.Wizards.FeatureQtConsole";
const char FEATURE_MOBILE[] = "QtSupport.Wizards.FeatureMobile";
const char FEATURE_DESKTOP[] = "QtSupport.Wizards.FeatureDesktop";
// Icon:
const char ICON_QT_PROJECT[] = ":/qtsupport/images/qt_project.png";
} // namepsace Constants
} // namepsace QtSupport
......
......@@ -30,6 +30,7 @@
#include <coreplugin/icore.h>
#include <coreplugin/removefiledialog.h>
#include <coreplugin/vcsmanager.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <utils/fileutils.h>
#include <QCoreApplication>
......@@ -547,7 +548,7 @@ ResourceModel::ResourceModel(QObject *parent)
: QAbstractItemModel(parent), m_dirty(false)
{
m_prefixIcon = Core::FileIconProvider::overlayIcon(QStyle::SP_DirIcon,
QIcon(QLatin1String(":/resourceeditor/images/qt_qrc.png")), QSize(16, 16));
QIcon(QLatin1String(ProjectExplorer::Constants::FILEOVERLAY_QRC)), QSize(16, 16));
}
void ResourceModel::setDirty(bool b)
......
<RCC>
<qresource prefix="/resourceeditor">
<file>images/qt_qrc.png</file>
<file>ResourceEditor.mimetypes.xml</file>
</qresource>
</RCC>
......@@ -30,6 +30,7 @@
#include <coreplugin/fileiconprovider.h>
#include <coreplugin/editormanager/editormanager.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <QCoreApplication>
#include <QFileInfo>
......@@ -46,7 +47,8 @@ ResourceEditorFactory::ResourceEditorFactory(ResourceEditorPlugin *plugin) :
setMimeTypes(QStringList(QLatin1String(C_RESOURCE_MIMETYPE)));
setDisplayName(qApp->translate("OpenWith::Editors", C_RESOURCEEDITOR_DISPLAY_NAME));
Core::FileIconProvider::registerIconOverlayForSuffix(":/resourceeditor/images/qt_qrc.png", "qrc");
Core::FileIconProvider::registerIconOverlayForSuffix(
ProjectExplorer::Constants::FILEOVERLAY_QRC, "qrc");
}
Core::IEditor *ResourceEditorFactory::createEditor()
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment