Commit 7048ce94 authored by Lorenz Meier's avatar Lorenz Meier

Checkpoint: This is looking sweet

parent 1aa7b9b9
......@@ -358,6 +358,16 @@ QPushButton, QToolButton {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #777, stop: 1 #333);
}
QPushButton#advancedMenuButton, QPushButton#airframeMenuButton, QPushButton#firmwareMenuButton,
QPushButton#generalMenuButton, QPushButton#rcMenuButton, QPushButton#sensorMenuButton {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #333, stop: 1 #111);
border-radius: 5px;
min-height: 64px;
max-height: 64px;
min-width: 80px;
border: 1px solid #000000;
}
QPushButton#planePushButton, QPushButton#flyingWingPushButton, QPushButton#quadXPushButton,
QPushButton#quadPlusPushButton, QPushButton#hexaXPushButton, QPushButton#hexaPlusPushButton,
QPushButton#octoXPushButton, QPushButton#octoPlusPushButton, QPushButton#hPushButton {
......@@ -392,6 +402,12 @@ QWidget#containerWidget {
border: 2px solid #CCCCCC;
}
QWidget#navBarWidget {
background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 #404040, stop:1 #727272);
border-radius: 0px;
border: 1px solid #222222;
}
QPushButton#connectButton, QPushButton#controlButton {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #73D95D, stop: 1 #18A154);
}
......
......@@ -175,6 +175,11 @@
<file>files/images/px4/calibration/accel_z-.png</file>
<file>files/images/px4/calibration/accel_y+.png</file>
<file>files/images/px4/calibration/mag_calibration_figure8.png</file>
<file>files/images/px4/menu/sensors.png</file>
<file>files/images/px4/menu/firmware_upgrade.png</file>
<file>files/images/px4/menu/plane.png</file>
<file>files/images/px4/menu/remote.png</file>
<file>files/images/px4/menu/cogwheels.png</file>
</qresource>
<qresource prefix="/general">
<file alias="vera.ttf">files/styles/Vera.ttf</file>
......
......@@ -18,8 +18,14 @@ QGCConfigView::QGCConfigView(QWidget *parent) :
// The config screens are required for firmware uploading
if (MainWindow::instance()->getCustomMode() == MainWindow::CUSTOM_MODE_PX4) {
ui->gridLayout->removeWidget(ui->waitingLabel);
ui->waitingLabel->setVisible(false);
delete ui->waitingLabel;
config = new QGCPX4VehicleConfig();
ui->gridLayout->addWidget(config);
} else {
//don't show a configuration widget if no vehicle is connected
//show a placeholder informational widget instead
......@@ -37,23 +43,28 @@ void QGCConfigView::activeUASChanged(UASInterface* uas)
if (mav == uas)
return;
//remove all child widgets since they could contain stale data
//for example, when we switch from one PX4 UAS to another UAS
foreach (QObject* obj, ui->gridLayout->children()) {
QWidget* w = dynamic_cast<QWidget*>(obj);
if (w) {
if (obj != ui->waitingLabel) {
ui->gridLayout->removeWidget(w);
delete obj;
}
}
}
int type = -1;
if (mav)
type = mav->getAutopilotType();
mav = uas;
if (NULL != mav) {
if (NULL != uas && type != uas->getAutopilotType()) {
ui->gridLayout->removeWidget(ui->waitingLabel);
ui->waitingLabel->setVisible(false);
//remove all child widgets since they could contain stale data
//for example, when we switch from one PX4 UAS to another UAS
foreach (QObject* obj, ui->gridLayout->children()) {
QWidget* w = dynamic_cast<QWidget*>(obj);
if (w) {
if (obj != ui->waitingLabel) {
ui->gridLayout->removeWidget(w);
delete obj;
}
}
}
int autopilotType = mav->getAutopilotType();
switch (autopilotType) {
case MAV_AUTOPILOT_PX4:
......
......@@ -14,6 +14,9 @@
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="margin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="waitingLabel">
<property name="text">
......
......@@ -89,6 +89,7 @@ QGCPX4VehicleConfig::QGCPX4VehicleConfig(QWidget *parent) :
ui->airframeMenuButton->setEnabled(false);
ui->sensorMenuButton->setEnabled(false);
ui->rcMenuButton->setEnabled(false);
ui->generalMenuButton->hide();
px4AirframeConfig = new QGCPX4AirframeConfig(this);
ui->airframeLayout->addWidget(px4AirframeConfig);
......@@ -554,7 +555,7 @@ void QGCPX4VehicleConfig::loadQgcConfig(bool primary)
// Load tabs for general configuration
foreach (QString dir,generaldir.entryList(QDir::Dirs | QDir::NoDotAndDotDot))
{
QPushButton *button = new QPushButton(ui->leftNavScrollAreaWidgetContents);
QPushButton *button = new QPushButton(this);
connect(button,SIGNAL(clicked()),this,SLOT(menuButtonClicked()));
ui->navBarLayout->insertWidget(2,button);
button->setMinimumHeight(75);
......@@ -598,7 +599,7 @@ void QGCPX4VehicleConfig::loadQgcConfig(bool primary)
// Load additional tabs for vehicle specific configuration
foreach (QString dir,vehicledir.entryList(QDir::Dirs | QDir::NoDotAndDotDot))
{
QPushButton *button = new QPushButton(ui->leftNavScrollAreaWidgetContents);
QPushButton *button = new QPushButton(this);
connect(button,SIGNAL(clicked()),this,SLOT(menuButtonClicked()));
ui->navBarLayout->insertWidget(2,button);
......
This diff is collapsed.
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