You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.3 KiB
47 lines
1.3 KiB
#include "window.hpp"
|
|
|
|
MainWindow::MainWindow(QWidget *parent) : QWidget(parent) {
|
|
main_layout = new QStackedLayout;
|
|
|
|
homeWindow = new HomeWindow(this);
|
|
main_layout->addWidget(homeWindow);
|
|
|
|
settingsWindow = new SettingsWindow(this);
|
|
main_layout->addWidget(settingsWindow);
|
|
|
|
onboardingWindow = new OnboardingWindow(this);
|
|
main_layout->addWidget(onboardingWindow);
|
|
|
|
main_layout->setMargin(0);
|
|
setLayout(main_layout);
|
|
QObject::connect(homeWindow, SIGNAL(openSettings()), this, SLOT(openSettings()));
|
|
QObject::connect(settingsWindow, SIGNAL(closeSettings()), this, SLOT(closeSettings()));
|
|
|
|
// start at onboarding
|
|
main_layout->setCurrentWidget(onboardingWindow);
|
|
QObject::connect(onboardingWindow, SIGNAL(onboardingDone()), this, SLOT(closeSettings()));
|
|
onboardingWindow->updateActiveScreen();
|
|
|
|
setStyleSheet(R"(
|
|
* {
|
|
color: white;
|
|
background-color: #072339;
|
|
}
|
|
)");
|
|
}
|
|
|
|
void MainWindow::openSettings() {
|
|
main_layout->setCurrentWidget(settingsWindow);
|
|
settingsWindow->refreshParams();
|
|
}
|
|
|
|
void MainWindow::closeSettings() {
|
|
main_layout->setCurrentWidget(homeWindow);
|
|
}
|
|
|
|
bool MainWindow::eventFilter(QObject *obj, QEvent *event){
|
|
if (event->type() == QEvent::MouseButtonPress) {
|
|
homeWindow->glWindow->wake();
|
|
}
|
|
return false;
|
|
}
|
|
|