From 3079476bb07b2c71036095aa07e4d03fd1a08594 Mon Sep 17 00:00:00 2001 From: pip Date: Thu, 7 Oct 2010 10:24:42 +0000 Subject: [PATCH] OPMap gui style updates git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1912 ebee16cc-31ac-478f-84a7-5cbb03baadba --- ground/src/plugins/opmap/opmap_widget.ui | 561 ++++++++++-------- .../src/plugins/opmap/opmapgadgetwidget.cpp | 50 +- ground/src/plugins/opmap/opmapgadgetwidget.h | 4 +- 3 files changed, 333 insertions(+), 282 deletions(-) diff --git a/ground/src/plugins/opmap/opmap_widget.ui b/ground/src/plugins/opmap/opmap_widget.ui index 3b3ac80aa..5221122a5 100644 --- a/ground/src/plugins/opmap/opmap_widget.ui +++ b/ground/src/plugins/opmap/opmap_widget.ui @@ -30,12 +30,12 @@ 0 - 1 + 0 - + 0 0 @@ -43,13 +43,13 @@ 0 - 0 + 32 16777215 - 32 + 16777215 @@ -73,29 +73,59 @@ border-radius: 2px; QToolButton { /* all types of tool button */ background-color: transparent; color: rgb(255, 255, 255); + +/*height: 24px;*/ + /*border-style: none;*/ /* border: 1px solid rgba(0, 0, 0, 64); */ /* border: 0px; */ -border-radius: 3px; +border-radius: 0px; +/*border-radius: 3px;*/ } QToolButton:hover { -background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(255, 255, 255, 200), stop:1 rgba(180, 180, 180, 200)); +background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(255, 255, 255,128), stop:1 rgba(180, 180, 180, 128)); color: rgb(255, 255, 255); + +/*height: 24px;*/ + border: 0px; -border-radius: 3px; +border-radius: 0px; +/*border-radius: 3px;*/ } QToolButton:pressed { -background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(48, 48, 48, 255), stop:1 rgba(120, 120, 120, 255)); +background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(48, 48, 48, 255), stop:1 rgba(64, 64, 64, 255)); color: rgb(255, 255, 255); -border: 0px; -border-radius: 3px; + +/*height: 24px;*/ + +border: none; +border-radius: 0px; +/* +border: 1px solid rgb(255, 255, 255); +border-radius: 0px; +border-top-color: rgba(0, 0, 0, 64); +border-right-color: rgba(0, 0, 0, 64); +border-bottom-color: rgba(255, 255, 255, 64); +border-left-color: rgba(255, 255, 255, 64); +*/ } QToolButton:checked { -background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(48, 48, 48, 255), stop:1 rgba(120, 120, 120, 255)); +background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(48, 48, 48, 255), stop:1 rgba(64, 64, 64, 255)); color: rgb(255, 255, 255); -border: 0px; -border-radius: 3px; + +/*height: 24px;*/ + +border: none; +border-radius: 0px; +/* +border: 1px solid rgb(255, 255, 255); +border-radius: 0px; +border-top-color: rgba(0, 0, 0, 64); +border-right-color: rgba(0, 0, 0, 64); +border-bottom-color: rgba(255, 255, 255, 64); +border-left-color: rgba(255, 255, 255, 64); +*/ } @@ -139,34 +169,67 @@ border-radius: 2px; 0 - + 0 - - 2 - - - 0 - - - 2 - 5 - 3 + 8 + + + 5 8 + + 5 + - + + + + 0 + 0 + + + + + 9 + + + + Normal + + + + 16 + 32 + + + + true + + + true + + + Qt::ToolButtonTextOnly + + + + + Qt::Horizontal + + QSizePolicy::Fixed + 10 @@ -176,86 +239,42 @@ border-radius: 2px; - - - - - - - :/core/images/prev.png:/core/images/prev.png - - - - 32 - 32 - - - - false - - - - - + - + 0 0 - - - 200 - 0 - - - MS Sans Serif - 12 - 75 - false - true - true + 8 - - Mouse position - - - - - - QFrame::NoFrame - - - QFrame::Plain - - labelMapMode + Magic Waypoint - - Qt::AlignCenter + + + 16 + 32 + - - 5 + + true + + + Qt::ToolButtonTextOnly - - - ... + + + QFrame::Plain - - - :/core/images/next.png:/core/images/next.png - - - - 32 - 32 - + + Qt::Vertical @@ -272,6 +291,177 @@ border-radius: 2px; + + + + QFrame::Plain + + + Qt::Vertical + + + + + + + + 0 + 0 + + + + Center map over home position + + + + + + Home + + + + :/opmap/images/gcs.png:/opmap/images/gcs.png + + + + 28 + 28 + + + + false + + + Qt::ToolButtonIconOnly + + + false + + + + + + + + 0 + 0 + + + + Center map over UAV position + + + + + + UAV + + + + :/opmap/images/uav.png:/opmap/images/uav.png + + + + 28 + 28 + + + + true + + + false + + + Qt::ToolButtonIconOnly + + + false + + + + + + + + 0 + 0 + + + + Map rotation follows UAV heading + + + + + + Heading + + + + :/opmap/images/uav_heading.png:/opmap/images/uav_heading.png + + + + 28 + 28 + + + + true + + + false + + + Qt::ToolButtonIconOnly + + + false + + + + + + + + 0 + 0 + + + + Show/Hide the UAV trail + + + + + + Trail + + + + :/opmap/images/uav_trail.png:/opmap/images/uav_trail.png + + + + 28 + 28 + + + + true + + + false + + + Qt::ToolButtonIconOnly + + + false + + + @@ -1016,30 +1206,52 @@ color: rgba(0, 0, 0, 48); QToolButton { /* all types of tool button */ background-color: transparent; +/*background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(110, 110, 110, 255), stop:1 rgba(71, 71, 71, 255));*/ color: rgb(255, 255, 255); -/*border-style: none;*/ -/* border: 1px solid rgba(0, 0, 0, 64); */ -/* border: 0px; */ +/* +border: 1px solid black; +border-radius: 0px; +*/ +border: none; +border-radius: 0px; +/*border: 1px solid white; border-radius: 3px; +border-top-color: rgba(255, 255, 255, 48); +border-right-color: rgba(255, 255, 255, 48); +border-bottom-color: rgba(0, 0, 0, 48); +border-left-color: rgba(0, 0, 0, 48);*/ } QToolButton:hover { background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(255, 255, 255, 200), stop:1 rgba(180, 180, 180, 200)); color: rgb(255, 255, 255); -border: 0px; -border-radius: 3px; +border: none; +/*border: 1px solid white; +border-radius:3px; +border-top-color: rgba(255, 255, 255, 48); +border-right-color: rgba(255, 255, 255, 48); +border-bottom-color: rgba(0, 0, 0, 48); +border-left-color: rgba(0, 0, 0, 48);*/ } QToolButton:pressed { -background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(48, 48, 48, 255), stop:1 rgba(120, 120, 120, 255)); +background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(48, 48, 48, 255), stop:1 rgba(80, 80, 80, 255)); color: rgb(255, 255, 255); -border: 0px; -border-radius: 3px; +border: 1px solid white; +border-radius:3px; +border-top-color: rgba(0, 0, 0,160); +border-right-color: rgba(0, 0, 0, 160); +border-bottom-color: rgba(255, 255, 255, 80); +border-left-color: rgba(255, 255, 255, 80); } QToolButton:checked { -background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(48, 48, 48, 255), stop:1 rgba(120, 120, 120, 255)); +background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(48, 48, 48, 255), stop:1 rgba(80, 80, 80, 255)); color: rgb(255, 255, 255); -border: 0px; +border: 1px solid white; border-radius: 3px; +border-top-color: rgba(0, 0, 0,160); +border-right-color: rgba(0, 0, 0, 160); +border-bottom-color: rgba(255, 255, 255, 80); +border-left-color: rgba(255, 255, 255, 80); } QSliderl { @@ -1120,10 +1332,10 @@ border-radius: 3px; true - 500 + 1000 - 500 + 1000 false @@ -1147,7 +1359,7 @@ border-radius: 3px; 16777215 - 16777215 + 200 @@ -1210,151 +1422,10 @@ border-radius: 3px; true - 500 + 1000 - 500 - - - false - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 30 - - - - - - - - Center map over home position - - - - - - - - - - :/opmap/images/gcs.png:/opmap/images/gcs.png - - - - 28 - 28 - - - - false - - - false - - - - - - - Center map over UAV position - - - - - - - - - - :/opmap/images/uav.png:/opmap/images/uav.png - - - - 28 - 28 - - - - true - - - false - - - false - - - - - - - Map rotation follows UAV heading - - - - - - - - - - :/opmap/images/uav_heading.png:/opmap/images/uav_heading.png - - - - 28 - 28 - - - - true - - - false - - - false - - - - - - - Show/Hide the UAV trail - - - - - - - - - - :/opmap/images/uav_trail.png:/opmap/images/uav_trail.png - - - - 28 - 28 - - - - true - - - false + 1000 false @@ -1367,7 +1438,7 @@ border-radius: 3px; Qt::Vertical - QSizePolicy::Fixed + QSizePolicy::Expanding diff --git a/ground/src/plugins/opmap/opmapgadgetwidget.cpp b/ground/src/plugins/opmap/opmapgadgetwidget.cpp index 8b14a3513..4d2d56dc1 100644 --- a/ground/src/plugins/opmap/opmapgadgetwidget.cpp +++ b/ground/src/plugins/opmap/opmapgadgetwidget.cpp @@ -161,15 +161,19 @@ OPMapGadgetWidget::OPMapGadgetWidget(QWidget *parent) : QWidget(parent) switch (m_map_mode) { case Normal_MapMode: - m_widget->labelMapMode->setText("Normal mode"); + m_widget->toolButtonMagicWaypointMapMode->setChecked(false); + m_widget->toolButtonNormalMapMode->setChecked(true); break; case MagicWaypoint_MapMode: - m_widget->labelMapMode->setText("Magic Waypoint mode"); + m_widget->toolButtonNormalMapMode->setChecked(false); + m_widget->toolButtonMagicWaypointMapMode->setChecked(true); break; default: - m_widget->labelMapMode->setText("Unknown mode"); + m_map_mode = Normal_MapMode; + m_widget->toolButtonMagicWaypointMapMode->setChecked(false); + m_widget->toolButtonNormalMapMode->setChecked(true); break; } @@ -994,40 +998,14 @@ void OPMapGadgetWidget::on_treeViewWaypoints_clicked(QModelIndex index) // to do } -void OPMapGadgetWidget::on_toolButtonMapModeLeft_clicked() +void OPMapGadgetWidget::on_toolButtonNormalMapMode_clicked() { - switch (m_map_mode) - { - case Normal_MapMode: - setMapMode(MagicWaypoint_MapMode); - break; - - case MagicWaypoint_MapMode: - setMapMode(Normal_MapMode); - break; - - default: - setMapMode(Normal_MapMode); - break; - } + setMapMode(Normal_MapMode); } -void OPMapGadgetWidget::on_toolButtonMapModeRight_clicked() +void OPMapGadgetWidget::on_toolButtonMagicWaypointMapMode_clicked() { - switch (m_map_mode) - { - case Normal_MapMode: - setMapMode(MagicWaypoint_MapMode); - break; - - case MagicWaypoint_MapMode: - setMapMode(Normal_MapMode); - break; - - default: - setMapMode(Normal_MapMode); - break; - } + setMapMode(MagicWaypoint_MapMode); } // ************************************************************************************* @@ -1181,7 +1159,8 @@ void OPMapGadgetWidget::setMapMode(opMapModeType mode) case Normal_MapMode: m_map_mode = Normal_MapMode; - m_widget->labelMapMode->setText("Normal mode"); + m_widget->toolButtonMagicWaypointMapMode->setChecked(false); + m_widget->toolButtonNormalMapMode->setChecked(true); // delete the magic waypoint from the map if (magic_waypoint.map_wp_item) @@ -1214,7 +1193,8 @@ void OPMapGadgetWidget::setMapMode(opMapModeType mode) case MagicWaypoint_MapMode: m_map_mode = MagicWaypoint_MapMode; - m_widget->labelMapMode->setText("Magic Waypoint mode"); + m_widget->toolButtonNormalMapMode->setChecked(false); + m_widget->toolButtonMagicWaypointMapMode->setChecked(true); // delete the normal waypoints from the map m_waypoint_list_mutex.lock(); diff --git a/ground/src/plugins/opmap/opmapgadgetwidget.h b/ground/src/plugins/opmap/opmapgadgetwidget.h index c9a6e9098..11c209478 100644 --- a/ground/src/plugins/opmap/opmapgadgetwidget.h +++ b/ground/src/plugins/opmap/opmapgadgetwidget.h @@ -145,8 +145,8 @@ private slots: void on_toolButtonPrevWaypoint_clicked(); void on_toolButtonHoldPosition_clicked(); void on_toolButtonGo_clicked(); - void on_toolButtonMapModeLeft_clicked(); - void on_toolButtonMapModeRight_clicked(); + void on_toolButtonMagicWaypointMapMode_clicked(); + void on_toolButtonNormalMapMode_clicked(); /** * @brief signals received from the map object