diff --git a/files/styles/style-dark.css b/files/styles/style-dark.css index 3c86ab204788609247f60b0ba0d0f9d05a0695e1..b175eec6aeab43ed248d9ab85125ae0cc3f101fe 100644 --- a/files/styles/style-dark.css +++ b/files/styles/style-dark.css @@ -70,6 +70,47 @@ QDockWidget::title { height: 14px; } +QGCToolBar QLabel { + font-size: 10pt; + margin: 3px 2px; +} + +QGCToolBar QLabel#symbolLabel { + background-clip: content; +} + +QGCToolBar QToolButton#firstAction { + margin-left: 8px; + border-bottom-left-radius: 6px; + border-top-left-radius: 6px; + border-right: none; +} + +QGCToolBar QToolButton { + margin: 0; + padding-left: 0; + padding-right: 0; + border-radius: 0; + text-align: left; +} +/* background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #FFb917, stop:1 #B37300);*/ + +QGCToolBar QToolButton#advancedButton { + margin-left: 0; + margin-right: 13px; + padding-left: 4px; + padding-right: 8px; + border-radius: 0; + border-bottom-right-radius: 6px; + border-top-right-radius: 6px; + border-left: none; +} + +QGCToolBar .QWidget { + margin: 0; + background-color: transparent; +} + QGCToolWidgetItem { border: 1px solid #666; border-radius: 3px; diff --git a/files/styles/style-light.css b/files/styles/style-light.css index 88beafa4367b6160087c2142bf596bbbc29a56dc..c08ff63bb01b9cc843bdce5e35e81df278edb0d2 100644 --- a/files/styles/style-light.css +++ b/files/styles/style-light.css @@ -70,8 +70,55 @@ QDockWidget::title { height: 14px; } -QGCToolBar { - min-height: 60px; +QGCToolBar QLabel { + font-size: 10pt; + margin: 3px 2px; +} + +QGCToolBar QLabel#symbolLabel { + background-clip: content; +} + +QGCToolBar QLabel#toolBarBatteryBar { + color: #008000; +} + +QGCToolBar QLabel#toolBarTimeoutLabel { + border-radius: 4px; + padding: 0; + color: #000; + background-color: #FF0037; +} + +QGCToolBar QToolButton#firstAction { + margin-left: 8px; + border-bottom-left-radius: 6px; + border-top-left-radius: 6px; + border-right: none; +} + +QGCToolBar QToolButton { + margin: 0; + padding-left: 0; + padding-right: 0; + border-radius: 0; + text-align: left; +} + +QGCToolBar QToolButton#advancedButton { + margin-left: 0; + margin-right: 13px; + padding-left: 4px; + padding-right: 8px; + border-radius: 0; + border-bottom-right-radius: 6px; + border-top-right-radius: 6px; + border-left: none; +} + +QGCToolBar .QWidget { + margin: 0; + background-color: transparent; } QGCToolWidgetItem { @@ -149,7 +196,11 @@ QMenu { } QMenu::item:selected { - background-color: #000; + background-color: #CCC; +} + +QMenu::item:checked { + background-color: #B8D3E6; } QMenu::separator { @@ -158,6 +209,11 @@ QMenu::separator { margin: 8px 5px 4px 5px; } +QMenu::icon, QMenu::icon:selected, QMenu::icon:disabled, QMenu::icon:checked { + background: #F00; + border: none; +} + QMenuBar::item:selected { background-color: #CCC; } @@ -213,7 +269,7 @@ QPushButton, QToolButton { max-height: 20px; border: 1px solid #465158; margin: 1px; - border-radius: 2px; + border-radius: 4px; padding-left: 8px; padding-right: 8px; background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #BBB, stop: 1 #777); @@ -239,16 +295,31 @@ QPushButton#killButton { border-radius: 5px; } +QPushButton#connectButton { + background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #73D95D, stop: 1 #18A154); +} + +QPushButton#deleteButton { + background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #FF0037, stop: 1 #AC0025); +} + QPushButton:checked, QToolButton:checked { background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #444, stop: 1 #888); + color: #FFF; +} + +QPushButton:checked#connectButton { + background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #FF9000, stop: 1 #B37300); + color: #000; } QPushButton:checked#controlButton { - background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #b76f11, stop: 1 #e1a718); + background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #09A2B2, stop: 1 #414B52); } QPushButton:disabled, QToolButton:disabled { background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #EEE, stop: 1 #CCC); + color: #AAA; } QPushButton:hover, QToolButton:hover { @@ -269,22 +340,6 @@ QPushButton:pressed#killButton { border-radius: 5px; } -QPushButton#connectButton { - min-height: 20px; - color: #222222; - background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #5AAA49, stop: 1 #106B38); - margin-left: 4px; - margin-right: 4px; - border-radius: 4px; - border: 1px solid #085B35; -} - -QPushButton:checked#connectButton { - background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #FF9000, stop: 1 #FFD450); - color: #222222; - border-color: #D1892A; -} - QScrollBar { border: 1px solid #333; } @@ -411,43 +466,6 @@ QToolBar { border-bottom-color: #484848; background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #CCC, stop: 1 #888); } - -QToolButton#symbolButton { - margin-left: 10px; - background-color: #050508; - color: #DDD; - background-clip: border; -} -QLabel#toolBarTimeoutLabel { margin: 3px 2px; padding: 2px; padding-left: 4px; padding-right: 4px; font: 14px; - border-radius: 4px; -} -QLabel#toolBarBatteryVoltageLabel { - margin: 0 0 0 4px; font: 14px; -} -QLabel#toolBarWpLabel { margin: 3px 2px; font: 18px; color: #ACEBFE; } -QLabel#toolBarMessageLabel { margin: 3px 2px; font: 14px; color: #ACEBFE; } -QPushButton#connectButton {min-height: 20px; color: #222; background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #5AAA49, stop: 1 #106B38); margin-left: 4px; margin-right: 4px; border-radius: 4px; border: 1px solid #085B35; } -QPushButton:checked#connectButton { background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #FF9000, stop: 1 #FFD450); color: #222; border-color: #D1892A} -QLabel#toolBarSafetyLabel { margin: 3px 2px; padding: 2px; padding-left: 4px; padding-right: 4px; font: 14px; color: #14C814; } -QLabel#toolBarModeLabel { margin: 3px 2px; font: 14px; color: #ACEBFE; } -QLabel#toolBarStateLabel { margin: 3px 2px; font: 14px; color: #FEC654; } -QToolButton#firstAction { min-width: 60px; color: #222; background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #A2A3A4, stop: 1 #B6B7B8); margin-left: 8px; margin-right: 0px; padding-left: 4px; padding-right: 8px; 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#firstAction { background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #555555, stop: 1 #787878); color: #DDD; } -QGCToolBar QToolButton { min-width: 60px; color: #222; 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; } -QGCToolBar QToolButton:checked { background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #555555, stop: 1 #787878); color: #DDD; } -QPushButton#advancedButton { min-width: 60px; font-weight: bold; text-align: left; color: #222; background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #A2A3A4, stop: 1 #B6B7B8); margin-left: 0px; margin-right: 13px; padding-left: 4px; padding-right: 8px; 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; } -QPushButton:checked#advancedButton { background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #555555, stop: 1 #787878); color: #DDD; } - -QGCToolBar QMenu { font-weight: bold; min-width: 70px; color: #222; background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #A2A3A4, stop: 1 #B6B7B8); border: 1px solid #484848; } -QGCToolBar QMenu::item:checked { background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #555555, stop: 1 #787878); color: #DDD; } - -QGCToolBar .QWidget { - margin: 0px; -background-color: transparent; -min-height: 24px; - background-color: #F00; -} - QToolTip { background-color: #F6F6F6; diff --git a/src/ui/CommSettings.ui b/src/ui/CommSettings.ui index 91f0ad49dd20d4db98d53a369d0b2896459ae089..ec9c2436d99bfdb0a861deba0832be704a3fba66 100644 --- a/src/ui/CommSettings.ui +++ b/src/ui/CommSettings.ui @@ -14,7 +14,16 @@ Form - + + 6 + + + 6 + + + 6 + + 6 @@ -84,7 +93,16 @@ 0 - + + 0 + + + 0 + + + 0 + + 0 @@ -97,8 +115,8 @@ 0 0 - 393 - 76 + 391 + 85 @@ -116,7 +134,16 @@ 0 - + + 0 + + + 0 + + + 0 + + 0 @@ -129,8 +156,8 @@ 0 0 - 393 - 76 + 391 + 84 @@ -166,7 +193,7 @@ Connect - false + true diff --git a/src/ui/QGCToolBar.cc b/src/ui/QGCToolBar.cc index a039d16289bded5fbd22e697c23e17ab308d064f..71140743797d1d14bc3904fc923059b81f0dac5e 100644 --- a/src/ui/QGCToolBar.cc +++ b/src/ui/QGCToolBar.cc @@ -64,11 +64,11 @@ void QGCToolBar::heartbeatTimeout(bool timeout, unsigned int ms) // Alternate colors to increase visibility if ((ms / 1000) % 2 == 0) { - toolBarTimeoutLabel->setStyleSheet(QString("QLabel {color: %1; background-color: %2;}").arg(QGC::colorDarkWhite.name()).arg(QGC::colorMagenta.name())); + toolBarTimeoutLabel->setStyleSheet(QString("QLabel {color: #000; background-color: #FF0037;}")); } else { - toolBarTimeoutLabel->setStyleSheet(QString("QLabel {color: %1; background-color: %2;}").arg(QGC::colorDarkWhite.name()).arg(QGC::colorMagenta.dark(250).name())); + toolBarTimeoutLabel->setStyleSheet(QString("QLabel {color: #FFF; background-color: #6B0017;}")); } toolBarTimeoutLabel->setText(tr("CONNECTION LOST: %1 s").arg((ms / 1000.0f), 2, 'f', 1, ' ')); } @@ -98,8 +98,8 @@ void QGCToolBar::createUI() toolBarTimeoutLabel = new QLabel("UNCONNECTED", this); toolBarTimeoutLabel->setToolTip(tr("System timed out, interval since last message")); - toolBarTimeoutLabel->setStyleSheet(QString("QLabel {color: %1; background-color: %2;}").arg(QGC::colorDarkWhite.name()).arg(QGC::colorMagenta.name())); toolBarTimeoutLabel->setAlignment(Qt::AlignCenter); + toolBarTimeoutLabel->setObjectName("toolBarTimeoutLabel"); addWidget(toolBarTimeoutLabel); toolBarSafetyLabel = new QLabel("SAFE", this); @@ -128,7 +128,7 @@ void QGCToolBar::createUI() addWidget(toolBarBatteryBar); toolBarBatteryVoltageLabel = new QLabel("xx.x V"); - toolBarBatteryVoltageLabel->setStyleSheet(QString("QLabel {color: %1; }").arg(QColor(Qt::green).name())); + toolBarBatteryVoltageLabel->setObjectName("toolBarBatteryVoltageLabel"); toolBarBatteryVoltageLabel->setToolTip(tr("Battery voltage")); toolBarBatteryVoltageLabel->setAlignment(Qt::AlignCenter); addWidget(toolBarBatteryVoltageLabel); @@ -152,6 +152,7 @@ void QGCToolBar::createUI() addWidget(spacer); connectButton = new QPushButton(tr("Connect"), this); + connectButton->setObjectName("connectButton"); connectButton->setToolTip(tr("Connect wireless link to MAV")); connectButton->setCheckable(true); addWidget(connectButton); @@ -189,8 +190,8 @@ void QGCToolBar::setPerspectiveChangeActions(const QList &actions) group = new QButtonGroup(this); group->setExclusive(true); + // Add the first button. QToolButton *first = new QToolButton(this); - // Add first button first->setIcon(actions.first()->icon()); first->setText(actions.first()->text()); first->setToolTip(actions.first()->toolTip()); @@ -202,11 +203,10 @@ void QGCToolBar::setPerspectiveChangeActions(const QList &actions) addWidget(first); group->addButton(first); + // Add all the middle buttons. for (int i = 1; i < actions.count(); 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()); @@ -219,13 +219,13 @@ void QGCToolBar::setPerspectiveChangeActions(const QList &actions) } // Add last button - advancedButton = new QPushButton(this); - // Add first button + advancedButton = new QToolButton(this); advancedButton->setIcon(QIcon(":/files/images/apps/utilities-system-monitor.svg")); advancedButton->setText(tr("Pro")); advancedButton->setToolTip(tr("Options for advanced users")); advancedButton->setCheckable(true); advancedButton->setObjectName("advancedButton"); + advancedButton->setPopupMode(QToolButton::InstantPopup); addWidget(advancedButton); group->addButton(advancedButton); } else { @@ -307,11 +307,10 @@ void QGCToolBar::setActiveUAS(UASInterface* active) systemName = mav->getUASName(); systemArmed = mav->isArmed(); toolBarNameLabel->setText(mav->getUASName()); - toolBarNameLabel->setStyleSheet(QString("QLabel { font: bold 16px; color: %1; }").arg(mav->getColor().name())); - symbolLabel->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())); + toolBarNameLabel->setStyleSheet(QString("QLabel {color: %1;}").arg(mav->getColor().name())); + symbolLabel->setStyleSheet(QString("QWidget {background-color: %1;}").arg(mav->getColor().name())); toolBarModeLabel->setText(mav->getShortMode()); toolBarStateLabel->setText(mav->getShortState()); - toolBarTimeoutLabel->setStyleSheet(QString("")); toolBarTimeoutLabel->setText(""); toolBarDistLabel->setText(""); setSystemType(mav, mav->getSystemType()); @@ -355,14 +354,15 @@ void QGCToolBar::updateView() toolBarMessageLabel->setText(tr("%1").arg("")); } + // Display the system armed state with a red-on-yellow background if armed or green text if safe. if (systemArmed) { - toolBarSafetyLabel->setStyleSheet(QString("QLabel { margin: 3px 2px; padding: 2px; padding-left: 4px; padding-right: 4px; font: 14px; color: %1; background-color: %2; border-radius: 4px;}").arg(QGC::colorRed.name()).arg(QGC::colorYellow.name())); + toolBarSafetyLabel->setStyleSheet(QString("QLabel {color: %1; background-color: %2;}").arg(QGC::colorRed.name()).arg(QGC::colorYellow.name())); toolBarSafetyLabel->setText(tr("ARMED")); } else { - toolBarSafetyLabel->setStyleSheet("QLabel { margin: 3px 2px; padding: 2px; padding-left: 4px; padding-right: 4px; font: 14px; color: #14C814; }"); + toolBarSafetyLabel->setStyleSheet("QLabel {color: #14C814;}"); toolBarSafetyLabel->setText(tr("SAFE")); } @@ -429,66 +429,67 @@ void QGCToolBar::updateName(const QString& name) void QGCToolBar::setSystemType(UASInterface* uas, unsigned int systemType) { Q_UNUSED(uas); - // Set matching icon - switch (systemType) { - case MAV_TYPE_GENERIC: - symbolLabel->setPixmap(QPixmap(":/files/images/mavs/generic.svg")); - break; - case MAV_TYPE_FIXED_WING: - symbolLabel->setPixmap(QPixmap(":/files/images/mavs/fixed-wing.svg")); - break; - case MAV_TYPE_QUADROTOR: - symbolLabel->setPixmap(QPixmap(":/files/images/mavs/quadrotor.svg")); - break; - case MAV_TYPE_COAXIAL: - symbolLabel->setPixmap(QPixmap(":/files/images/mavs/coaxial.svg")); - break; - case MAV_TYPE_HELICOPTER: - symbolLabel->setPixmap(QPixmap(":/files/images/mavs/helicopter.svg")); - break; - case MAV_TYPE_ANTENNA_TRACKER: - symbolLabel->setPixmap(QPixmap(":/files/images/mavs/antenna-tracker.svg")); - break; - case MAV_TYPE_GCS: - symbolLabel->setPixmap(QPixmap(":files/images/mavs/groundstation.svg")); - break; - case MAV_TYPE_AIRSHIP: - symbolLabel->setPixmap(QPixmap(":files/images/mavs/airship.svg")); - break; - case MAV_TYPE_FREE_BALLOON: - symbolLabel->setPixmap(QPixmap(":files/images/mavs/free-balloon.svg")); - break; - case MAV_TYPE_ROCKET: - symbolLabel->setPixmap(QPixmap(":files/images/mavs/rocket.svg")); - break; - case MAV_TYPE_GROUND_ROVER: - symbolLabel->setPixmap(QPixmap(":files/images/mavs/ground-rover.svg")); - break; - case MAV_TYPE_SURFACE_BOAT: - symbolLabel->setPixmap(QPixmap(":files/images/mavs/surface-boat.svg")); - break; - case MAV_TYPE_SUBMARINE: - symbolLabel->setPixmap(QPixmap(":files/images/mavs/submarine.svg")); - break; - case MAV_TYPE_HEXAROTOR: - symbolLabel->setPixmap(QPixmap(":files/images/mavs/hexarotor.svg")); - break; - case MAV_TYPE_OCTOROTOR: - symbolLabel->setPixmap(QPixmap(":files/images/mavs/octorotor.svg")); - break; - case MAV_TYPE_TRICOPTER: - symbolLabel->setPixmap(QPixmap(":files/images/mavs/tricopter.svg")); - break; - case MAV_TYPE_FLAPPING_WING: - symbolLabel->setPixmap(QPixmap(":files/images/mavs/flapping-wing.svg")); - break; - case MAV_TYPE_KITE: - symbolLabel->setPixmap(QPixmap(":files/images/mavs/kite.svg")); - break; - default: - symbolLabel->setPixmap(QPixmap(":/files/images/mavs/unknown.svg")); - break; - } + QPixmap newPixmap; + switch (systemType) { + case MAV_TYPE_GENERIC: + newPixmap = QPixmap(":/files/images/mavs/generic.svg"); + break; + case MAV_TYPE_FIXED_WING: + newPixmap = QPixmap(":/files/images/mavs/fixed-wing.svg"); + break; + case MAV_TYPE_QUADROTOR: + newPixmap = QPixmap(":/files/images/mavs/quadrotor.svg"); + break; + case MAV_TYPE_COAXIAL: + newPixmap = QPixmap(":/files/images/mavs/coaxial.svg"); + break; + case MAV_TYPE_HELICOPTER: + newPixmap = QPixmap(":/files/images/mavs/helicopter.svg"); + break; + case MAV_TYPE_ANTENNA_TRACKER: + newPixmap = QPixmap(":/files/images/mavs/antenna-tracker.svg"); + break; + case MAV_TYPE_GCS: + newPixmap = QPixmap(":files/images/mavs/groundstation.svg"); + break; + case MAV_TYPE_AIRSHIP: + newPixmap = QPixmap(":files/images/mavs/airship.svg"); + break; + case MAV_TYPE_FREE_BALLOON: + newPixmap = QPixmap(":files/images/mavs/free-balloon.svg"); + break; + case MAV_TYPE_ROCKET: + newPixmap = QPixmap(":files/images/mavs/rocket.svg"); + break; + case MAV_TYPE_GROUND_ROVER: + newPixmap = QPixmap(":files/images/mavs/ground-rover.svg"); + break; + case MAV_TYPE_SURFACE_BOAT: + newPixmap = QPixmap(":files/images/mavs/surface-boat.svg"); + break; + case MAV_TYPE_SUBMARINE: + newPixmap = QPixmap(":files/images/mavs/submarine.svg"); + break; + case MAV_TYPE_HEXAROTOR: + newPixmap = QPixmap(":files/images/mavs/hexarotor.svg"); + break; + case MAV_TYPE_OCTOROTOR: + newPixmap = QPixmap(":files/images/mavs/octorotor.svg"); + break; + case MAV_TYPE_TRICOPTER: + newPixmap = QPixmap(":files/images/mavs/tricopter.svg"); + break; + case MAV_TYPE_FLAPPING_WING: + newPixmap = QPixmap(":files/images/mavs/flapping-wing.svg"); + break; + case MAV_TYPE_KITE: + newPixmap = QPixmap(":files/images/mavs/kite.svg"); + break; + default: + newPixmap = QPixmap(":/files/images/mavs/unknown.svg"); + break; + } + symbolLabel->setPixmap(newPixmap.scaledToHeight(24)); } void QGCToolBar::receiveTextMessage(int uasid, int componentid, int severity, QString text) diff --git a/src/ui/QGCToolBar.h b/src/ui/QGCToolBar.h index 35f065db7ee86499cbf08ebfc07e3802ea2e9ce6..9e65d988869606b7943b5327a8f34615eae2e3f3 100644 --- a/src/ui/QGCToolBar.h +++ b/src/ui/QGCToolBar.h @@ -119,7 +119,7 @@ protected: bool systemArmed; LinkInterface* currentLink; QAction* firstAction; - QPushButton *advancedButton; + QToolButton *advancedButton; QButtonGroup *group; };