This repository has been archived on 2022-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
modern-linbo-gui/sources/linbogui.cpp
Dorian Zedler d2a165a1ec
- Sorted some stuff
- Began to implement new GUI
2020-11-16 00:31:28 +01:00

79 lines
3 KiB
C++

#include "../headers/linbogui.h"
linboGui::linboGui()
{
// fill whole screen
Qt::WindowFlags flags;
flags = Qt::FramelessWindowHint | Qt::WindowStaysOnBottomHint;
setWindowFlags( flags );
setAttribute( Qt::WA_AlwaysShowToolTips );
this->setGeometry(QApplication::desktop()->screenGeometry());
this->setFixedHeight(QApplication::desktop()->screenGeometry().height());
this->setFixedWidth(QApplication::desktop()->screenGeometry().width());
// black bakground
this->setStyleSheet( "QDialog { background: white }");
linboGUIImpl* legacyGui = new linboGUIImpl(this);
legacyGui->setStyleSheet( "QDialog { background: white }");
//legacyGui->show();
// create the main layout
// OS Buttons
LinboOsSelectButton* osButton = new LinboOsSelectButton(":/svgIcons/ubuntu.svg", this);
osButton->setFixedHeight(250);
osButton->setFixedWidth(250);
osButton->setChecked(true);
LinboOsSelectButton* osButton_1 = new LinboOsSelectButton(":/svgIcons/windows.svg", this);
osButton_1->setFixedHeight(250);
osButton_1->setFixedWidth(250);
QButtonGroup* group = new QButtonGroup();
group->setExclusive(true);
group->addButton(osButton);
group->addButton(osButton_1);
// OS Button Layout
QHBoxLayout* osButtonRow = new QHBoxLayout();
osButtonRow->addWidget(osButton);
osButtonRow->addWidget(osButton_1);
// action buttons
QModernPushButton* defaultActionButton = new QModernPushButton(":/svgIcons/startAction.svg");
defaultActionButton->setFixedHeight(110);
defaultActionButton->setFixedWidth(110);
QModernPushButton* secondActionButton = new QModernPushButton(":/svgIcons/syncAction.svg");
secondActionButton->setFixedHeight(50);
secondActionButton->setFixedWidth(50);
QModernPushButton* thirdActionButton = new QModernPushButton(":/svgIcons/resetAction.svg");
thirdActionButton->setFixedHeight(50);
thirdActionButton->setFixedWidth(50);
QHBoxLayout* actionButtonLayout = new QHBoxLayout();
actionButtonLayout->addItem(new QSpacerItem(10,10, QSizePolicy::Expanding, QSizePolicy::Minimum));
actionButtonLayout->addWidget(secondActionButton);
actionButtonLayout->addWidget(thirdActionButton);
actionButtonLayout->addItem(new QSpacerItem(10,10, QSizePolicy::Expanding, QSizePolicy::Minimum));
// main layout
QVBoxLayout* mainLayout = new QVBoxLayout(this);
mainLayout->addItem(new QSpacerItem(10,10, QSizePolicy::Minimum, QSizePolicy::Expanding));
mainLayout->addLayout(osButtonRow);
mainLayout->addItem(new QSpacerItem(10,10, QSizePolicy::Minimum, QSizePolicy::Expanding));
mainLayout->addWidget(defaultActionButton);
mainLayout->setAlignment(defaultActionButton, Qt::AlignHCenter);
mainLayout->addLayout(actionButtonLayout);
mainLayout->addItem(new QSpacerItem(10,10, QSizePolicy::Minimum, QSizePolicy::Expanding));
}
// prevent closing (eg. by pressing escape key)
void linboGui::done(int r) {
Q_UNUSED(r)
}