ui: Fixes in project wizzard
* stretch at end of preferences * space at scrollbar * default font size * only refresh project when something changed * fixed sizing of text fields * icons fit to font size * use em base sizes * added language to project type label
This commit is contained in:
@@ -29,6 +29,7 @@ QtLocationPicker::QtLocationPicker(QWidget *parent)
|
||||
layout->addWidget(m_button);
|
||||
|
||||
setLayout(layout);
|
||||
setSizePolicy(sizePolicy().horizontalPolicy(), QSizePolicy::Fixed);
|
||||
}
|
||||
|
||||
void QtLocationPicker::paintEvent(QPaintEvent*)
|
||||
|
||||
@@ -67,7 +67,7 @@ bool QtProjectWizzardContent::isScrollAble() const
|
||||
|
||||
QSize QtProjectWizzardContent::preferredWindowSize() const
|
||||
{
|
||||
return QSize(600, 620);
|
||||
return QSize(750, 620);
|
||||
}
|
||||
|
||||
QLabel* QtProjectWizzardContent::createFormLabel(QString name) const
|
||||
|
||||
@@ -31,7 +31,7 @@ void QtProjectWizzardContentBuildFile::populateForm(QGridLayout* layout, int& ro
|
||||
case QtProjectWizzardContentSelect::PROJECT_EMPTY:
|
||||
name = "Build Text";
|
||||
filter = "Text (*.txt)";
|
||||
return;
|
||||
break;
|
||||
case QtProjectWizzardContentSelect::PROJECT_VS:
|
||||
name = "Visual Studio Solution";
|
||||
filter = "Visual Studio Solution (*.sln)";
|
||||
@@ -47,9 +47,6 @@ void QtProjectWizzardContentBuildFile::populateForm(QGridLayout* layout, int& ro
|
||||
m_picker = new QtLocationPicker(this);
|
||||
m_picker->setFileFilter(filter);
|
||||
|
||||
int minimumWidthForSecondCol = 360;
|
||||
m_picker->setMinimumWidth(minimumWidthForSecondCol);
|
||||
|
||||
QPushButton* button = new QPushButton("", this);
|
||||
button->setObjectName("refreshButton");
|
||||
button->setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac
|
||||
|
||||
@@ -25,26 +25,21 @@ void QtProjectWizzardContentData::populateWindow(QGridLayout* layout)
|
||||
|
||||
void QtProjectWizzardContentData::populateForm(QGridLayout* layout, int& row)
|
||||
{
|
||||
int minimumWidthForSecondCol = 360;
|
||||
|
||||
QLabel* nameLabel = createFormLabel("Name");
|
||||
m_projectName = new QLineEdit();
|
||||
m_projectName->setObjectName("name");
|
||||
m_projectName->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
|
||||
m_projectName->setMinimumWidth(minimumWidthForSecondCol);
|
||||
m_projectName->setAttribute(Qt::WA_MacShowFocusRect, 0);
|
||||
|
||||
layout->addWidget(nameLabel, row, QtProjectWizzardWindow::FRONT_COL, Qt::AlignRight);
|
||||
layout->addWidget(m_projectName, row, QtProjectWizzardWindow::BACK_COL, Qt::AlignLeft);
|
||||
layout->addWidget(m_projectName, row, QtProjectWizzardWindow::BACK_COL);
|
||||
row++;
|
||||
|
||||
QLabel* locationLabel = createFormLabel("Location");
|
||||
m_projectFileLocation = new QtLocationPicker(this);
|
||||
m_projectFileLocation->setPickDirectory(true);
|
||||
m_projectFileLocation->setMinimumWidth(minimumWidthForSecondCol);
|
||||
|
||||
layout->addWidget(locationLabel, row, QtProjectWizzardWindow::FRONT_COL, Qt::AlignRight);
|
||||
layout->addWidget(m_projectFileLocation, row, QtProjectWizzardWindow::BACK_COL, Qt::AlignLeft);
|
||||
layout->addWidget(m_projectFileLocation, row, QtProjectWizzardWindow::BACK_COL);
|
||||
row++;
|
||||
|
||||
QLabel* languageLabel = new QLabel("Language");
|
||||
@@ -59,7 +54,8 @@ void QtProjectWizzardContentData::populateForm(QGridLayout* layout, int& row)
|
||||
row++;
|
||||
|
||||
|
||||
QLabel* cppStandardLabel = createFormLabel("Standard");
|
||||
QLabel* standardLabel = createFormLabel("Standard");
|
||||
layout->addWidget(standardLabel, row, QtProjectWizzardWindow::FRONT_COL, Qt::AlignRight);
|
||||
|
||||
m_cppStandard = new QComboBox();
|
||||
m_cppStandard->insertItem(0, "1z");
|
||||
@@ -70,12 +66,8 @@ void QtProjectWizzardContentData::populateForm(QGridLayout* layout, int& row)
|
||||
m_cppStandard->insertItem(5, "03");
|
||||
m_cppStandard->insertItem(6, "98");
|
||||
|
||||
layout->addWidget(cppStandardLabel, row, QtProjectWizzardWindow::FRONT_COL, Qt::AlignRight);
|
||||
layout->addWidget(m_cppStandard, row, QtProjectWizzardWindow::BACK_COL, Qt::AlignLeft);
|
||||
|
||||
|
||||
QLabel* cStandardLabel = createFormLabel("Standard");
|
||||
|
||||
m_cStandard = new QComboBox();
|
||||
m_cStandard->insertItem(0, "1x");
|
||||
m_cStandard->insertItem(1, "11");
|
||||
@@ -84,7 +76,6 @@ void QtProjectWizzardContentData::populateForm(QGridLayout* layout, int& row)
|
||||
m_cStandard->insertItem(4, "90");
|
||||
m_cStandard->insertItem(5, "89");
|
||||
|
||||
layout->addWidget(cStandardLabel, row, QtProjectWizzardWindow::FRONT_COL, Qt::AlignRight);
|
||||
layout->addWidget(m_cStandard, row, QtProjectWizzardWindow::BACK_COL, Qt::AlignLeft);
|
||||
|
||||
row++;
|
||||
@@ -110,6 +101,8 @@ void QtProjectWizzardContentData::load()
|
||||
{
|
||||
m_cStandard->setCurrentText(QString::fromStdString(m_settings->getStandard()));
|
||||
}
|
||||
|
||||
handleSelectionChanged(m_language->currentIndex());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -47,10 +47,11 @@ void QtProjectWizzardContentPaths::populateWindow(QGridLayout* layout)
|
||||
|
||||
void QtProjectWizzardContentPaths::populateLayout(QGridLayout* layout, int& row)
|
||||
{
|
||||
QLabel* label = new QLabel(m_titleString);
|
||||
label->setObjectName("section");
|
||||
layout->addWidget(label, row, QtProjectWizzardWindow::FRONT_COL, Qt::AlignTop | Qt::AlignLeft);
|
||||
layout->setRowMinimumHeight(row, 20);
|
||||
QLabel* title = new QLabel(m_titleString);
|
||||
title->setWordWrap(true);
|
||||
title->setObjectName("section");
|
||||
layout->addWidget(title, row, QtProjectWizzardWindow::FRONT_COL, Qt::AlignTop);
|
||||
layout->setRowStretch(row, 0);
|
||||
|
||||
QLabel* text = new QLabel(m_descriptionString);
|
||||
text->setWordWrap(true);
|
||||
@@ -74,9 +75,7 @@ void QtProjectWizzardContentPaths::populateForm(QGridLayout* layout, int& row)
|
||||
addHelpButton(m_helpString, layout, row);
|
||||
}
|
||||
|
||||
int minimumWidthForSecondCol = 360;
|
||||
m_list = new QtDirectoryListBox(this);
|
||||
m_list->setMinimumWidth(minimumWidthForSecondCol);
|
||||
layout->addWidget(m_list, row, QtProjectWizzardWindow::BACK_COL);
|
||||
row++;
|
||||
|
||||
@@ -123,7 +122,7 @@ bool QtProjectWizzardContentPaths::check()
|
||||
|
||||
QSize QtProjectWizzardContentPaths::preferredWindowSize() const
|
||||
{
|
||||
return QSize(700, 500);
|
||||
return QSize(850, 500);
|
||||
}
|
||||
|
||||
void QtProjectWizzardContentPaths::loadPaths()
|
||||
@@ -198,7 +197,7 @@ QtProjectWizzardContentPathsSource::QtProjectWizzardContentPathsSource(
|
||||
|
||||
QSize QtProjectWizzardContentPathsSource::preferredWindowSize() const
|
||||
{
|
||||
return QSize(700, 370);
|
||||
return QSize(850, 370);
|
||||
}
|
||||
|
||||
void QtProjectWizzardContentPathsSource::loadPaths()
|
||||
|
||||
@@ -30,6 +30,8 @@ void QtProjectWizzardContentPreferences::populateWindow(QGridLayout* layout)
|
||||
}
|
||||
|
||||
layout->setRowMinimumHeight(row, 10);
|
||||
|
||||
layout->setRowStretch(row, 1);
|
||||
}
|
||||
|
||||
void QtProjectWizzardContentPreferences::windowReady()
|
||||
|
||||
@@ -44,6 +44,7 @@ void QtProjectWizzardContentSelect::populateWindow(QGridLayout* layout)
|
||||
m_buttons->setExclusive(true);
|
||||
|
||||
m_window->disableNext();
|
||||
m_title->setText("Project Types - " + m_languages->checkedButton()->text());
|
||||
}
|
||||
);
|
||||
|
||||
@@ -95,10 +96,10 @@ void QtProjectWizzardContentSelect::populateWindow(QGridLayout* layout)
|
||||
layout->addWidget(container, 0, QtProjectWizzardWindow::BACK_COL);
|
||||
|
||||
|
||||
QLabel* title = new QLabel("Project Type");
|
||||
title->setObjectName("projectTitle");
|
||||
m_title = new QLabel("Project Types - " + m_languages->checkedButton()->text());
|
||||
m_title->setObjectName("projectTitle");
|
||||
|
||||
layout->addWidget(title, 0, QtProjectWizzardWindow::BACK_COL, Qt::AlignLeft | Qt::AlignTop);
|
||||
layout->addWidget(m_title, 0, QtProjectWizzardWindow::BACK_COL, Qt::AlignLeft | Qt::AlignTop);
|
||||
|
||||
|
||||
layout->setColumnStretch(QtProjectWizzardWindow::FRONT_COL, 0);
|
||||
@@ -137,5 +138,5 @@ bool QtProjectWizzardContentSelect::check()
|
||||
|
||||
QSize QtProjectWizzardContentSelect::preferredWindowSize() const
|
||||
{
|
||||
return QSize(600, 340);
|
||||
return QSize(750, 340);
|
||||
}
|
||||
|
||||
@@ -34,6 +34,8 @@ signals:
|
||||
private:
|
||||
QButtonGroup* m_languages;
|
||||
QButtonGroup* m_buttons;
|
||||
|
||||
QLabel* m_title;
|
||||
};
|
||||
|
||||
#endif // QT_PROJECT_WIZZARD_CONTENT_SELECT_H
|
||||
|
||||
@@ -63,12 +63,14 @@ void QtProjectWizzardContentSimple::populateWindow(QGridLayout* layout)
|
||||
|
||||
void QtProjectWizzardContentSimple::populateForm(QGridLayout* layout, int& row)
|
||||
{
|
||||
QLabel* label = createFormLabel("Search headers in project paths");
|
||||
QLabel* label = createFormLabel("Simple Setup");
|
||||
layout->addWidget(label, row, QtProjectWizzardWindow::FRONT_COL);
|
||||
|
||||
m_checkBox = new QCheckBox();
|
||||
m_checkBox = new QCheckBox("Search headers in project paths");
|
||||
layout->addWidget(m_checkBox, row, QtProjectWizzardWindow::BACK_COL);
|
||||
|
||||
// addHelpButton("help message", layout, row);
|
||||
|
||||
m_isForm = true;
|
||||
row++;
|
||||
}
|
||||
@@ -130,5 +132,5 @@ bool QtProjectWizzardContentSimple::check()
|
||||
|
||||
QSize QtProjectWizzardContentSimple::preferredWindowSize() const
|
||||
{
|
||||
return QSize(580, 350);
|
||||
return QSize(750, 350);
|
||||
}
|
||||
|
||||
@@ -113,6 +113,11 @@ void QtProjectWizzardWindow::populateWindow(QWidget* widget)
|
||||
layout->setColumnStretch(HELP_COL, 0);
|
||||
layout->setColumnStretch(LINE_COL, 0);
|
||||
|
||||
if (m_scrollAble)
|
||||
{
|
||||
layout->setColumnMinimumWidth(BACK_COL + 1, 10);
|
||||
}
|
||||
|
||||
widget->setLayout(layout);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user