Commit b76d643c authored by dt's avatar dt
Browse files

Tweaks to the project pane.

(cherry picked from commit e187cb40)
parent 9480c15c
...@@ -18,11 +18,19 @@ DetailsWidget::DetailsWidget(QWidget *parent) ...@@ -18,11 +18,19 @@ DetailsWidget::DetailsWidget(QWidget *parent)
m_grid(new QGridLayout(this)) m_grid(new QGridLayout(this))
{ {
m_grid->setContentsMargins(4, 3, 4, 3);
m_summaryLabel->setTextInteractionFlags(Qt::TextSelectableByMouse); m_summaryLabel->setTextInteractionFlags(Qt::TextSelectableByMouse);
m_summaryLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); m_summaryLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
m_grid->addWidget(m_summaryLabel, 0, 0, 2, 0); m_grid->addWidget(m_summaryLabel, 0, 0);
m_grid->addWidget(m_detailsButton, 1, 2); m_grid->addWidget(m_detailsButton, 0, 2, 1, 1, Qt::AlignBottom);
m_dummyWidget = new QWidget(this);
m_dummyWidget->setMaximumHeight(4);
m_dummyWidget->setMaximumHeight(4);
m_dummyWidget->setVisible(false);
m_grid->addWidget(m_dummyWidget, 2, 0, 1, 1);
connect(m_detailsButton, SIGNAL(clicked()), connect(m_detailsButton, SIGNAL(clicked()),
this, SLOT(detailsButtonClicked())); this, SLOT(detailsButtonClicked()));
...@@ -77,8 +85,10 @@ void DetailsWidget::paintEvent(QPaintEvent *paintEvent) ...@@ -77,8 +85,10 @@ void DetailsWidget::paintEvent(QPaintEvent *paintEvent)
void DetailsWidget::detailsButtonClicked() void DetailsWidget::detailsButtonClicked()
{ {
bool visible = m_detailsButton->isToggled();
if (m_widget) if (m_widget)
m_widget->setVisible(m_detailsButton->isToggled()); m_widget->setVisible(visible);
m_dummyWidget->setVisible(visible);
fixUpLayout(); fixUpLayout();
} }
...@@ -117,9 +127,11 @@ void DetailsWidget::setWidget(QWidget *widget) ...@@ -117,9 +127,11 @@ void DetailsWidget::setWidget(QWidget *widget)
m_widget = 0; m_widget = 0;
} }
if (widget) { if (widget) {
m_grid->addWidget(widget, 2, 0, 1, 3); m_grid->addWidget(widget, 1, 0, 1, 3);
m_widget = widget; m_widget = widget;
m_widget->setVisible(m_detailsButton->isToggled()); bool visible = m_detailsButton->isToggled();
m_widget->setVisible(visible);
m_dummyWidget->setVisible(visible);
} }
} }
...@@ -132,7 +144,7 @@ void DetailsWidget::setToolWidget(QWidget *widget) ...@@ -132,7 +144,7 @@ void DetailsWidget::setToolWidget(QWidget *widget)
m_toolWidget = 0; m_toolWidget = 0;
} }
if (widget) { if (widget) {
m_grid->addWidget(widget, 1, 1); m_grid->addWidget(widget, 0, 1, 1, 1, Qt::AlignBottom);
m_toolWidget = widget; m_toolWidget = widget;
} }
} }
......
...@@ -47,6 +47,7 @@ private: ...@@ -47,6 +47,7 @@ private:
QWidget *m_widget; QWidget *m_widget;
QWidget *m_toolWidget; QWidget *m_toolWidget;
QWidget *m_dummyWidget;
QGridLayout *m_grid; QGridLayout *m_grid;
}; };
} }
......
...@@ -52,6 +52,7 @@ BuildStepsPage::BuildStepsPage(Project *project, bool clean) : ...@@ -52,6 +52,7 @@ BuildStepsPage::BuildStepsPage(Project *project, bool clean) :
{ {
m_vbox = new QVBoxLayout(this); m_vbox = new QVBoxLayout(this);
m_vbox->setContentsMargins(0, 0, 0, 0); m_vbox->setContentsMargins(0, 0, 0, 0);
m_vbox->setSpacing(0);
const QList<BuildStep *> &steps = m_clean ? m_pro->cleanSteps() : m_pro->buildSteps(); const QList<BuildStep *> &steps = m_clean ? m_pro->cleanSteps() : m_pro->buildSteps();
foreach (BuildStep *bs, steps) { foreach (BuildStep *bs, steps) {
addBuildStepWidget(-1, bs); addBuildStepWidget(-1, bs);
...@@ -163,8 +164,12 @@ void BuildStepsPage::addBuildStepWidget(int pos, BuildStep *step) ...@@ -163,8 +164,12 @@ void BuildStepsPage::addBuildStepWidget(int pos, BuildStep *step)
s.upButton = new QToolButton(this); s.upButton = new QToolButton(this);
s.upButton->setArrowType(Qt::UpArrow); s.upButton->setArrowType(Qt::UpArrow);
s.upButton->setMaximumHeight(22);
s.upButton->setMaximumWidth(22);
s.downButton = new QToolButton(this); s.downButton = new QToolButton(this);
s.downButton->setArrowType(Qt::DownArrow); s.downButton->setArrowType(Qt::DownArrow);
s.downButton->setMaximumHeight(22);
s.downButton->setMaximumWidth(22);
#ifdef Q_OS_MAC #ifdef Q_OS_MAC
s.upButton->setIconSize(QSize(10, 10)); s.upButton->setIconSize(QSize(10, 10));
s.downButton->setIconSize(QSize(10, 10)); s.downButton->setIconSize(QSize(10, 10));
...@@ -174,6 +179,7 @@ void BuildStepsPage::addBuildStepWidget(int pos, BuildStep *step) ...@@ -174,6 +179,7 @@ void BuildStepsPage::addBuildStepWidget(int pos, BuildStep *step)
toolWidget->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); toolWidget->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
s.hbox = new QHBoxLayout(toolWidget); s.hbox = new QHBoxLayout(toolWidget);
s.hbox->setMargin(0); s.hbox->setMargin(0);
s.hbox->setSpacing(0);
s.hbox->addWidget(s.upButton); s.hbox->addWidget(s.upButton);
s.hbox->addWidget(s.downButton); s.hbox->addWidget(s.downButton);
s.detailsWidget->setToolWidget(toolWidget); s.detailsWidget->setToolWidget(toolWidget);
......
...@@ -104,7 +104,7 @@ void PanelsWidget::addWidget(QWidget *widget) ...@@ -104,7 +104,7 @@ void PanelsWidget::addWidget(QWidget *widget)
p.panelWidget = widget; p.panelWidget = widget;
p.marginLayout = 0; p.marginLayout = 0;
m_layout->insertWidget(m_layout->count() -1, widget); m_layout->insertWidget(m_layout->count() - 1, widget);
m_panels.append(p); m_panels.append(p);
} }
......
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