Commit 1a9b2dad authored by Christiaan Janssen's avatar Christiaan Janssen
Browse files

QmlDesigner.ProjectExplorer: New icons for qml file types

parent 79fd001a
<RCC>
<qresource prefix="/qmljseditor" >
<qresource prefix="/qmljseditor">
<file>QmlJSEditor.mimetypes.xml</file>
<file>images/qmlfile.png</file>
</qresource>
</RCC>
......@@ -41,6 +41,7 @@
#include <coreplugin/coreconstants.h>
#include <coreplugin/mimedatabase.h>
#include <coreplugin/uniqueidmanager.h>
#include <coreplugin/fileiconprovider.h>
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/actioncontainer.h>
#include <coreplugin/actionmanager/command.h>
......@@ -147,6 +148,9 @@ bool QmlJSEditorPlugin::initialize(const QStringList & /*arguments*/, QString *e
error_message->clear();
Core::FileIconProvider *iconProvider = Core::FileIconProvider::instance();
iconProvider->registerIconOverlayForSuffix(QIcon(":/qmljseditor/images/qmlfile.png"), "qml");
return true;
}
......
<RCC>
<qresource prefix="/qmlproject" >
<qresource prefix="/qmlproject">
<file>QmlProject.mimetypes.xml</file>
<file>images/qmlfolder.png</file>
<file>images/qmlproject.png</file>
</qresource>
</RCC>
......@@ -32,11 +32,13 @@
#include "qmlproject.h"
#include <coreplugin/ifile.h>
#include <coreplugin/fileiconprovider.h>
#include <projectexplorer/projectexplorer.h>
#include <QFileInfo>
#include <QDir>
#include <QTextStream>
#include <QStyle>
namespace QmlProjectManager {
namespace Internal {
......@@ -47,6 +49,13 @@ QmlProjectNode::QmlProjectNode(QmlProject *project, Core::IFile *projectFile)
m_projectFile(projectFile)
{
setDisplayName(QFileInfo(projectFile->fileName()).completeBaseName());
// make overlay
const QSize desiredSize = QSize(16, 16);
const QIcon projectBaseIcon(QLatin1String(":/qmlproject/images/qmlfolder.png"));
const QPixmap projectPixmap = Core::FileIconProvider::overlayIcon(QStyle::SP_DirIcon,
projectBaseIcon,
desiredSize);
setIcon(QIcon(projectPixmap));
}
QmlProjectNode::~QmlProjectNode()
......
......@@ -40,6 +40,7 @@
#include <extensionsystem/pluginmanager.h>
#include <coreplugin/fileiconprovider.h>
#include <coreplugin/icore.h>
#include <coreplugin/mimedatabase.h>
......@@ -85,6 +86,9 @@ bool QmlProjectPlugin::initialize(const QStringList &, QString *errorMessage)
QmlProjectFileFormat::registerDeclarativeTypes();
Core::FileIconProvider *iconProvider = Core::FileIconProvider::instance();
iconProvider->registerIconOverlayForSuffix(QIcon(":/qmlproject/images/qmlproject.png"), "qmlproject");
return true;
}
......
Supports Markdown
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