Commit ffdf11d5 authored by con's avatar con
Browse files

Try to beautify the project settings page a bit on Mac.

parent fff4ed47
......@@ -70,6 +70,11 @@ BuildStepsPage::BuildStepsPage(Project *project, bool clean) :
hboxLayout->addWidget(m_removeButton);
hboxLayout->addStretch(10);
#ifdef Q_OS_MAC
m_addButton->setAttribute(Qt::WA_MacSmallSize);
m_removeButton->setAttribute(Qt::WA_MacSmallSize);
#endif
m_vbox->addLayout(hboxLayout);
updateBuildStepButtonsState();
......@@ -96,10 +101,10 @@ BuildStepsPage::~BuildStepsPage()
void BuildStepsPage::toggleDetails()
{
QToolButton *tb = qobject_cast<QToolButton *>(sender());
if (tb) {
QAbstractButton *button = qobject_cast<QAbstractButton *>(sender());
if (button) {
foreach(const BuildStepsWidgetStruct &s, m_buildSteps) {
if (s.detailsButton == tb) {
if (s.detailsButton == button) {
s.widget->setVisible(!s.widget->isVisible());
fixupLayout(s.widget);
}
......@@ -172,9 +177,18 @@ void BuildStepsPage::addBuildStepWidget(int pos, BuildStep *step)
s.upButton->setArrowType(Qt::UpArrow);
s.downButton = new QToolButton(this);
s.downButton->setArrowType(Qt::DownArrow);
#ifdef Q_OS_MAC
s.detailsButton = new QPushButton(this);
s.detailsButton->setAttribute(Qt::WA_MacSmallSize);
s.detailsButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
s.upButton->setIconSize(QSize(10, 10));
s.downButton->setIconSize(QSize(10, 10));
#else
s.detailsButton = new QToolButton(this);
#endif
s.detailsButton->setText(tr("Details"));
// layout
s.hbox = new QHBoxLayout();
s.hbox->addWidget(s.detailsLabel);
......
......@@ -36,6 +36,7 @@ QT_BEGIN_NAMESPACE
class QTreeWidgetItem;
class QHBoxLayout;
class QPushButton;
class QAbstractButton;
class QToolButton;
class QLabel;
class QVBoxLayout;
......@@ -55,7 +56,7 @@ struct BuildStepsWidgetStruct
{
BuildStepConfigWidget *widget;
QLabel *detailsLabel;
QToolButton *detailsButton;
QAbstractButton *detailsButton;
QToolButton *upButton;
QToolButton *downButton;
QHBoxLayout *hbox;
......
......@@ -230,7 +230,14 @@ DependenciesWidget::DependenciesWidget(SessionManager *session,
m_titleLabel->setText("Dummy Text");
hbox->addWidget(m_titleLabel);
QToolButton *detailsButton = new QToolButton(this);
QAbstractButton *detailsButton;
#ifdef Q_OS_MAC
detailsButton = new QPushButton;
detailsButton->setAttribute(Qt::WA_MacSmallSize);
detailsButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
#else
detailsButton = new QToolButton(this);
#endif
detailsButton->setText(tr("Details"));
connect(detailsButton, SIGNAL(clicked()),
this, SLOT(toggleDetails()));
......
......@@ -438,7 +438,14 @@ EnvironmentWidget::EnvironmentWidget(QWidget *parent, QWidget *additionalDetails
m_summaryText = new QLabel(this);
m_summaryText->setText("");
QToolButton *detailsButton = new QToolButton(this);
QAbstractButton *detailsButton;
#ifdef Q_OS_MAC
detailsButton = new QPushButton(this);
detailsButton->setAttribute(Qt::WA_MacSmallSize);
detailsButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
#else
detailsButton = new QToolButton(this);
#endif
detailsButton->setText(tr("Details"));
connect(detailsButton, SIGNAL(clicked()),
......
......@@ -79,7 +79,22 @@ Qt4ProjectConfigWidget::Qt4ProjectConfigWidget(Qt4Project *project)
m_ui->detailsWidget->setVisible(false);
m_ui->titleLabel->setText("");
connect(m_ui->detailsButton, SIGNAL(clicked()),
QAbstractButton *detailsButton;
#ifdef Q_OS_MAC
detailsButton = new QPushButton;
detailsButton->setAttribute(Qt::WA_MacSmallSize);
detailsButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
#else
detailsButton = new QToolButton;
#endif
detailsButton->setText(tr("Details"));
QHBoxLayout *layout = new QHBoxLayout;
layout->setMargin(0);
layout->setSpacing(0);
layout->addWidget(detailsButton);
m_ui->detailsButtonWidget->setLayout(layout);
connect(detailsButton, SIGNAL(clicked()),
this, SLOT(toggleDetails()));
connect(m_ui->nameLineEdit, SIGNAL(textEdited(QString)),
......
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>463</width>
<height>221</height>
<width>557</width>
<height>237</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
......@@ -38,9 +38,12 @@ placeholder</string>
</widget>
</item>
<item row="0" column="1">
<widget class="QToolButton" name="detailsButton">
<property name="text">
<string>Details</string>
<widget class="QWidget" name="detailsButtonWidget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
......
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