diff --git a/src/plugins/projectexplorer/images/BuildSettings.png b/src/plugins/projectexplorer/images/BuildSettings.png deleted file mode 100644 index 30a2c62380a..00000000000 Binary files a/src/plugins/projectexplorer/images/BuildSettings.png and /dev/null differ diff --git a/src/plugins/projectexplorer/images/CodeStyleSettings.png b/src/plugins/projectexplorer/images/CodeStyleSettings.png deleted file mode 100644 index ebd869fb32b..00000000000 Binary files a/src/plugins/projectexplorer/images/CodeStyleSettings.png and /dev/null differ diff --git a/src/plugins/projectexplorer/images/EditorSettings.png b/src/plugins/projectexplorer/images/EditorSettings.png deleted file mode 100644 index ebd869fb32b..00000000000 Binary files a/src/plugins/projectexplorer/images/EditorSettings.png and /dev/null differ diff --git a/src/plugins/projectexplorer/images/ProjectDependencies.png b/src/plugins/projectexplorer/images/ProjectDependencies.png deleted file mode 100644 index 635b4721442..00000000000 Binary files a/src/plugins/projectexplorer/images/ProjectDependencies.png and /dev/null differ diff --git a/src/plugins/projectexplorer/images/RunSettings.png b/src/plugins/projectexplorer/images/RunSettings.png deleted file mode 100644 index 2bf7dc6519c..00000000000 Binary files a/src/plugins/projectexplorer/images/RunSettings.png and /dev/null differ diff --git a/src/plugins/projectexplorer/images/unconfigured.png b/src/plugins/projectexplorer/images/unconfigured.png deleted file mode 100644 index fef0ce4502e..00000000000 Binary files a/src/plugins/projectexplorer/images/unconfigured.png and /dev/null differ diff --git a/src/plugins/projectexplorer/panelswidget.cpp b/src/plugins/projectexplorer/panelswidget.cpp index ef5ad7dce5c..b18c799dd10 100644 --- a/src/plugins/projectexplorer/panelswidget.cpp +++ b/src/plugins/projectexplorer/panelswidget.cpp @@ -40,12 +40,9 @@ using namespace Utils; namespace ProjectExplorer { namespace { -const int ICON_SIZE(64); - const int ABOVE_HEADING_MARGIN = 10; const int ABOVE_CONTENTS_MARGIN = 4; const int BELOW_CONTENTS_MARGIN = 16; -const int PANEL_LEFT_MARGIN = 70; } @@ -57,7 +54,7 @@ PanelsWidget::PanelsWidget(QWidget *parent) : QWidget(parent) { m_root = new QWidget(nullptr); m_root->setFocusPolicy(Qt::NoFocus); - m_root->setContentsMargins(0, 0, 40, 0); + m_root->setContentsMargins(0, 0, 0, 0); const auto scroller = new QScrollArea(this); scroller->setWidget(m_root); @@ -67,11 +64,10 @@ PanelsWidget::PanelsWidget(QWidget *parent) : QWidget(parent) // The layout holding the individual panels: auto topLayout = new QVBoxLayout(m_root); - topLayout->setContentsMargins(0, 0, 0, 0); + topLayout->setContentsMargins(PanelVMargin, 0, PanelVMargin, 0); topLayout->setSpacing(0); - m_layout = new QGridLayout; - m_layout->setColumnMinimumWidth(0, ICON_SIZE + 4); + m_layout = new QVBoxLayout; m_layout->setSpacing(0); topLayout->addLayout(m_layout); @@ -86,39 +82,28 @@ PanelsWidget::PanelsWidget(QWidget *parent) : QWidget(parent) //layout->addWidget(new FindToolBarPlaceHolder(this)); } -PanelsWidget::PanelsWidget(const QString &displayName, const QIcon &icon, QWidget *widget) +PanelsWidget::PanelsWidget(const QString &displayName, QWidget *widget) : PanelsWidget(nullptr) { - addPropertiesPanel(displayName, icon, widget); + addPropertiesPanel(displayName, widget); } PanelsWidget::~PanelsWidget() = default; /* - * Add a widget with heading information into the grid - * layout of the PanelsWidget. + * Add a widget with heading information into the layout of the PanelsWidget. * * ... - * +--------+-------------------------------------------+ ABOVE_HEADING_MARGIN - * | icon | name | - * + +-------------------------------------------+ - * | | line | - * + +-------------------------------------------+ ABOVE_CONTENTS_MARGIN - * | | widget (with contentsmargins adjusted!) | - * +--------+-------------------------------------------+ BELOW_CONTENTS_MARGIN + * +------------+ ABOVE_HEADING_MARGIN + * | name | + * +------------+ + * | line | + * +------------+ ABOVE_CONTENTS_MARGIN + * | widget | + * +------------+ BELOW_CONTENTS_MARGIN */ -void PanelsWidget::addPropertiesPanel(const QString &displayName, const QIcon &icon, QWidget *widget) +void PanelsWidget::addPropertiesPanel(const QString &displayName, QWidget *widget) { - const int headerRow = m_layout->rowCount(); - - // icon: - if (!icon.isNull()) { - auto iconLabel = new QLabel(m_root); - iconLabel->setPixmap(icon.pixmap(ICON_SIZE, ICON_SIZE)); - iconLabel->setContentsMargins(0, ABOVE_HEADING_MARGIN, 0, 0); - m_layout->addWidget(iconLabel, headerRow, 0, 3, 1, Qt::AlignTop | Qt::AlignHCenter); - } - // name: auto nameLabel = new QLabel(m_root); nameLabel->setText(displayName); @@ -127,24 +112,19 @@ void PanelsWidget::addPropertiesPanel(const QString &displayName, const QIcon &i f.setBold(true); f.setPointSizeF(f.pointSizeF() * 1.6); nameLabel->setFont(f); - m_layout->addWidget(nameLabel, headerRow, 1, 1, 1, Qt::AlignVCenter | Qt::AlignLeft); + m_layout->addWidget(nameLabel); // line: - const int lineRow = headerRow + 1; auto line = new QFrame(m_root); line->setFrameShape(QFrame::HLine); line->setForegroundRole(QPalette::Midlight); line->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); - m_layout->addWidget(line, lineRow, 1, 1, -1, Qt::AlignTop); + m_layout->addWidget(line); // add the widget: - const int widgetRow = lineRow + 1; - - widget->setContentsMargins(PANEL_LEFT_MARGIN, - ABOVE_CONTENTS_MARGIN, 0, - BELOW_CONTENTS_MARGIN); + widget->setContentsMargins(0, ABOVE_CONTENTS_MARGIN, 0, BELOW_CONTENTS_MARGIN); widget->setParent(m_root); - m_layout->addWidget(widget, widgetRow, 0, 1, 2); + m_layout->addWidget(widget); } } // ProjectExplorer diff --git a/src/plugins/projectexplorer/panelswidget.h b/src/plugins/projectexplorer/panelswidget.h index 1be7723aaad..b213f2191b9 100644 --- a/src/plugins/projectexplorer/panelswidget.h +++ b/src/plugins/projectexplorer/panelswidget.h @@ -30,8 +30,7 @@ #include QT_BEGIN_NAMESPACE -class QGridLayout; -class QIcon; +class QVBoxLayout; QT_END_NAMESPACE namespace ProjectExplorer { @@ -42,15 +41,15 @@ class PROJECTEXPLORER_EXPORT PanelsWidget : public QWidget public: explicit PanelsWidget(QWidget *parent = nullptr); - PanelsWidget(const QString &displayName, const QIcon &icon, - QWidget *widget); + PanelsWidget(const QString &displayName, QWidget *widget); ~PanelsWidget() override; - void addPropertiesPanel(const QString &displayName, const QIcon &icon, - QWidget *widget); + void addPropertiesPanel(const QString &displayName, QWidget *widget); + + static int constexpr PanelVMargin = 14; private: - QGridLayout *m_layout; + QVBoxLayout *m_layout; QWidget *m_root; }; diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 368578b150c..88556d68300 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -882,21 +882,18 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er auto panelFactory = new ProjectPanelFactory; panelFactory->setPriority(30); panelFactory->setDisplayName(QCoreApplication::translate("EditorSettingsPanelFactory", "Editor")); - panelFactory->setIcon(":/projectexplorer/images/EditorSettings.png"); panelFactory->setCreateWidgetFunction([](Project *project) { return new EditorSettingsWidget(project); }); ProjectPanelFactory::registerFactory(panelFactory); panelFactory = new ProjectPanelFactory; panelFactory->setPriority(40); panelFactory->setDisplayName(QCoreApplication::translate("CodeStyleSettingsPanelFactory", "Code Style")); - panelFactory->setIcon(":/projectexplorer/images/CodeStyleSettings.png"); panelFactory->setCreateWidgetFunction([](Project *project) { return new CodeStyleSettingsWidget(project); }); ProjectPanelFactory::registerFactory(panelFactory); panelFactory = new ProjectPanelFactory; panelFactory->setPriority(50); panelFactory->setDisplayName(QCoreApplication::translate("DependenciesPanelFactory", "Dependencies")); - panelFactory->setIcon(":/projectexplorer/images/ProjectDependencies.png"); panelFactory->setCreateWidgetFunction([](Project *project) { return new DependenciesWidget(project); }); ProjectPanelFactory::registerFactory(panelFactory); diff --git a/src/plugins/projectexplorer/projectexplorer.qrc b/src/plugins/projectexplorer/projectexplorer.qrc index 4f4cb474305..ececb0854b3 100644 --- a/src/plugins/projectexplorer/projectexplorer.qrc +++ b/src/plugins/projectexplorer/projectexplorer.qrc @@ -24,11 +24,6 @@ images/debugger_overlay_small@2x.png images/analyzer_overlay_small.png images/analyzer_overlay_small@2x.png - images/BuildSettings.png - images/CodeStyleSettings.png - images/RunSettings.png - images/EditorSettings.png - images/ProjectDependencies.png images/devicestatusindicator.png images/devicestatusindicator@2x.png images/build.png @@ -51,7 +46,6 @@ images/buildstepmoveup@2x.png images/buildstepremove.png images/buildstepremove@2x.png - images/unconfigured.png images/desktopdevice.png images/desktopdevice@2x.png images/fileoverlay_qml.png diff --git a/src/plugins/projectexplorer/projectpanelfactory.cpp b/src/plugins/projectexplorer/projectpanelfactory.cpp index 376cd7acd15..5dca1340b1e 100644 --- a/src/plugins/projectexplorer/projectpanelfactory.cpp +++ b/src/plugins/projectexplorer/projectpanelfactory.cpp @@ -90,16 +90,6 @@ void ProjectPanelFactory::setId(Utils::Id id) m_id = id; } -QString ProjectPanelFactory::icon() const -{ - return m_icon; -} - -void ProjectPanelFactory::setIcon(const QString &icon) -{ - m_icon = icon; -} - QWidget *ProjectPanelFactory::createWidget(Project *project) const { return m_widgetCreator(project); diff --git a/src/plugins/projectexplorer/projectpanelfactory.h b/src/plugins/projectexplorer/projectpanelfactory.h index 3a6adfc0f16..d1eb6500309 100644 --- a/src/plugins/projectexplorer/projectpanelfactory.h +++ b/src/plugins/projectexplorer/projectpanelfactory.h @@ -72,9 +72,6 @@ public: Utils::TreeItem *createPanelItem(Project *project); - QString icon() const; - void setIcon(const QString &icon); - void setCreateWidgetFunction(const WidgetCreator &createWidgetFunction); QWidget *createWidget(Project *project) const; @@ -87,7 +84,6 @@ private: QString m_displayName; SupportsFunction m_supportsFunction; WidgetCreator m_widgetCreator; - QString m_icon; }; } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/projectwindow.cpp b/src/plugins/projectexplorer/projectwindow.cpp index 76d66be2547..8c9d3a64619 100644 --- a/src/plugins/projectexplorer/projectwindow.cpp +++ b/src/plugins/projectexplorer/projectwindow.cpp @@ -262,9 +262,7 @@ QVariant MiscSettingsPanelItem::data(int column, int role) const if (role == PanelWidgetRole) { if (!m_widget) { QWidget *widget = m_factory->createWidget(m_project); - m_widget = new PanelsWidget(m_factory->displayName(), - QIcon(m_factory->icon()), - widget); + m_widget = new PanelsWidget(m_factory->displayName(), widget); m_widget->setFocusProxy(widget); } @@ -610,7 +608,8 @@ public: auto innerLayout = new QVBoxLayout; innerLayout->setSpacing(10); - innerLayout->setContentsMargins(14, innerLayout->spacing(), 14, 0); + innerLayout->setContentsMargins(PanelsWidget::PanelVMargin, innerLayout->spacing(), + PanelsWidget::PanelVMargin, 0); innerLayout->addWidget(m_manageKits); innerLayout->addSpacerItem(new QSpacerItem(10, 30, QSizePolicy::Maximum, QSizePolicy::Maximum)); innerLayout->addWidget(activeLabel); diff --git a/src/plugins/projectexplorer/targetsettingspanel.cpp b/src/plugins/projectexplorer/targetsettingspanel.cpp index 7e0524d4170..95dacf0a623 100644 --- a/src/plugins/projectexplorer/targetsettingspanel.cpp +++ b/src/plugins/projectexplorer/targetsettingspanel.cpp @@ -229,9 +229,7 @@ void TargetGroupItemPrivate::ensureWidget() if (!m_configurePage) { m_targetSetupPageWrapper = new TargetSetupPageWrapper(m_project); - m_configurePage = new PanelsWidget(tr("Configure Project"), - QIcon(":/projectexplorer/images/unconfigured.png"), - m_targetSetupPageWrapper); + m_configurePage = new PanelsWidget(tr("Configure Project"), m_targetSetupPageWrapper); m_configurePage->setFocusProxy(m_targetSetupPageWrapper); } m_targetSetupPageWrapper->ensureSetupPage(); @@ -243,9 +241,7 @@ void TargetGroupItemPrivate::ensureWidget() layout->setContentsMargins(0, 0, 0, 0); layout->addWidget(label); layout->addStretch(10); - m_configuredPage = new PanelsWidget(tr("Configure Project"), - QIcon(":/projectexplorer/images/unconfigured.png"), - widget); + m_configuredPage = new PanelsWidget(tr("Configure Project"), widget); } } @@ -614,10 +610,8 @@ public: if (!m_panel) { m_panel = (m_subIndex == RunPage) ? new PanelsWidget(RunSettingsWidget::tr("Run Settings"), - QIcon(":/projectexplorer/images/RunSettings.png"), new RunSettingsWidget(target())) : new PanelsWidget(QCoreApplication::translate("BuildSettingsPanel", "Build Settings"), - QIcon(":/projectexplorer/images/BuildSettings.png"), new BuildSettingsWidget(target())); } return m_panel; diff --git a/src/tools/iconlister/iconlister.cpp b/src/tools/iconlister/iconlister.cpp index 8a896647f64..d9f858f4c2f 100644 --- a/src/tools/iconlister/iconlister.cpp +++ b/src/tools/iconlister/iconlister.cpp @@ -334,20 +334,8 @@ void IconLister::addProjectExplorerIcons() {QIcon(":/projectexplorer/images/category_buildrun.png"), "category_buildrun.png", prefix, ""}, - {QIcon(":/projectexplorer/images/BuildSettings.png"), "BuildSettings.png", prefix, - ""}, - {QIcon(":/projectexplorer/images/CodeStyleSettings.png"), "CodeStyleSettings.png", prefix, - ""}, - {QIcon(":/projectexplorer/images/RunSettings.png"), "RunSettings.png", prefix, - ""}, - {QIcon(":/projectexplorer/images/EditorSettings.png"), "EditorSettings.png", prefix, - ""}, - {QIcon(":/projectexplorer/images/ProjectDependencies.png"), "ProjectDependencies.png", prefix, - ""}, {QIcon(":/projectexplorer/images/targetpanel_bottom.png"), "targetpanel_bottom.png", prefix, ""}, - {QIcon(":/projectexplorer/images/unconfigured.png"), "unconfigured.png", prefix, - ""}, }; m_icons.append(icons); }