26 #include <QCommandLinkButton>
27 #include <QDesktopServices>
30 #include <QVBoxLayout>
33 const int buttonHeight = 45;
34 const int buttonWidth = 140;
36 const QString centralWidgetStyle =
37 "QWidget#containerWidget "
38 "{border-left: 1px solid gray; border-right: 1px solid gray;background-color:white;}";
42 : m_mainWindow(parent)
43 , m_newProjectButton(nullptr)
44 , m_openProjectButton(nullptr)
45 , m_newUsertButton(nullptr)
46 , m_currentProjectLabel(nullptr)
47 , m_recentProjectLayout(nullptr)
51 palette.setColor(QPalette::Window, QColor(240, 240, 240, 255));
52 setAutoFillBackground(
true);
55 auto centralWidgetLayout =
new QVBoxLayout;
56 centralWidgetLayout->setMargin(0);
59 centralWidgetLayout->addStretch(1);
61 auto centralWidget =
new QWidget;
62 centralWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
63 centralWidget->setObjectName(
"containerWidget");
64 centralWidget->setMaximumWidth(1200);
65 centralWidget->setContentsMargins(0, 30, 0, 0);
66 centralWidget->setStyleSheet(centralWidgetStyle);
67 centralWidget->setLayout(centralWidgetLayout);
69 auto mainLayout =
new QHBoxLayout;
70 mainLayout->setContentsMargins(0, 0, 0, 0);
71 mainLayout->addWidget(
new QWidget);
72 mainLayout->addWidget(centralWidget);
73 mainLayout->addWidget(
new QWidget);
74 setLayout(mainLayout);
88 auto recentProLabel =
new QLabel(
"Recent Projects:");
96 palette.setColor(QPalette::ButtonText, QColor(41, 73, 150));
98 auto button =
new QCommandLinkButton;
101 button->setPalette(palette);
102 button->setFixedHeight(30);
112 QString result(
"Untitled");
114 if (projectDocument->hasValidNameAndPath())
116 QDir::toNativeSeparators(projectDocument->projectFileName()));
118 result = projectDocument->projectName();
136 QDesktopServices::openUrl(url);
141 QDesktopServices::openUrl(QUrl(
"http://www.bornagainproject.org"));
158 auto layout =
new QHBoxLayout;
162 layout->addStretch(1);
164 auto result =
new QWidget;
165 result->setLayout(layout);
166 result->setFixedHeight(430);
189 auto buttonLayout =
new QVBoxLayout;
192 buttonLayout->addStretch(1);
195 auto result =
new QHBoxLayout;
196 result->setContentsMargins(30, 0, 30, 0);
197 result->addLayout(buttonLayout);
204 auto result =
new QVBoxLayout;
205 result->setContentsMargins(30, 0, 0, 0);
207 auto label =
new QLabel(
"Current Project:");
211 result->addWidget(label);
226 auto result =
new QVBoxLayout;
228 result->addSpacing(15);
235 auto result =
new QFrame;
236 result->setFrameShape(QFrame::VLine);
237 result->setFrameShadow(QFrame::Sunken);
Defines class DesignerHelper.
Defines class FancyLabel.
Defines class MainWindow.
Defines class ProjectManager.
Defines LayoutUtils namespace.
DefinesStyleUtils namespace.
Defines class WelcomeView.
The FancyLabel class is a QLabel-like class with trivial animation when text slowly appears on the sc...
void setTextAnimated(const QString &animated_text)
ProjectManager * projectManager()
Handles activity related to opening/save projects.
void openProject(QString fileName="")
Opens existing project. If fileName is empty, will popup file selection dialog.
void newProject()
Processes new project request (close old project, rise dialog for project name, create project).
QWidget * createProjectWidget()
void generateRecentProjectList()
QBoxLayout * createProjectLayout()
WelcomeView(MainWindow *parent)
QPushButton * m_openProjectButton
QBoxLayout * createRecentProjectLayout()
void updateRecentProjectPanel()
ProjectManager * projectManager()
QPushButton * m_newProjectButton
QString currentProjectFancyName()
returns current project name suited for displaying on current project layout
UpdateNotifierWidget * m_notifierWidget
FancyLabel * m_currentProjectLabel
MainWindow * m_mainWindow
void onWebLinkClicked(const QUrl &url)
QBoxLayout * createCurrentProjectLayout()
QBoxLayout * createButtonLayout()
QVBoxLayout * m_recentProjectLayout
void showEvent(QShowEvent *)
QPushButton * m_newUsertButton
void setCurrentProjectName(const QString &name)
updates label with current project name in picturesque manner
QFrame * createSeparationFrame()
Defines namespace Constants.
QString withTildeHomePath(const QString &path)
void clearLayout(QLayout *layout, bool deleteWidgets=true)
Removes content from box layout.
QString const & name(EShape k)
QFont labelFont(bool bold=false)
Returns font for labels.
QFont sectionFont(bool bold=false)
Returns font for sections.
Defines class ProjectDocument.
Defines functions from Utils namespace.