forked from qt-creator/qt-creator
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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user