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