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:
@@ -1,3 +1,7 @@
|
||||
* {
|
||||
font-size: 12pt;
|
||||
}
|
||||
|
||||
#title {
|
||||
color: black;
|
||||
font-size: 16pt;
|
||||
@@ -6,7 +10,7 @@
|
||||
|
||||
#section, #projectTitle {
|
||||
color: black;
|
||||
font-size: 15pt;
|
||||
font-size: 14pt;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
@@ -34,8 +38,8 @@
|
||||
#helpButton, #dotsButton, #refreshButton {
|
||||
border: none;
|
||||
color: white;
|
||||
height: 16px;
|
||||
width: 16px;
|
||||
height: 1em;
|
||||
width: 1em;
|
||||
}
|
||||
|
||||
#helpButton {
|
||||
@@ -65,9 +69,7 @@
|
||||
#name, #picker {
|
||||
border-radius: 10px;
|
||||
border: 1px solid lightgrey;
|
||||
height: 20px;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
padding: 2px 5px 0px;
|
||||
}
|
||||
|
||||
#locationField {
|
||||
@@ -75,7 +77,7 @@
|
||||
border: none;
|
||||
border-radius: 5px;
|
||||
margin-left: 5px;
|
||||
height: 20px;
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
#dotsButton, #refreshButton {
|
||||
@@ -87,9 +89,9 @@
|
||||
border: 1px solid lightgray;
|
||||
border-radius: 8px;
|
||||
color: black;
|
||||
padding: 3px 5px 2px;
|
||||
font-size: 14pt;
|
||||
height: 22px;
|
||||
width: 90px;
|
||||
min-width: 5em;
|
||||
}
|
||||
|
||||
#menuButton {
|
||||
@@ -130,8 +132,8 @@
|
||||
background: white;
|
||||
border-radius: 8px;
|
||||
font-size: 12pt;
|
||||
width: 110px;
|
||||
height: 100px;
|
||||
width: 7em;
|
||||
height: 7em;
|
||||
}
|
||||
|
||||
#projectButton:hover, #projectButton:checked {
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
* {
|
||||
font-size: 12pt;
|
||||
}
|
||||
|
||||
QtDirectoryListBox {
|
||||
background-color: rgba(255, 255, 255, 200);
|
||||
background-color: white;
|
||||
border: 1px solid lightgray;
|
||||
border-radius: 12px;
|
||||
}
|
||||
@@ -22,7 +26,6 @@ QListWidget::item:selected {
|
||||
QtListItemWidget #field {
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
font-size: 12px;
|
||||
margin-top: 2px;
|
||||
margin-left: 5px;
|
||||
}
|
||||
@@ -33,9 +36,9 @@ QtListItemWidget #field {
|
||||
|
||||
#plusButton, #minusButton, #dotsButton {
|
||||
color: white;
|
||||
height: 16px;
|
||||
height: 1em;
|
||||
margin-right: 3px;
|
||||
width: 16px;
|
||||
width: 1em;
|
||||
border: none;
|
||||
}
|
||||
|
||||
|
||||
+12
-3
@@ -69,7 +69,7 @@ Application::~Application()
|
||||
m_mainView->saveLayout();
|
||||
}
|
||||
|
||||
void Application::loadProject(const FilePath& projectSettingsFilePath, bool forceRefresh)
|
||||
void Application::loadProject(const FilePath& projectSettingsFilePath)
|
||||
{
|
||||
MessageStatus("Loading Project: " + projectSettingsFilePath.str()).dispatch();
|
||||
|
||||
@@ -84,7 +84,7 @@ void Application::loadProject(const FilePath& projectSettingsFilePath, bool forc
|
||||
m_componentManager->refreshViews();
|
||||
|
||||
m_project = Project::create(m_storageCache.get());
|
||||
m_project->load(projectSettingsFilePath, forceRefresh);
|
||||
m_project->load(projectSettingsFilePath);
|
||||
|
||||
m_mainView->updateRecentProjectMenu();
|
||||
m_mainView->hideStartScreen();
|
||||
@@ -127,7 +127,16 @@ void Application::handleMessage(MessageFinishedParsing* message)
|
||||
|
||||
void Application::handleMessage(MessageLoadProject* message)
|
||||
{
|
||||
loadProject(message->projectSettingsFilePath, message->forceRefresh);
|
||||
if (message->forceRefresh)
|
||||
{
|
||||
m_project->clearStorage();
|
||||
}
|
||||
else if (FilePath(message->projectSettingsFilePath) == m_project->getProjectSettingsFilePath())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
loadProject(message->projectSettingsFilePath);
|
||||
}
|
||||
|
||||
void Application::handleMessage(MessageRefresh* message)
|
||||
|
||||
@@ -32,7 +32,7 @@ public:
|
||||
|
||||
~Application();
|
||||
|
||||
void loadProject(const FilePath& projectSettingsFilePath, bool forceRefresh);
|
||||
void loadProject(const FilePath& projectSettingsFilePath);
|
||||
void refreshProject();
|
||||
void saveProject(const FilePath& projectSettingsFilePath);
|
||||
void showLicenseScreen();
|
||||
|
||||
+7
-7
@@ -25,7 +25,12 @@ Project::~Project()
|
||||
{
|
||||
}
|
||||
|
||||
bool Project::load(const FilePath& projectSettingsFile, bool forceRefresh)
|
||||
const FilePath& Project::getProjectSettingsFilePath() const
|
||||
{
|
||||
return m_projectSettingsFilepath;
|
||||
}
|
||||
|
||||
bool Project::load(const FilePath& projectSettingsFile)
|
||||
{
|
||||
bool success = ProjectSettings::getInstance()->load(projectSettingsFile);
|
||||
if (success)
|
||||
@@ -34,12 +39,6 @@ bool Project::load(const FilePath& projectSettingsFile, bool forceRefresh)
|
||||
updateFileManager();
|
||||
}
|
||||
|
||||
if (forceRefresh)
|
||||
{
|
||||
clearStorage();
|
||||
m_storageWasLoaded = false;
|
||||
}
|
||||
|
||||
if (m_storageWasLoaded)
|
||||
{
|
||||
m_storage->startParsing();
|
||||
@@ -93,6 +92,7 @@ void Project::clearStorage()
|
||||
if (m_storage)
|
||||
{
|
||||
m_storage->clear();
|
||||
m_storageWasLoaded = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-1
@@ -17,7 +17,9 @@ public:
|
||||
|
||||
~Project();
|
||||
|
||||
bool load(const FilePath& projectSettingsFile, bool forceRefresh);
|
||||
const FilePath& getProjectSettingsFilePath() const;
|
||||
|
||||
bool load(const FilePath& projectSettingsFile);
|
||||
bool save(const FilePath& projectSettingsFile);
|
||||
void reload();
|
||||
|
||||
|
||||
@@ -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