Commit da66c5a8 authored by Lorenz Meier's avatar Lorenz Meier

Improved visual quality

parent 304b3999
* { font-family: "Bitstream Vera Sans"; font: "Roman"; font-size: 12px; }
* { font-family: "Bitstream Vera Sans"; font: "Roman"; font-size: 12px; border: 0px solid; }
QWidget#colorIcon {}
QWidget {
......@@ -6,6 +6,8 @@ background-color: #050508;
color: #DDDDDF;
background-clip: border;
font-size: 11px;
border: 0px;
padding: 1px;
}
QGroupBox {
......@@ -186,7 +188,8 @@ QPushButton {
min-height: 20px;
/*min-width: 24px;*/
max-height: 20px;
border: 0px solid #59666f;
border: 1px solid #465158;
margin: 1px;
border-radius: 2px;
padding-left: 8px;
padding-right: 8px;
......@@ -194,13 +197,11 @@ QPushButton {
}
QPushButton:checked {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #404040, stop: 1 #808080);
border: 0px solid #379AC3;
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #09A2B2, stop: 1 #414B52);
}
QPushButton:pressed {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #bbbbbb, stop: 1 #b0b0b0);
border: 0px solid #379AC3;
}
QToolButton {
......@@ -208,7 +209,8 @@ QToolButton {
min-height: 20px;
/*min-width: 24px;*/
max-height: 20px;
border: 0px solid #4A4A4F;
border: 1px solid #4A4A4F;
margin: 1px;
border-radius: 2px;
padding-left: 3px;
padding-right: 3px;
......@@ -216,13 +218,11 @@ QToolButton {
}
QToolButton:checked {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #090909, stop: 1 #353535);
border: 2px solid #379AC3;
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #09A2B2, stop: 1 #414B52);
}
QToolButton:pressed {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #bbbbbb, stop: 1 #b0b0b0);
border: 2px solid #379AC3;
}
QToolTip {
......@@ -259,6 +259,10 @@ QMenuBar::item:disabled:pressed {
border: none;
}
QSlider {
background-color: transparent;
}
QSlider::groove:horizontal {
border: 1px solid #999999;
height: 4px; /* the groove expands to the size of the slider by default. by giving it a height, it has a fixed size */
......@@ -266,6 +270,13 @@ QSlider::groove:horizontal {
margin: 2px 0;
}
QSlider::groove:disabled:horizontal {
border: 1px solid #AAAAAA;
height: 4px; /* the groove expands to the size of the slider by default. by giving it a height, it has a fixed size */
background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #6A6A6F, stop:1 #6A6A6F);
margin: 2px 0;
}
QSlider::handle:horizontal {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #232228, stop: 1 #020208);
border: 2px solid #379AC3;
......@@ -274,6 +285,14 @@ QSlider::groove:horizontal {
border-radius: 3px;
}
QSlider::handle:disabled:horizontal {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #535258, stop: 1 #050508);
border: 2px solid #444444;
width: 18px;
margin: -5px 0; /* handle is placed by default on the contents rect of the groove. Expand outside the groove */
border-radius: 3px;
}
QSlider::groove:vertical {
border: 1px solid #999999;
width: 4px; /* the groove expands to the size of the slider by default. by giving it a height, it has a fixed size */
......
......@@ -135,6 +135,12 @@ MainWindow::MainWindow(QWidget *parent):
ui.setupUi(this);
hide();
// We only need this menu if we have more than one system
ui.menuConnected_Systems->setEnabled(false);
// XXX This menu probably doesn't make sense and should go, not just hide
ui.menuUnmanned_System->setEnabled(false);
// Set dock options
setDockOptions(AnimatedDocks | AllowTabbedDocks | AllowNestedDocks);
......@@ -153,10 +159,14 @@ MainWindow::MainWindow(QWidget *parent):
toolBar = new QGCToolBar(this);
this->addToolBar(toolBar);
// Add actions (inverted order due to insert)
toolBar->addPerspectiveChangeAction(ui.actionSimulation_View);
toolBar->addPerspectiveChangeAction(ui.actionEngineersView);
toolBar->addPerspectiveChangeAction(ui.actionPilotsView);
toolBar->addPerspectiveChangeAction(ui.actionOperatorsView);
QList<QAction*> actions;
actions << ui.actionOperatorsView;
actions << ui.actionPilotsView;
actions << ui.actionEngineersView;
actions << ui.actionSimulation_View;
toolBar->setPerspectiveChangeActions(actions);
customStatusBar = new QGCStatusBar(this);
setStatusBar(customStatusBar);
......@@ -1272,6 +1282,10 @@ void MainWindow::UASSpecsChanged(int uas)
void MainWindow::UASCreated(UASInterface* uas)
{
// Check if this is the 2nd system and we need a switch menu
if (UASManager::instance()->getUASList().count() > 1)
ui.menuConnected_Systems->setEnabled(true);
// Connect the UAS to the full user interface
//if (uas != NULL)
......
......@@ -141,14 +141,6 @@
<string>Main Widget</string>
</property>
</widget>
<widget class="QMenu" name="menuPlugins">
<property name="enabled">
<bool>false</bool>
</property>
<property name="title">
<string>Plugins</string>
</property>
</widget>
<addaction name="menuMGround"/>
<addaction name="menuNetwork"/>
<addaction name="menuConnected_Systems"/>
......@@ -156,7 +148,6 @@
<addaction name="menuPerspectives"/>
<addaction name="menuMain"/>
<addaction name="menuTools"/>
<addaction name="menuPlugins"/>
<addaction name="menuHelp"/>
</widget>
<widget class="QStatusBar" name="statusBar"/>
......@@ -338,7 +329,7 @@
<normaloff>:/files/images/apps/utilities-system-monitor.svg</normaloff>:/files/images/apps/utilities-system-monitor.svg</iconset>
</property>
<property name="text">
<string>Development</string>
<string>Plot</string>
</property>
<property name="shortcut">
<string>Meta+E</string>
......
......@@ -44,6 +44,11 @@ QGCMAVLinkLogPlayer::QGCMAVLinkLogPlayer(MAVLinkProtocol* mavlink, QWidget *pare
setAccelerationFactorInt(49);
ui->speedSlider->setValue(49);
ui->positionSlider->setValue(ui->positionSlider->minimum());
ui->playButton->setEnabled(false);
ui->speedSlider->setEnabled(false);
ui->positionSlider->setEnabled(false);
loadSettings();
}
......@@ -254,6 +259,11 @@ void QGCMAVLinkLogPlayer::setAccelerationFactorInt(int factor)
bool QGCMAVLinkLogPlayer::loadLogFile(const QString& file)
{
// Enable controls
ui->playButton->setEnabled(true);
ui->speedSlider->setEnabled(true);
ui->positionSlider->setEnabled(true);
// Check if logging is still enabled
if (mavlink->loggingEnabled())
{
......
......@@ -14,22 +14,22 @@
<string>Form</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="margin">
<number>4</number>
<property name="leftMargin">
<number>12</number>
</property>
<item>
<widget class="QSlider" name="positionSlider">
<property name="maximum">
<number>10000</number>
<property name="topMargin">
<number>0</number>
</property>
<property name="pageStep">
<number>100</number>
<property name="rightMargin">
<number>4</number>
</property>
<property name="tracking">
<bool>false</bool>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
<item>
<widget class="QLabel" name="logStatsLabel">
<property name="text">
<string>No logfile selected..</string>
</property>
</widget>
</item>
......@@ -57,9 +57,18 @@
</widget>
</item>
<item>
<widget class="QLabel" name="logStatsLabel">
<property name="text">
<string>No logfile selected..</string>
<widget class="QSlider" name="positionSlider">
<property name="maximum">
<number>10000</number>
</property>
<property name="pageStep">
<number>100</number>
</property>
<property name="tracking">
<bool>false</bool>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
......@@ -110,7 +119,7 @@
<item>
<widget class="QLabel" name="logFileNameLabel">
<property name="text">
<string>Please choose logfile</string>
<string>-</string>
</property>
</widget>
</item>
......
......@@ -40,9 +40,11 @@ QGCStatusBar::QGCStatusBar(QWidget *parent) :
toggleLoggingButton = new QPushButton("Logging", this);
toggleLoggingButton->setCheckable(true);
addWidget(toggleLoggingButton);
addPermanentWidget(toggleLoggingButton);
loadSettings();
setStyleSheet("QStatusBar {margin: 1px; border-bottom: 1px solid #252525; border-top: 1px solid #969696; padding: 1px");
}
void QGCStatusBar::setLogPlayer(QGCMAVLinkLogPlayer* player)
......
......@@ -54,11 +54,11 @@ void QGCToolBar::heartbeatTimeout(bool timeout, unsigned int ms)
// Alternate colors to increase visibility
if ((ms / 1000) % 2 == 0)
{
toolBarTimeoutLabel->setStyleSheet(QString("QLabel { margin: 0px 2px; font: 14px; color: %1; background-color: %2; }").arg(QGC::colorDarkWhite.name()).arg(QGC::colorMagenta.name()));
toolBarTimeoutLabel->setStyleSheet(QString("QLabel { margin: 3px 2px; font: 14px; color: %1; background-color: %2; border-radius: 4px;}").arg(QGC::colorDarkWhite.name()).arg(QGC::colorMagenta.name()));
}
else
{
toolBarTimeoutLabel->setStyleSheet(QString("QLabel { margin: 0px 2px; font: 14px; color: %1; background-color: %2; }").arg(QGC::colorDarkWhite.name()).arg(QGC::colorMagenta.dark(250).name()));
toolBarTimeoutLabel->setStyleSheet(QString("QLabel { margin: 3px 2px; font: 14px; color: %1; background-color: %2; border-radius: 4px;}").arg(QGC::colorDarkWhite.name()).arg(QGC::colorMagenta.dark(250).name()));
}
toolBarTimeoutLabel->setText(tr("CONNECTION LOST: %1 s").arg((ms / 1000.0f), 2, 'f', 1, ' '));
}
......@@ -75,67 +75,79 @@ void QGCToolBar::heartbeatTimeout(bool timeout, unsigned int ms)
void QGCToolBar::createUI()
{
setStyleSheet("QToolBar {margin: 1px; border-bottom: 1px solid #484848; border-top: 1px solid #969696; background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #8B8B8B, stop:0.3 #808080, stop:0.34 #747474, stop:1 #484848);}");
// CREATE TOOLBAR ITEMS
// Add internal actions
// Add MAV widget
symbolButton = new QToolButton(this);
symbolButton->setStyleSheet("QWidget { background-color: #050508; color: #DDDDDF; background-clip: border; }");
symbolButton->setStyleSheet("QWidget { margin-left: 10px; background-color: #050508; color: #DDDDDF; background-clip: border; }");
addWidget(symbolButton);
toolBarNameLabel = new QLabel("------", this);
toolBarNameLabel->setToolTip(tr("Currently controlled vehicle"));
toolBarNameLabel->setAlignment(Qt::AlignCenter);
addWidget(toolBarNameLabel);
toolBarTimeoutLabel = new QLabel("UNCONNECTED", this);
toolBarTimeoutLabel->setToolTip(tr("System timed out, interval since last message"));
toolBarTimeoutLabel->setStyleSheet(QString("QLabel { margin: 0px 2px; font: 14px; color: %1; background-color: %2; }").arg(QGC::colorDarkWhite.name()).arg(QGC::colorMagenta.name()));
toolBarTimeoutLabel->setStyleSheet(QString("QLabel { margin: 3px 2px; font: 14px; color: %1; background-color: %2; border-radius: 4px;}").arg(QGC::colorDarkWhite.name()).arg(QGC::colorMagenta.name()));
toolBarTimeoutLabel->setAlignment(Qt::AlignCenter);
addWidget(toolBarTimeoutLabel);
toolBarSafetyLabel = new QLabel("SAFE", this);
toolBarSafetyLabel->setStyleSheet("QLabel { margin: 0px 2px; font: 14px; color: #14C814; }");
toolBarSafetyLabel->setStyleSheet("QLabel { margin: 3px 2px; font: 14px; color: #14C814; }");
toolBarSafetyLabel->setToolTip(tr("Vehicle safety state"));
toolBarSafetyLabel->setAlignment(Qt::AlignCenter);
addWidget(toolBarSafetyLabel);
toolBarModeLabel = new QLabel("------", this);
toolBarModeLabel->setStyleSheet("QLabel { margin: 0px 2px; font: 14px; color: #3C7B9E; }");
toolBarModeLabel->setStyleSheet("QLabel { margin: 3px 2px; font: 14px; color: #3C7B9E; }");
toolBarModeLabel->setToolTip(tr("Vehicle mode"));
toolBarModeLabel->setAlignment(Qt::AlignCenter);
addWidget(toolBarModeLabel);
toolBarStateLabel = new QLabel("------", this);
toolBarStateLabel->setStyleSheet("QLabel { margin: 0px 2px; font: 14px; color: #FEC654; }");
toolBarStateLabel->setStyleSheet("QLabel { margin: 3px 2px; font: 14px; color: #FEC654; }");
toolBarStateLabel->setToolTip(tr("Vehicle state"));
toolBarStateLabel->setAlignment(Qt::AlignCenter);
addWidget(toolBarStateLabel);
toolBarBatteryBar = new QProgressBar(this);
toolBarBatteryBar->setStyleSheet("QProgressBar:horizontal { margin: 0px 4px 0px 0px; border: 1px solid #4A4A4F; border-radius: 4px; text-align: center; padding: 2px; color: #111111; background-color: #111118; height: 10px; } QProgressBar:horizontal QLabel { font-size: 9px; color: #111111; } QProgressBar::chunk { background-color: green; }");
toolBarBatteryBar->setStyleSheet("QProgressBar:horizontal { margin: 0px 4px 0px 0px; border: 1px solid #4A4A4F; border-radius: 4px; text-align: center; padding: 2px; color: #111111; background-color: #111118; height: 14px; } QProgressBar:horizontal QLabel { font-size: 9px; color: #111111; } QProgressBar::chunk { background-color: green; }");
toolBarBatteryBar->setMinimum(0);
toolBarBatteryBar->setMaximum(100);
toolBarBatteryBar->setMinimumWidth(20);
toolBarBatteryBar->setMaximumWidth(100);
toolBarBatteryBar->setValue(0);
toolBarBatteryBar->setToolTip(tr("Battery charge level"));
addWidget(toolBarBatteryBar);
toolBarBatteryVoltageLabel = new QLabel("xx.x V");
toolBarBatteryVoltageLabel->setStyleSheet(QString("QLabel { margin: 0px 0px 0px 4px; font: 14px; color: %1; }").arg(QColor(Qt::green).name()));
toolBarBatteryVoltageLabel->setToolTip(tr("Battery voltage"));
toolBarBatteryVoltageLabel->setAlignment(Qt::AlignCenter);
addWidget(toolBarBatteryVoltageLabel);
toolBarWpLabel = new QLabel("WP--", this);
toolBarWpLabel->setStyleSheet("QLabel { margin: 0px 2px; font: 18px; color: #3C7B9E; }");
toolBarWpLabel->setStyleSheet("QLabel { margin: 3px 2px; font: 18px; color: #3C7B9E; }");
toolBarWpLabel->setToolTip(tr("Current waypoint"));
toolBarWpLabel->setAlignment(Qt::AlignCenter);
addWidget(toolBarWpLabel);
toolBarDistLabel = new QLabel("--- ---- m", this);
toolBarDistLabel->setToolTip(tr("Distance to current waypoint"));
toolBarDistLabel->setAlignment(Qt::AlignCenter);
addWidget(toolBarDistLabel);
toolBarMessageLabel = new QLabel("No system messages.", this);
toolBarMessageLabel->setStyleSheet("QLabel { margin: 0px 4px; font: 12px; font-style: italic; color: #3C7B9E; }");
toolBarMessageLabel = new QLabel("", this);
toolBarMessageLabel->setStyleSheet("QLabel { margin: 3px 2px; font: 14px; color: #3C7B9E; }");
toolBarMessageLabel->setToolTip(tr("Most recent system message"));
addWidget(toolBarMessageLabel);
QWidget* spacer = new QWidget();
spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
spacer->setStyleSheet("* { margin: 0px; background-color: transparent; min-height: 28px}");
addWidget(spacer);
connectButton = new QPushButton(tr("Connect"), this);
......@@ -165,17 +177,63 @@ void QGCToolBar::createUI()
updateViewTimer.start(2000);
loadSettings();
changed = false;
}
void QGCToolBar::addPerspectiveChangeAction(QAction* action)
void QGCToolBar::setPerspectiveChangeActions(const QList<QAction*> &actions)
{
if (firstAction) {
insertAction(firstAction, action);
if (actions.count() > 1)
{
QButtonGroup* group = new QButtonGroup(this);
group->setExclusive(true);
QToolButton *first = new QToolButton(this);
// Add first button
first->setIcon(actions.first()->icon());
first->setText(actions.first()->text());
first->setToolTip(actions.first()->toolTip());
first->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
first->setCheckable(true);
connect(first, SIGNAL(clicked(bool)), actions.first(), SIGNAL(triggered(bool)));
first->setStyleSheet("QToolButton { min-width: 70px; color: #222222; background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #A2A3A4, stop: 1 #B6B7B8); margin-left: 8px; margin-right: 0px; border-radius: 0px; border : 0px solid blue; border-bottom-left-radius: 6px; border-top-left-radius: 6px; border-left: 1px solid #484848; border-top: 1px solid #484848; border-bottom: 1px solid #484848; } QToolButton:checked { background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #333333, stop: 1 #757575); color: #CCCCCC; }");
addWidget(first);
group->addButton(first);
for (int i = 1; i < actions.count() - 1; i++)
{
// Add last button
QToolButton *btn = new QToolButton(this);
// Add first button
btn->setIcon(actions.at(i)->icon());
btn->setText(actions.at(i)->text());
btn->setToolTip(actions.at(i)->toolTip());
btn->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
btn->setCheckable(true);
connect(btn, SIGNAL(clicked(bool)), actions.at(i), SIGNAL(triggered(bool)));
btn->setStyleSheet("QToolButton { min-width: 70px; color: #222222; background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #A2A3A4, stop: 1 #B6B7B8); margin-left: -2px; margin-right: -2px; padding-left: 0px; padding-right: 0px; border-radius: 0px; border-top: 1px solid #484848; border-bottom: 1px solid #484848; } QToolButton:checked { background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #333333, stop: 1 #757575); color: #CCCCCC; }");
addWidget(btn);
group->addButton(btn);
}
// Add last button
QToolButton *last = new QToolButton(this);
// Add first button
last->setIcon(actions.last()->icon());
last->setText(actions.last()->text());
last->setToolTip(actions.last()->toolTip());
last->setCheckable(true);
connect(last, SIGNAL(clicked(bool)), actions.last(), SIGNAL(triggered(bool)));
last->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
last->setStyleSheet("QToolButton { min-width: 70px; color: #222222; background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #A2A3A4, stop: 1 #B6B7B8); margin-left: 0px; margin-right: 8px; padding-left: 0px; padding-right: 0px; border-radius: 0px; border : 0px solid blue; border-bottom-right-radius: 6px; border-top-right-radius: 6px; border-right: 1px solid #484848; border-top: 1px solid #484848; border-bottom: 1px solid #484848; } QToolButton:checked { background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #333333, stop: 1 #757575); color: #CCCCCC; }");
addWidget(last);
group->addButton(last);
} else {
addAction(action);
firstAction = action;
createUI();
qDebug() << __FILE__ << __LINE__ << "Not enough perspective change actions provided";
}
// Add the "rest"
createUI();
}
void QGCToolBar::setActiveUAS(UASInterface* active)
......@@ -222,7 +280,7 @@ void QGCToolBar::setActiveUAS(UASInterface* active)
systemArmed = mav->isArmed();
toolBarNameLabel->setText(mav->getUASName());
toolBarNameLabel->setStyleSheet(QString("QLabel { font: bold 16px; color: %1; }").arg(mav->getColor().name()));
symbolButton->setStyleSheet(QString("QWidget { background-color: %1; color: #DDDDDF; background-clip: border; } QToolButton { font-weight: bold; font-size: 12px; border: 0px solid #999999; border-radius: 5px; min-width:22px; max-width: 22px; min-height: 22px; max-height: 22px; padding: 0px; margin: 0px 4px 0px 20px; background-color: none; }").arg(mav->getColor().name()));
symbolButton->setStyleSheet(QString("QWidget { background-color: %1; color: #DDDDDF; background-clip: border; } QToolButton { font-weight: bold; font-size: 14px; border: 0px solid #484848; border-radius: 5px; min-width:22px; max-width: 22px; min-height: 22px; max-height: 22px; padding: 0px; margin: 0px 4px 0px 20px; background-color: none; }").arg(mav->getColor().name()));
toolBarModeLabel->setText(mav->getShortMode());
toolBarStateLabel->setText(mav->getShortState());
toolBarTimeoutLabel->setStyleSheet(QString(""));
......@@ -249,25 +307,31 @@ void QGCToolBar::updateView()
toolBarDistLabel->setText(tr("%1 m").arg(wpDistance, 6, 'f', 2, '0'));
toolBarWpLabel->setText(tr("WP%1").arg(wpId));
toolBarBatteryBar->setValue(batteryPercent);
if (batteryPercent < 30 && toolBarBatteryBar->value() >= 30) {
toolBarBatteryBar->setStyleSheet("QProgressBar:horizontal { margin: 0px 4px 0px 0px; border: 1px solid #4A4A4F; border-radius: 4px; text-align: center; padding: 2px; color: #111111; background-color: #111118; height: 14px; } QProgressBar:horizontal QLabel { font-size: 9px; color: #111111; } QProgressBar::chunk { background-color: yellow; }");
} else if (batteryPercent >= 30 && toolBarBatteryBar->value() < 30){
toolBarBatteryBar->setStyleSheet("QProgressBar:horizontal { margin: 0px 4px 0px 0px; border: 1px solid #4A4A4F; border-radius: 4px; text-align: center; padding: 2px; color: #111111; background-color: #111118; height: 14px; } QProgressBar:horizontal QLabel { font-size: 9px; color: #111111; } QProgressBar::chunk { background-color: green; }");
}
toolBarBatteryVoltageLabel->setText(tr("%1 V").arg(batteryVoltage, 4, 'f', 1, ' '));
toolBarStateLabel->setText(tr("%1").arg(state));
toolBarModeLabel->setText(tr("%1").arg(mode));
toolBarNameLabel->setText(systemName);
// expire after 15 seconds
if (QGC::groundTimeMilliseconds() - lastSystemMessageTimeMs < 15000) {
toolBarMessageLabel->setText(lastSystemMessage);
toolBarMessageLabel->setText(tr("%1").arg(lastSystemMessage));
} else {
toolBarMessageLabel->setText("");
toolBarMessageLabel->setText(tr("%1").arg(""));
}
if (systemArmed)
{
toolBarSafetyLabel->setStyleSheet(QString("QLabel { margin: 0px 2px; font: 14px; color: %1; background-color: %2; }").arg(QGC::colorRed.name()).arg(QGC::colorYellow.name()));
toolBarSafetyLabel->setStyleSheet(QString("QLabel { margin: 3px 2px; font: 14px; color: %1; background-color: %2; border-radius: 4px;}").arg(QGC::colorRed.name()).arg(QGC::colorYellow.name()));
toolBarSafetyLabel->setText(tr("ARMED"));
}
else
{
toolBarSafetyLabel->setStyleSheet("QLabel { margin: 0px 2px; font: 14px; color: #14C814; }");
toolBarSafetyLabel->setStyleSheet("QLabel { margin: 3px 2px; font: 14px; color: #14C814; }");
toolBarSafetyLabel->setText(tr("SAFE"));
}
......@@ -481,8 +545,11 @@ void QGCToolBar::storeSettings()
void QGCToolBar::clearStatusString()
{
if (toolBarMessageLabel->text().length() > 0)
{
lastSystemMessage = "";
changed = true;
}
}
QGCToolBar::~QGCToolBar()
......
......@@ -39,7 +39,7 @@ class QGCToolBar : public QToolBar
public:
explicit QGCToolBar(QWidget* parent = 0);
void addPerspectiveChangeAction(QAction* action);
void setPerspectiveChangeActions(const QList<QAction*> &action);
~QGCToolBar();
public slots:
......
#include "QGCWelcomeWidget.h"
#include "ui_QGCWelcomeWidget.h"
QGCWelcomeWidget::QGCWelcomeWidget(QWidget *parent) :
QWidget(parent),
ui(new Ui::QGCWelcomeWidget)
{
ui->setupUi(this);
}
QGCWelcomeWidget::~QGCWelcomeWidget()
{
delete ui;
}
#ifndef QGCWELCOMEWIDGET_H
#define QGCWELCOMEWIDGET_H
#include <QWidget>
namespace Ui {
class QGCWelcomeWidget;
}
class QGCWelcomeWidget : public QWidget
{
Q_OBJECT
public:
explicit QGCWelcomeWidget(QWidget *parent = 0);
~QGCWelcomeWidget();
private:
Ui::QGCWelcomeWidget *ui;
};
#endif // QGCWELCOMEWIDGET_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>QGCWelcomeWidget</class>
<widget class="QWidget" name="QGCWelcomeWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>30</number>
</property>
<property name="rightMargin">
<number>30</number>
</property>
<item row="0" column="0">
<widget class="QToolButton" name="connectButton">
<property name="minimumSize">
<size>
<width>100</width>
<height>100</height>
</size>
</property>
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QToolButton" name="logreplayButton">
<property name="minimumSize">
<size>
<width>100</width>
<height>100</height>
</size>
</property>
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QToolButton" name="demoButton">
<property name="minimumSize">
<size>
<width>100</width>
<height>100</height>
</size>
</property>
<property name="text">
<string>...</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
......@@ -14,24 +14,15 @@
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout" rowstretch="100,1">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>2</number>
</property>
<property name="rightMargin">
<number>4</number>
</property>
<property name="bottomMargin">
<number>2</number>
</property>
<property name="horizontalSpacing">
<number>2</number>
<number>3</number>
</property>
<property name="verticalSpacing">
<number>0</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QGCMapWidget" name="map" native="true"/>
</item>
......
......@@ -6,16 +6,16 @@
<rect>
<x>0</x>
<y>0</y>
<width>695</width>
<width>809</width>
<height>35</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout" stretch="1,1,1,1,1,0,1,100,20,1">
<layout class="QHBoxLayout" name="horizontalLayout" stretch="1,1,1,1,1,1,1,1,30,1">
<property name="spacing">
<number>12</number>
<number>2</number>
</property>
<property name="margin">
<number>4</number>
......
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