2017-04-16 01:00:50 -05:00
|
|
|
/*
|
|
|
|
* Copyright 2016-2017 gtalent2@gmail.com
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <QApplication>
|
|
|
|
#include <QDesktopWidget>
|
2017-04-16 02:56:47 -05:00
|
|
|
#include "mainwindow.hpp"
|
2017-04-16 01:00:50 -05:00
|
|
|
|
|
|
|
namespace nostalgia {
|
|
|
|
namespace studio {
|
|
|
|
|
2017-04-16 02:56:47 -05:00
|
|
|
MainWindow::MainWindow(NostalgiaStudioProfile config, QWidget *parent) {
|
2017-04-16 01:00:50 -05:00
|
|
|
auto screenSize = QApplication::desktop()->screenGeometry();
|
|
|
|
|
2017-04-16 02:56:47 -05:00
|
|
|
// set window to 70% of screen width, and center NostalgiaStudioProfile
|
2017-04-16 01:00:50 -05:00
|
|
|
auto sizePct = 0.7;
|
|
|
|
resize(screenSize.width() * sizePct, screenSize.height() * sizePct);
|
|
|
|
move(-x(), -y());
|
|
|
|
move(screenSize.width() * (1 - sizePct) / 2, screenSize.height() * (1 - sizePct) / 2);
|
|
|
|
|
2017-04-16 02:56:47 -05:00
|
|
|
setWindowTitle(config.app_name);
|
2017-04-16 01:00:50 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
MainWindow::~MainWindow() {
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|