ProjectExplorer: Flat desktop device icon for flat themes

This change flattens the desktop device icon in the mode bar. Only for
themes which set the FlatSideBarIcons flag.

":///DESKTOP///" deduplicates to Constants::DESKTOP_DEVICE_ICON

Change-Id: Ie31d9c501db2a1e36edbfac59abdd22a4d8c6773
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
Alessandro Portale
2016-03-22 14:19:02 +01:00
parent c371166904
commit 22a262e8f6
13 changed files with 62 additions and 9 deletions

View File

@@ -28,6 +28,7 @@
#include "kitconfigwidget.h"
#include "kitmanager.h"
#include "target.h"
#include "projectexplorericons.h"
#include <utils/algorithm.h>
#include <utils/styledbar.h>
@@ -664,7 +665,9 @@ MiniProjectTargetSelector::MiniProjectTargetSelector(QAction *targetSelectorActi
setContentsMargins(QMargins(0, 1, 1, 8));
setWindowFlags(Qt::Popup);
targetSelectorAction->setIcon(style()->standardIcon(QStyle::SP_ComputerIcon));
targetSelectorAction->setIcon(creatorTheme()->flag(Theme::FlatSideBarIcons)
? Icons::DESKTOP_DEVICE.icon()
: style()->standardIcon(QStyle::SP_ComputerIcon));
targetSelectorAction->setProperty("titledAction", true);
m_kitAreaWidget = new KitAreaWidget(this);
@@ -1500,7 +1503,9 @@ void MiniProjectTargetSelector::updateActionAndSummary()
QString buildConfig;
QString deployConfig;
QString runConfig;
QIcon targetIcon = style()->standardIcon(QStyle::SP_ComputerIcon);
QIcon targetIcon = creatorTheme()->flag(Theme::FlatSideBarIcons)
? Icons::DESKTOP_DEVICE.icon()
: style()->standardIcon(QStyle::SP_ComputerIcon);
Project *project = SessionManager::startupProject();
if (project) {