Commit 070f4df4 authored by dt's avatar dt

No need for special margin treatmeant anymore

Remove unneded code.
parent 7b60fd1b
......@@ -47,9 +47,9 @@ namespace Utils {
// in the following way:
//
// +------------+-------------------------+---------------+
// + toolWidget | summaryLabel | detailsButton |
// +summaryLabel| toolwidget | detailsButton |
// +------------+-------------------------+---------------+
// | | widget |
// | widget |
// +------------+-------------------------+---------------+
struct DetailsWidgetPrivate {
......@@ -89,7 +89,7 @@ namespace Utils {
d->m_grid->setContentsMargins(0, 0, 0, 0);
d->m_grid->setSpacing(0);
d->m_grid->addWidget(d->m_summaryLabel, 0, 1);
d->m_grid->addWidget(d->m_summaryLabel, 0, 0);
d->m_grid->addWidget(d->m_detailsButton, 0, 2);
setLayout(d->m_grid);
......@@ -206,7 +206,7 @@ namespace Utils {
if (d->m_widget) {
d->m_widget->setContentsMargins(MARGIN, MARGIN, MARGIN, MARGIN);
d->m_grid->addWidget(d->m_widget, 1, 1, 1, 2);
d->m_grid->addWidget(d->m_widget, 1, 0, 1, 3);
}
updateControls();
}
......@@ -224,9 +224,6 @@ namespace Utils {
d->m_toolWidget->adjustSize();
d->m_grid->addWidget(d->m_toolWidget, 0, 1, 1, 1, Qt::AlignRight);
d->m_grid->setColumnMinimumWidth(0, d->m_toolWidget->width());
d->m_grid->setRowMinimumHeight(0, d->m_toolWidget->height());
changeHoverState(d->m_hovered);
}
......
......@@ -118,8 +118,7 @@ BuildSettingsWidget::~BuildSettingsWidget()
BuildSettingsWidget::BuildSettingsWidget(Target *target) :
m_target(target),
m_buildConfiguration(0),
m_leftMargin(0)
m_buildConfiguration(0)
{
Q_ASSERT(m_target);
setupUi();
......@@ -127,7 +126,6 @@ BuildSettingsWidget::BuildSettingsWidget(Target *target) :
void BuildSettingsWidget::setupUi()
{
m_leftMargin = Constants::PANEL_LEFT_MARGIN;
QVBoxLayout *vbox = new QVBoxLayout(this);
vbox->setContentsMargins(0, 0, 0, 0);
......@@ -145,7 +143,7 @@ void BuildSettingsWidget::setupUi()
{ // Edit Build Configuration row
QHBoxLayout *hbox = new QHBoxLayout();
hbox->setContentsMargins(m_leftMargin, 0, 0, 0);
hbox->setContentsMargins(0, 0, 0, 0);
hbox->addWidget(new QLabel(tr("Edit build configuration:"), this));
m_buildConfigurationComboBox = new QComboBox(this);
m_buildConfigurationComboBox->setSizeAdjustPolicy(QComboBox::AdjustToContents);
......@@ -191,7 +189,7 @@ void BuildSettingsWidget::setupUi()
void BuildSettingsWidget::addSubWidget(const QString &name, BuildConfigWidget *widget)
{
widget->setContentsMargins(m_leftMargin, 10, 0, 0);
widget->setContentsMargins(0, 10, 0, 0);
QLabel *label = new QLabel(this);
label->setText(name);
......@@ -200,7 +198,7 @@ void BuildSettingsWidget::addSubWidget(const QString &name, BuildConfigWidget *w
f.setPointSizeF(f.pointSizeF() * 1.2);
label->setFont(f);
label->setContentsMargins(m_leftMargin, 10, 0, 0);
label->setContentsMargins(0, 10, 0, 0);
layout()->addWidget(label);
layout()->addWidget(widget);
......
......@@ -71,7 +71,6 @@ public:
QString displayName() const;
QWidget *widget() const;
QIcon icon() const;
PanelFlags flags() const { return IPropertiesPanel::NoLeftMargin; }
private:
BuildSettingsWidget *m_widget;
......@@ -119,8 +118,6 @@ private:
QList<BuildConfigWidget *> m_subWidgets;
QList<QLabel *> m_labels;
int m_leftMargin;
};
} // namespace Internal
......
......@@ -53,10 +53,10 @@ using namespace ProjectExplorer::Internal;
BuildStepsPage::BuildStepsPage(Target *target, StepType type) :
BuildConfigWidget(),
m_type(type),
m_addButton(0),
m_leftMargin(-1)
m_addButton(0)
{
Q_UNUSED(target);
setStyleSheet("background: red");
}
BuildStepsPage::~BuildStepsPage()
......@@ -200,8 +200,7 @@ void BuildStepsPage::addBuildStepWidget(int pos, BuildStep *step)
s.detailsWidget->setToolWidget(toolWidget);
const int leftMargin(qMax(m_leftMargin - toolWidget->width(), 0));
s.detailsWidget->setContentsMargins(leftMargin, 0, 0, 1);
s.detailsWidget->setContentsMargins(0, 0, 0, 1);
m_buildSteps.insert(pos, s);
......@@ -276,11 +275,6 @@ void BuildStepsPage::setupUi()
if (0 != m_addButton)
return;
QMargins margins(contentsMargins());
m_leftMargin = margins.left();
margins.setLeft(0);
setContentsMargins(margins);
m_upMapper = new QSignalMapper(this);
connect(m_upMapper, SIGNAL(mapped(int)),
this, SLOT(stepMoveUp(int)));
......@@ -296,11 +290,11 @@ void BuildStepsPage::setupUi()
m_vbox->setSpacing(0);
m_noStepsLabel = new QLabel(tr("No Build Steps"), this);
m_noStepsLabel->setContentsMargins(m_leftMargin, 0, 0, 0);
m_noStepsLabel->setContentsMargins(0, 0, 0, 0);
m_vbox->addWidget(m_noStepsLabel);
QHBoxLayout *hboxLayout = new QHBoxLayout();
hboxLayout->setContentsMargins(m_leftMargin, 4, 0, 0);
hboxLayout->setContentsMargins(0, 4, 0, 0);
m_addButton = new QPushButton(this);
m_addButton->setText(m_type == Clean ? tr("Add Clean Step") : tr("Add Build Step"));
m_addButton->setMenu(new QMenu(this));
......
......@@ -45,12 +45,6 @@ namespace Constants {
class PROJECTEXPLORER_EXPORT IPropertiesPanel
{
public:
enum PanelFlag {
NoFlag = 0x00,
NoLeftMargin = 0x01
};
Q_DECLARE_FLAGS(PanelFlags, PanelFlag)
IPropertiesPanel()
{ }
virtual ~IPropertiesPanel()
......@@ -59,7 +53,6 @@ public:
virtual QString displayName() const = 0;
virtual QIcon icon() const = 0;
virtual QWidget *widget() const = 0;
virtual PanelFlags flags() const { return NoFlag; }
};
class PROJECTEXPLORER_EXPORT IPanelFactory : public QObject
......
......@@ -210,9 +210,7 @@ void PanelsWidget::addPropertiesPanel(IPropertiesPanel *panel)
void PanelsWidget::addPanelWidget(IPropertiesPanel *panel, int row)
{
QWidget *widget = panel->widget();
int leftMargin = (panel->flags() & IPropertiesPanel::NoLeftMargin)
? 0 : Constants::PANEL_LEFT_MARGIN;
widget->setContentsMargins(leftMargin,
widget->setContentsMargins(Constants::PANEL_LEFT_MARGIN,
ABOVE_CONTENTS_MARGIN, 0,
BELOW_CONTENTS_MARGIN);
widget->setParent(m_root);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment