Commit 9ff35e3e authored by Bryant's avatar Bryant

All subwindows are now centered on the screen.

parent 129069d4
......@@ -62,6 +62,11 @@ CommConfigurationWindow::CommConfigurationWindow(LinkInterface* link, ProtocolIn
// Setup the user interface according to link type
ui.setupUi(this);
// Center the window on the screen.
QRect position = frameGeometry();
position.moveCenter(QDesktopWidget().availableGeometry().center());
move(position.topLeft());
// Initialize basic ui state
// Do not allow changes here unless advanced is checked
......
#include "JoystickWidget.h"
#include "ui_JoystickWidget.h"
#include <QDebug>
#include <QDesktopWidget>
JoystickWidget::JoystickWidget(JoystickInput* joystick, QWidget *parent) :
QDialog(parent),
m_ui(new Ui::JoystickWidget)
{
m_ui->setupUi(this);
clearKeys();
// Center the window on the screen.
QRect position = frameGeometry();
position.moveCenter(QDesktopWidget().availableGeometry().center());
move(position.topLeft());
clearKeys();
this->joystick = joystick;
m_ui->rollMapSpinBox->setValue(joystick->getMappingXAxis());
......
......@@ -18,6 +18,11 @@ QGCSettingsWidget::QGCSettingsWidget(QWidget *parent, Qt::WindowFlags flags) :
{
ui->setupUi(this);
// Center the window on the screen.
QRect position = frameGeometry();
position.moveCenter(QDesktopWidget().availableGeometry().center());
move(position.topLeft());
// Add all protocols
QList<ProtocolInterface*> protocols = LinkManager::instance()->getProtocols();
foreach (ProtocolInterface* protocol, protocols) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment