diff --git a/src/libs/utils/utilsicons.cpp b/src/libs/utils/utilsicons.cpp index cbd7d3f05a4..31ad7c8b6c3 100644 --- a/src/libs/utils/utilsicons.cpp +++ b/src/libs/utils/utilsicons.cpp @@ -181,6 +181,9 @@ const Icon COLLAPSE({ const Icon COLLAPSE_TOOLBAR({ {QLatin1String(":/utils/images/collapse.png"), Theme::IconsBaseColor}}); const Icon EMPTY14(":/utils/images/empty14.png"); +const Icon ENABLE_KIT_OVERLAY({ + {":/projectexplorer/images/enablekitbackground.png", Theme::IconsRunColor}, + {":/projectexplorer/images/enablekitforeground.png", Theme::BackgroundColorNormal}}, Icon::Tint); } // namespace Icons } // namespace Utils diff --git a/src/libs/utils/utilsicons.h b/src/libs/utils/utilsicons.h index 04908757a77..f8158b814e3 100644 --- a/src/libs/utils/utilsicons.h +++ b/src/libs/utils/utilsicons.h @@ -107,6 +107,7 @@ QTCREATOR_UTILS_EXPORT extern const Icon EXPAND_TOOLBAR; QTCREATOR_UTILS_EXPORT extern const Icon COLLAPSE; QTCREATOR_UTILS_EXPORT extern const Icon COLLAPSE_TOOLBAR; QTCREATOR_UTILS_EXPORT extern const Icon EMPTY14; +QTCREATOR_UTILS_EXPORT extern const Icon ENABLE_KIT_OVERLAY; } // namespace Icons } // namespace Utils diff --git a/src/plugins/projectexplorer/images/enablekitbackground.png b/src/plugins/projectexplorer/images/enablekitbackground.png new file mode 100644 index 00000000000..d962618e71a Binary files /dev/null and b/src/plugins/projectexplorer/images/enablekitbackground.png differ diff --git a/src/plugins/projectexplorer/images/enablekitbackground@2x.png b/src/plugins/projectexplorer/images/enablekitbackground@2x.png new file mode 100644 index 00000000000..56e85c92536 Binary files /dev/null and b/src/plugins/projectexplorer/images/enablekitbackground@2x.png differ diff --git a/src/plugins/projectexplorer/images/enablekitforeground.png b/src/plugins/projectexplorer/images/enablekitforeground.png new file mode 100644 index 00000000000..d2648001c38 Binary files /dev/null and b/src/plugins/projectexplorer/images/enablekitforeground.png differ diff --git a/src/plugins/projectexplorer/images/enablekitforeground@2x.png b/src/plugins/projectexplorer/images/enablekitforeground@2x.png new file mode 100644 index 00000000000..ce3e306d0b0 Binary files /dev/null and b/src/plugins/projectexplorer/images/enablekitforeground@2x.png differ diff --git a/src/plugins/projectexplorer/projectexplorer.qrc b/src/plugins/projectexplorer/projectexplorer.qrc index 85e1a5a4add..a1cbea364b4 100644 --- a/src/plugins/projectexplorer/projectexplorer.qrc +++ b/src/plugins/projectexplorer/projectexplorer.qrc @@ -73,5 +73,9 @@ images/fileoverlay_h@2x.png images/fileoverlay_unknown.png images/fileoverlay_unknown@2x.png + images/enablekitbackground.png + images/enablekitbackground@2x.png + images/enablekitforeground.png + images/enablekitforeground@2x.png diff --git a/src/plugins/projectexplorer/targetsettingspanel.cpp b/src/plugins/projectexplorer/targetsettingspanel.cpp index bdac6689fca..eec9f3fdd0d 100644 --- a/src/plugins/projectexplorer/targetsettingspanel.cpp +++ b/src/plugins/projectexplorer/targetsettingspanel.cpp @@ -57,11 +57,13 @@ #include #include +#include #include #include #include #include #include +#include #include #include #include @@ -336,6 +338,20 @@ public: return Qt::ItemFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); } + static QIcon enableKitIcon(const Kit &kit) + { + static const QIcon overlay = Utils::Icons::ENABLE_KIT_OVERLAY.icon(); + const QSize iconSize(16, 16); + const QRect iconRect(QPoint(), iconSize); + QPixmap result(iconSize * qApp->devicePixelRatio()); + result.fill(Qt::transparent); + result.setDevicePixelRatio(qApp->devicePixelRatio()); + QPainter p(&result); + kit.icon().paint(&p, iconRect, Qt::AlignCenter, QIcon::Disabled); + overlay.paint(&p, iconRect); + return result; + } + QVariant data(int column, int role) const override { switch (role) { @@ -346,10 +362,10 @@ public: } case Qt::DecorationRole: { - if (!isEnabled()) - return Utils::Icons::PLUS.icon(); - Kit *k = KitManager::find(m_kitId); + const Kit *k = KitManager::find(m_kitId); QTC_ASSERT(k, return QVariant()); + if (!isEnabled()) + return enableKitIcon(*k); if (!k->isValid()) return Utils::Icons::ERROR.icon(); if (k->hasWarning()) diff --git a/src/tools/icons/qtcreatoricons.svg b/src/tools/icons/qtcreatoricons.svg index 187a8ce1e85..467cbb45cf5 100644 --- a/src/tools/icons/qtcreatoricons.svg +++ b/src/tools/icons/qtcreatoricons.svg @@ -5949,5 +5949,39 @@ cy="577.5" r="5.5" /> + + + + + + + +