Browse Source

All subwindows are now centered on the screen.

QGC4.4
Bryant 12 years ago
parent
commit
d91453a3c5
  1. 5
      src/ui/CommConfigurationWindow.cc
  2. 9
      src/ui/JoystickWidget.cc
  3. 5
      src/ui/QGCSettingsWidget.cc

5
src/ui/CommConfigurationWindow.cc

@ -62,6 +62,11 @@ CommConfigurationWindow::CommConfigurationWindow(LinkInterface* link, ProtocolIn @@ -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

9
src/ui/JoystickWidget.cc

@ -1,13 +1,20 @@ @@ -1,13 +1,20 @@
#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());

5
src/ui/QGCSettingsWidget.cc

@ -18,6 +18,11 @@ QGCSettingsWidget::QGCSettingsWidget(QWidget *parent, Qt::WindowFlags flags) : @@ -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) {

Loading…
Cancel
Save