Core::FileIconProvider: Add helper method to get a directory icon with overlay

Add a helper method to request a directory icon with an overlay icon for the
project tree.

Change-Id: Idea2ea9ec2ea6790bf8d087723700364fbcafec6
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Tobias Hunger
2017-09-06 11:32:15 +02:00
parent bae73e7246
commit 1cf1700d1c
7 changed files with 26 additions and 50 deletions

View File

@@ -31,8 +31,6 @@
#include <utils/algorithm.h>
#include <QApplication>
using namespace CMakeProjectManager;
using namespace CMakeProjectManager::Internal;
@@ -57,13 +55,7 @@ bool CMakeInputsNode::showInSimpleTree() const
CMakeListsNode::CMakeListsNode(const Utils::FileName &cmakeListPath) :
ProjectExplorer::ProjectNode(cmakeListPath)
{
static QIcon folderIcon;
if (folderIcon.isNull()) {
const QIcon overlayIcon(Constants::FILEOVERLAY_CMAKE);
QPixmap dirPixmap = QApplication::style()->standardIcon(QStyle::SP_DirIcon).pixmap(QSize(16, 16));
folderIcon.addPixmap(Core::FileIconProvider::overlayIcon(dirPixmap, overlayIcon));
}
static QIcon folderIcon = Core::FileIconProvider::directoryIcon(Constants::FILEOVERLAY_CMAKE);
setIcon(folderIcon);
}