diff --git a/ground/src/plugins/opmap/images/blank1.png b/ground/src/plugins/opmap/images/blank1.png index e0bb6d412..faed06d1c 100644 Binary files a/ground/src/plugins/opmap/images/blank1.png and b/ground/src/plugins/opmap/images/blank1.png differ diff --git a/ground/src/plugins/opmap/images/combobox_down_arrow.png b/ground/src/plugins/opmap/images/combobox_down_arrow.png index b54967f94..3b73e319f 100644 Binary files a/ground/src/plugins/opmap/images/combobox_down_arrow.png and b/ground/src/plugins/opmap/images/combobox_down_arrow.png differ diff --git a/ground/src/plugins/opmap/images/go.png b/ground/src/plugins/opmap/images/go.png index 91cf86306..b491d791a 100644 Binary files a/ground/src/plugins/opmap/images/go.png and b/ground/src/plugins/opmap/images/go.png differ diff --git a/ground/src/plugins/opmap/images/hold.png b/ground/src/plugins/opmap/images/hold.png index 901fcb2bd..9879fd3f8 100644 Binary files a/ground/src/plugins/opmap/images/hold.png and b/ground/src/plugins/opmap/images/hold.png differ diff --git a/ground/src/plugins/opmap/images/home.png b/ground/src/plugins/opmap/images/home.png index 6903cde76..67273534a 100644 Binary files a/ground/src/plugins/opmap/images/home.png and b/ground/src/plugins/opmap/images/home.png differ diff --git a/ground/src/plugins/opmap/images/hover.png b/ground/src/plugins/opmap/images/hover.png index 01157da09..816619e3c 100644 Binary files a/ground/src/plugins/opmap/images/hover.png and b/ground/src/plugins/opmap/images/hover.png differ diff --git a/ground/src/plugins/opmap/images/left_but.png b/ground/src/plugins/opmap/images/left_but.png new file mode 100644 index 000000000..0766e62c9 Binary files /dev/null and b/ground/src/plugins/opmap/images/left_but.png differ diff --git a/ground/src/plugins/opmap/images/next_waypoint.png b/ground/src/plugins/opmap/images/next_waypoint.png new file mode 100644 index 000000000..96b5b363f Binary files /dev/null and b/ground/src/plugins/opmap/images/next_waypoint.png differ diff --git a/ground/src/plugins/opmap/images/prev_waypoint.png b/ground/src/plugins/opmap/images/prev_waypoint.png new file mode 100644 index 000000000..53cedbe2c Binary files /dev/null and b/ground/src/plugins/opmap/images/prev_waypoint.png differ diff --git a/ground/src/plugins/opmap/images/right_but.png b/ground/src/plugins/opmap/images/right_but.png new file mode 100644 index 000000000..d0d78acd8 Binary files /dev/null and b/ground/src/plugins/opmap/images/right_but.png differ diff --git a/ground/src/plugins/opmap/opmap.pro b/ground/src/plugins/opmap/opmap.pro index ab65cca07..63b34dd60 100644 --- a/ground/src/plugins/opmap/opmap.pro +++ b/ground/src/plugins/opmap/opmap.pro @@ -10,16 +10,19 @@ HEADERS += opmapplugin.h \ opmapgadgetconfiguration.h \ opmapgadget.h \ opmapgadgetwidget.h \ - opmap_waypointeditor_dialog.h + opmap_waypointeditor_dialog.h \ + opmap_mapoverlaywidget.h SOURCES += opmapplugin.cpp \ opmapgadgetwidget.cpp \ opmapgadgetoptionspage.cpp \ opmapgadgetfactory.cpp \ opmapgadgetconfiguration.cpp \ opmapgadget.cpp \ - opmap_waypointeditor_dialog.cpp + opmap_waypointeditor_dialog.cpp \ + opmap_mapoverlaywidget.cpp OTHER_FILES += OPMapGadget.pluginspec FORMS += opmapgadgetoptionspage.ui \ opmap_widget.ui \ - opmap_waypointeditor_dialog.ui + opmap_waypointeditor_dialog.ui \ + opmap_mapoverlaywidget.ui RESOURCES += opmap.qrc diff --git a/ground/src/plugins/opmap/opmap.qrc b/ground/src/plugins/opmap/opmap.qrc index f359866e7..01945886b 100644 --- a/ground/src/plugins/opmap/opmap.qrc +++ b/ground/src/plugins/opmap/opmap.qrc @@ -1,16 +1,18 @@ images/ok.png - images/circle.png - images/go.png - images/home.png - images/hover.png images/uav.png images/gcs.png images/plus.png images/minus.png images/waypoint.png - images/hold.png + images/right_but.png + images/left_but.png images/combobox_down_arrow.png + images/home.png + images/hold.png + images/go.png + images/next_waypoint.png + images/prev_waypoint.png diff --git a/ground/src/plugins/opmap/opmap_mapoverlaywidget.cpp b/ground/src/plugins/opmap/opmap_mapoverlaywidget.cpp new file mode 100644 index 000000000..ef9852a54 --- /dev/null +++ b/ground/src/plugins/opmap/opmap_mapoverlaywidget.cpp @@ -0,0 +1,36 @@ +#include "opmap_mapoverlaywidget.h" +#include "ui_opmap_mapoverlaywidget.h" + +OPMap_MapOverlayWidget::OPMap_MapOverlayWidget(QWidget *parent) : + QWidget(parent), + ui(new Ui::OPMap_MapOverlayWidget) +{ + ui->setupUi(this); +} + +OPMap_MapOverlayWidget::~OPMap_MapOverlayWidget() +{ + delete ui; +} + +void OPMap_MapOverlayWidget::changeEvent(QEvent *e) +{ + QWidget::changeEvent(e); + switch (e->type()) { + case QEvent::LanguageChange: + ui->retranslateUi(this); + break; + default: + break; + } +} + +void OPMap_MapOverlayWidget::on_verticalSlider_sliderMoved(int position) +{ + +} + +void OPMap_MapOverlayWidget::on_dial_sliderMoved(int position) +{ + +} diff --git a/ground/src/plugins/opmap/opmap_mapoverlaywidget.h b/ground/src/plugins/opmap/opmap_mapoverlaywidget.h new file mode 100644 index 000000000..a7ed98a7f --- /dev/null +++ b/ground/src/plugins/opmap/opmap_mapoverlaywidget.h @@ -0,0 +1,27 @@ +#ifndef OPMAP_MAPOVERLAYWIDGET_H +#define OPMAP_MAPOVERLAYWIDGET_H + +#include + +namespace Ui { + class OPMap_MapOverlayWidget; +} + +class OPMap_MapOverlayWidget : public QWidget { + Q_OBJECT +public: + OPMap_MapOverlayWidget(QWidget *parent = 0); + ~OPMap_MapOverlayWidget(); + +protected: + void changeEvent(QEvent *e); + +private: + Ui::OPMap_MapOverlayWidget *ui; + +private slots: + void on_dial_sliderMoved(int position); + void on_verticalSlider_sliderMoved(int position); +}; + +#endif // OPMAP_MAPOVERLAYWIDGET_H diff --git a/ground/src/plugins/opmap/opmap_mapoverlaywidget.ui b/ground/src/plugins/opmap/opmap_mapoverlaywidget.ui new file mode 100644 index 000000000..56f763d37 --- /dev/null +++ b/ground/src/plugins/opmap/opmap_mapoverlaywidget.ui @@ -0,0 +1,438 @@ + + + OPMap_MapOverlayWidget + + + + 0 + 0 + 287 + 299 + + + + + 0 + 0 + + + + + + + false + + + /*background-color: rgba(0, 0, 0, 0);*/ +background-color: transparent; + +QFrame { +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: rgba(255, 255, 255, 70); +} + +QLabel { /* all label types */ +/* background-color: rgba(255, 255, 255, 0); */ +background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(64, 64, 64, 255), stop:1 rgba(128, 128, 128, 255)); +color: rgb(255, 255, 255); +} + +QToolButton { /* all types of tool button */ +background-color: rgba(255, 255, 255, 0); +color: rgb(255, 255, 255); +/*border-style: none;*/ +border: 0px; +} +QToolButton:hover { +background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(255, 160, 0, 255), stop:1 rgba(160, 100, 0, 255)); +color: rgb(255, 255, 255); +} +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)); +color: rgb(255, 255, 255); +} + +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)); +color: rgb(255, 255, 255); +} + +QSlider::groove:horizontal { +border: none; +height: 4px; +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)); +margin: 2px 0; +} +QSlider::handle:horizontal { +border: 1px solid #5c5c5c; +background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(255, 255, 255, 255), stop:1 rgba(128, 128, 128, 255)); +width: 24px; +margin: -2px 0; +border-radius: 3px; +} + +QComboBox { +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)); +color: rgb(255, 255, 255); +} +QComboBox:hover { +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: rgb(197, 138, 0); +} +QComboBox::down-arrow { + image: url(:/opmap/images/combobox_down_arrow.png); +} +QComboBox:drop-down { + subcontrol-origin: padding; + subcontrol-position: top right; + border-left-style: none; + border-top-right-radius: 1px; + border-bottom-right-radius: 1px; +} + +QToolTip { +background-color: white; +color: black; +border: 1px solid black; +padding: 5px; +border-radius: 2px; +/* opacity: 170; */ +} + + + + + 0 + + + 0 + + + 0 + + + + + 10 + + + + + + 0 + 0 + + + + + 0 + 120 + + + + + 16777215 + 120 + + + + QSlider::handle:vertical { +border: 1px solid #5c5c5c; +background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(128, 128, 128, 255), stop:1 rgba(255, 255, 255, 255)); +width: 24px; +height: 20px; +margin: -2px 0; +border-radius: 3px; +} + + + + + 2 + + + 19 + + + 1 + + + true + + + Qt::Vertical + + + false + + + false + + + + + + + + 0 + 0 + + + + + 50 + 50 + + + + + 50 + 50 + + + + 360 + + + 180 + + + true + + + 1.000000000000000 + + + false + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 40 + + + + + + + + 0 + + + + + QToolButton { /* all types of tool button */ +background-color: rgba(255, 255, 255, 0); +color: rgb(255, 255, 255); +/*border-style: none;*/ +border: 0px; +} +QToolButton:hover { +background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(255, 160, 0, 255), stop:1 rgba(160, 100, 0, 255)); +color: rgb(255, 255, 255); +} +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)); +color: rgb(255, 255, 255); +} + +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)); +color: rgb(255, 255, 255); +} + + + + + + + + :/opmap/images/left_but.png:/opmap/images/left_but.png + + + + 17 + 48 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + QToolButton { /* all types of tool button */ +background-color: rgba(255, 255, 255, 0); +color: rgb(255, 255, 255); +/*border-style: none;*/ +border: 0px; +} +QToolButton:hover { +background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(255, 160, 0, 255), stop:1 rgba(160, 100, 0, 255)); +color: rgb(255, 255, 255); +} +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)); +color: rgb(255, 255, 255); +} + +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)); +color: rgb(255, 255, 255); +} + + + + + + + + :/opmap/images/right_but.png:/opmap/images/right_but.png + + + + 17 + 48 + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + 20 + + + 20 + + + 20 + + + + + QLabel { /* all label types */ +/* background-color: rgba(0, 0, 0, 0); */ + background-color: qradialgradient(spread:pad, cx:0.5, cy:0.5, radius:0.5, fx:0.5, fy:0.5, stop:0.778409 rgba(0, 0, 0, 176), stop:1 rgba(0, 0, 0, 0)); +color: rgb(255, 255, 255); + +} + + + QFrame::NoFrame + + + TextLabel + + + 8 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + QLabel { /* all label types */ +/* background-color: rgba(0, 0, 0, 0); */ + background-color: qradialgradient(spread:pad, cx:0.5, cy:0.5, radius:0.5, fx:0.5, fy:0.5, stop:0.778409 rgba(0, 0, 0, 176), stop:1 rgba(0, 0, 0, 0)); +color: rgb(255, 255, 255); +} + + + TextLabel + + + 8 + + + + + + + + + + + + diff --git a/ground/src/plugins/opmap/opmap_widget.ui b/ground/src/plugins/opmap/opmap_widget.ui index b6713207b..bd399731b 100644 --- a/ground/src/plugins/opmap/opmap_widget.ui +++ b/ground/src/plugins/opmap/opmap_widget.ui @@ -7,7 +7,7 @@ 0 0 704 - 475 + 327 @@ -44,7 +44,7 @@ 0 - + 0 @@ -120,10 +120,16 @@ QComboBox::down-arrow { QComboBox:drop-down { subcontrol-origin: padding; subcontrol-position: top right; - border-left-style: none; + border-left-style: 1px solid black; border-top-right-radius: 1px; border-bottom-right-radius: 1px; } +QComboBox QAbstractItemView { /* the drop down list */ +background-color: rgb(255, 255, 255); +color: rgb(0, 0, 0); +border: 2px solid darkgray; +selection-background-color: lightgray; +} QToolTip { background-color: white; @@ -136,7 +142,7 @@ border-radius: 2px; - QFrame::NoFrame + QFrame::StyledPanel QFrame::Plain @@ -149,13 +155,13 @@ border-radius: 2px; 0 - 5 + 3 0 - 5 + 3 @@ -163,10 +169,10 @@ border-radius: 2px; 5 - 8 + 3 - 8 + 3 @@ -190,19 +196,25 @@ border-radius: 2px; :/core/images/prev.png:/core/images/prev.png - true + false - - - QFrame::Plain - + - Qt::Vertical + Qt::Horizontal - + + QSizePolicy::Fixed + + + + 15 + 20 + + + @@ -224,6 +236,9 @@ border-radius: 2px; true + + -1 + 20 @@ -233,6 +248,21 @@ border-radius: 2px; false + + + london + + + + + new york + + + + + paris + + @@ -257,7 +287,7 @@ border-radius: 2px; - true + false Qt::NoArrow @@ -265,14 +295,20 @@ border-radius: 2px; - - - QFrame::Plain - + - Qt::Vertical + Qt::Horizontal - + + QSizePolicy::Fixed + + + + 15 + 20 + + + @@ -299,7 +335,7 @@ border-radius: 2px; true - true + false @@ -331,19 +367,25 @@ border-radius: 2px; true - true + false - - - QFrame::Plain - + - Qt::Vertical + Qt::Horizontal - + + QSizePolicy::Fixed + + + + 15 + 20 + + + @@ -370,7 +412,7 @@ border-radius: 2px; true - true + false @@ -399,19 +441,22 @@ border-radius: 2px; true - true + false - - - QFrame::Plain - + - Qt::Vertical + Qt::Horizontal - + + + 40 + 20 + + + @@ -435,7 +480,7 @@ border-radius: 2px; - true + false @@ -465,7 +510,7 @@ p, li { white-space: pre-wrap; } - true + false @@ -522,39 +567,22 @@ color: rgb(255, 255, 255); - - - - QFrame::Plain - - - Qt::Vertical - - - Qt::Horizontal + + QSizePolicy::Fixed + - 40 + 15 20 - - - - QFrame::Plain - - - Qt::Vertical - - - @@ -579,23 +607,13 @@ color: rgb(255, 255, 255); - true + false Qt::NoArrow - - - - QFrame::Plain - - - Qt::Vertical - - - @@ -618,7 +636,7 @@ color: rgb(255, 255, 255); :/core/images/next.png:/core/images/next.png - true + false @@ -637,7 +655,8 @@ color: rgb(255, 255, 255); - background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(0, 0, 0, 255), stop:1 rgba(255, 255, 255, 255)); + background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 rgba(71, 71, 71, 255), stop:1 rgba(110, 110, 110, 255)); + QFrame::NoFrame @@ -652,7 +671,7 @@ color: rgb(255, 255, 255); Qt::Horizontal - 5 + 7 false @@ -672,7 +691,7 @@ color: rgb(255, 255, 255); - 600 + 300 16777215 @@ -682,6 +701,17 @@ color: rgb(255, 255, 255); background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 rgba(71, 71, 71, 255), stop:1 rgba(110, 110, 110, 255)); color: rgb(255, 255, 255); +/* +QTreeView::item { +border: 1px solid #d9d9d9; +border-top-color: transparent; +border-bottom-color: transparent; +} +*/ +QTreeView::item:hover { +background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #e7effd, stop: 1 #cbdaf1); +border: 1px solid #bfcde4; +} QTreeView::branch:has-children:!has-siblings:closed, QTreeView::branch:closed:has-children:has-siblings { border-image: none; @@ -728,16 +758,75 @@ QTreeView::branch:open:has-children:!has-siblings, QTreeView::branch:open:has-ch true - QWidget { + background-color: black; +border: 1px solid black; + +QLabel { /* all label types */ +/* background-color: rgba(255, 255, 255, 0); */ +background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(64, 64, 64, 255), stop:1 rgba(128, 128, 128, 255)); +color: rgb(255, 255, 255); +} + +QToolButton { /* all types of tool button */ +background-color: rgba(255, 255, 255, 0); +color: rgb(255, 255, 255); +/*border-style: none;*/ +border: 0px; +} +QToolButton:hover { +background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(255, 160, 0, 255), stop:1 rgba(160, 100, 0, 255)); +color: rgb(255, 255, 255); +} +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)); +color: rgb(255, 255, 255); +} + +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)); +color: rgb(255, 255, 255); +} + +QSlider::groove:horizontal { +border: none; +height: 4px; +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)); +margin: 2px 0; +} +QSlider::handle:horizontal { +border: 1px solid #5c5c5c; +background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(255, 255, 255, 255), stop:1 rgba(128, 128, 128, 255)); +width: 24px; +margin: -2px 0; +border-radius: 3px; +} + +QComboBox { +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)); +color: rgb(255, 255, 255); +} +QComboBox:hover { +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: rgb(197, 138, 0); +} +QComboBox::down-arrow { + image: url(:/opmap/images/combobox_down_arrow.png); +} +QComboBox:drop-down { + subcontrol-origin: padding; + subcontrol-position: top right; + border-left-style: none; + border-top-right-radius: 1px; + border-bottom-right-radius: 1px; } QToolTip { background-color: white; color: black; border: 1px solid black; -padding: 2px; -border-radius: 3px; +padding: 5px; +border-radius: 2px; /* opacity: 170; */ } @@ -746,22 +835,22 @@ border-radius: 3px; - + - + 0 0 - 87 + 48 50 - 87 + 70 16777215 @@ -799,21 +888,33 @@ border-radius: 3px; } + + QFrame::NoFrame + - - 8 + + 1 - - 0 - - - 0 - - + 0 + + true + + + + 0 + 0 + + + + + 48 + 0 + + UAV go home @@ -840,12 +941,100 @@ border-radius: 3px; Qt::ToolButtonIconOnly - true + false + + + + + + + + 0 + 0 + + + + + 48 + 0 + + + + Move UAV to previous waypoint + + + + + + + + + + :/opmap/images/prev_waypoint.png:/opmap/images/prev_waypoint.png + + + + 70 + 70 + + + + false + + + + + + + + 0 + 0 + + + + + 48 + 0 + + + + Move UAV to next waypoint + + + + + + + + + + :/opmap/images/next_waypoint.png:/opmap/images/next_waypoint.png + + + + 70 + 70 + + + + false + + + 0 + 0 + + + + + 48 + 0 + + UAV hold position @@ -866,12 +1055,24 @@ border-radius: 3px; - true + false + + + 0 + 0 + + + + + 48 + 0 + + UAV go! @@ -892,7 +1093,7 @@ border-radius: 3px; - true + false @@ -913,7 +1114,7 @@ border-radius: 3px; 0 - + 0 @@ -934,8 +1135,10 @@ color: rgba(255, 255, 255, 70); QLabel { /* all label types */ /* background-color: rgba(255, 255, 255, 0); */ -background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(64, 64, 64, 255), stop:1 rgba(128, 128, 128, 255)); +background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(64, 64, 64, 128), stop:1 rgba(128, 128, 128, 128)); color: rgb(255, 255, 255); +/*border: 1px solid black;*/ +border: none; } QToolTip { @@ -949,22 +1152,31 @@ border-radius: 3px; - QFrame::NoFrame + QFrame::StyledPanel - QFrame::Raised + QFrame::Plain 0 - + 0 + + 3 + + + 0 + + + 3 + - 3 + 5 3 @@ -972,6 +1184,62 @@ border-radius: 3px; 8 + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + 0 + 0 + + + + + 8 + 50 + false + false + true + + + + Map position + + + + + + QFrame::NoFrame + + + QFrame::Raised + + + labelUAVPos + + + Qt::AlignCenter + + + 5 + + + @@ -982,7 +1250,7 @@ border-radius: 3px; - 9 + 8 50 false false @@ -1019,7 +1287,7 @@ border-radius: 3px; - 9 + 8 50 false false @@ -1032,6 +1300,12 @@ border-radius: 3px; + + QFrame::NoFrame + + + QFrame::Plain + labelMousePos @@ -1073,7 +1347,7 @@ border-radius: 3px; 100 - 10 + 12 @@ -1081,7 +1355,7 @@ border-radius: 3px; QProgressBar { -border: none; +border: nonei; padding: 1px; 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)); color: rgb(255, 255, 255); diff --git a/ground/src/plugins/opmap/opmapgadgetwidget.cpp b/ground/src/plugins/opmap/opmapgadgetwidget.cpp index 25369c8a8..56c1d5a87 100644 --- a/ground/src/plugins/opmap/opmapgadgetwidget.cpp +++ b/ground/src/plugins/opmap/opmapgadgetwidget.cpp @@ -47,27 +47,20 @@ OPMapGadgetWidget::OPMapGadgetWidget(QWidget *parent) : QWidget(parent) waypoint_editor = NULL; wayPoint_treeView_model = NULL; findPlaceCompleter = NULL; - -// setMouseTracking(true); + m_map_graphics_scene = NULL; + m_map_scene_proxy = NULL; + m_map_overlay_widget = NULL; prev_tile_number = 0; - // ************** - // Get required UAVObjects - - ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); - UAVObjectManager *objManager = pm->getObject(); - m_positionActual = PositionActual::GetInstance(objManager); - // ************** // create the widget that holds the user controls and the map m_widget = new Ui::OPMap_Widget(); -// m_widget = new Ui_OPMap_Widget(); m_widget->setupUi(this); // ************** - // create the map display + // create the map widget m_map = new mapcontrol::OPMapWidget(); @@ -76,22 +69,54 @@ OPMapGadgetWidget::OPMapGadgetWidget(QWidget *parent) : QWidget(parent) m_map->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); m_map->setMinimumSize(64, 64); + m_map->setFrameStyle(QFrame::NoFrame); + m_map->configuration->DragButton = Qt::LeftButton; // use the left mouse button for map dragging } // ************** + setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); + + QVBoxLayout *layout = new QVBoxLayout; + layout->setSpacing(0); + layout->setContentsMargins(0, 0, 0, 0); + layout->addWidget(m_map); +// layout->addChildWidget(); + m_widget->mapWidget->setLayout(layout); + + // ************** + // create the user controls overlayed onto the map +/* + m_map_overlay_widget = new OPMap_MapOverlayWidget(); + + m_map_graphics_scene = m_map->scene(); + m_map_scene_proxy = m_map_graphics_scene->addWidget(m_map_overlay_widget); + + m_map_overlay_widget->setGeometry(m_map->geometry()); +*/ + // ************** + // Get required UAVObjects + + ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); + UAVObjectManager *objManager = pm->getObject(); + m_positionActual = PositionActual::GetInstance(objManager); + + // ************** + // create various context (mouse right click) menu actions + createActions(); // ************** // set the user control options -// m_widget->labelNumTilesToLoad->setText(" 0"); - m_widget->labelMapPos->setText(""); - m_widget->labelMousePos->setText(""); + m_widget->labelUAVPos->setText("---"); + m_widget->labelMapPos->setText("---"); + m_widget->labelMousePos->setText("---"); + m_widget->progressBarMap->setMaximum(1); - m_widget->widgetFlightControls->setVisible(false); + m_widget->frameFlightControls->setVisible(false); m_widget->toolButtonFlightControlsShowHide->setIcon(QIcon(QString::fromUtf8(":/core/images/prev.png"))); m_widget->treeViewWaypoints->setVisible(false); @@ -138,16 +163,6 @@ OPMapGadgetWidget::OPMapGadgetWidget(QWidget *parent) : QWidget(parent) m_map->SetCurrentPosition(internals::PointLatLng(data.Latitude, data.Longitude)); // set the default map position } - // ************** - - setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); - - QVBoxLayout *layout = new QVBoxLayout; - layout->setSpacing(0); - layout->setContentsMargins(0, 0, 0, 0); - layout->addWidget(m_map); - m_widget->mapWidget->setLayout(layout); - // ************** // create the waypoint editor dialog @@ -216,11 +231,6 @@ OPMapGadgetWidget::OPMapGadgetWidget(QWidget *parent) : QWidget(parent) - // ************** - // create the user controls overlayed onto the map - -// createMapOverlayUserControls(); - // ************** // create the desired timers @@ -242,6 +252,7 @@ OPMapGadgetWidget::OPMapGadgetWidget(QWidget *parent) : QWidget(parent) OPMapGadgetWidget::~OPMapGadgetWidget() { + if (m_map_overlay_widget) delete m_map_overlay_widget; if (wayPoint_treeView_model) delete wayPoint_treeView_model; if (waypoint_editor) delete waypoint_editor; if (m_map) delete m_map; @@ -411,7 +422,7 @@ void OPMapGadgetWidget::updatePosition() " " + QString::number(uav_heading, 'f', 1) + "deg" + " " + QString::number(uav_height_feet, 'f', 1) + "feet" + " " + QString::number(uav_ground_speed, 'f', 1) + "mph"; - if (m_widget) m_widget->labelMapPos->setText(str); + if (m_widget) m_widget->labelUAVPos->setText(str); if (m_map && followUAVpositionAct && followUAVheadingAct) { @@ -493,7 +504,7 @@ void OPMapGadgetWidget::OnCurrentPositionChanged(internals::PointLatLng point) if (m_widget) { QString coord_str = " " + QString::number(point.Lat(), 'f', 6) + " " + QString::number(point.Lng(), 'f', 6) + " "; -// m_widget->labelMapPos->setText(coord_str); + m_widget->labelMapPos->setText(coord_str); } } @@ -575,6 +586,7 @@ void OPMapGadgetWidget::on_comboBoxFindPlace_returnPressed() void OPMapGadgetWidget::on_toolButtonFindPlace_clicked() { + m_widget->comboBoxFindPlace->setFocus(); on_comboBoxFindPlace_returnPressed(); } @@ -605,9 +617,9 @@ void OPMapGadgetWidget::on_toolButtonFlightControlsShowHide_clicked() { if (m_widget) { - m_widget->widgetFlightControls->setVisible(!m_widget->widgetFlightControls->isVisible()); + m_widget->frameFlightControls->setVisible(!m_widget->frameFlightControls->isVisible()); - if (m_widget->widgetFlightControls->isVisible()) + if (m_widget->frameFlightControls->isVisible()) m_widget->toolButtonFlightControlsShowHide->setIcon(QIcon(QString::fromUtf8(":/core/images/next.png"))); else m_widget->toolButtonFlightControlsShowHide->setIcon(QIcon(QString::fromUtf8(":/core/images/prev.png"))); @@ -735,86 +747,6 @@ void OPMapGadgetWidget::setCacheLocation(QString cacheLocation) m_map->configuration->SetCacheLocation(cacheLocation); } -// ************************************************************************************* -// create some user controls overlayed onto the map area - -QPushButton * OPMapGadgetWidget::createTransparentButton(QWidget *parent, QString text, QString icon) -{ - QPixmap pix; - pix.load(icon); - - QPushButton *but = new QPushButton(parent); - - QColor transparent_color(0,0,0,0); - QPalette but_pal(but->palette()); - - but_pal.setColor(QPalette::Button, transparent_color); - but->setPalette(but_pal); - - but->setIcon(pix); - but->setText(text); - but->setIconSize(pix.size()); - - return but; -} - -void OPMapGadgetWidget::createMapOverlayUserControls() -{ - QPushButton *zoomout = new QPushButton(""); - zoomout->setToolTip(tr("Zoom out")); - zoomout->setCursor(Qt::OpenHandCursor); - zoomout->setFlat(true); - zoomout->setIcon(QIcon(QString::fromUtf8(":/opmap/images/minus.png"))); - zoomout->setIconSize(QSize(32, 32)); - zoomout->setFixedSize(28, 28); - connect(zoomout, SIGNAL(clicked(bool)), this, SLOT(zoomOut())); - -// QPushButton *zoomin = createTransparentButton(map, "", QString::fromUtf8(":/core/images/plus.png")); -// zoomin->setStyleSheet(""); - QPushButton *zoomin = new QPushButton(""); - zoomin->setFlat(true); - zoomin->setToolTip(tr("Zoom in")); - zoomin->setCursor(Qt::OpenHandCursor); - zoomin->setIcon(QIcon(QString::fromUtf8(":/opmap/images/plus.png"))); -// zoomin->setIconSize(QSize(12, 12)); - zoomin->setIconSize(QSize(28, 28)); - zoomin->setFixedSize(32, 32); -// zoomin->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); - connect(zoomin, SIGNAL(clicked(bool)), this, SLOT(zoomIn())); - -// statusLabel.font().setPointSize(20); - - // add zoom buttons to the layout of the MapControl - QVBoxLayout* overlay_layout_v1 = new QVBoxLayout; - overlay_layout_v1->setMargin(4); - overlay_layout_v1->setSpacing(4); - - QHBoxLayout* overlay_layout_h1 = new QHBoxLayout; - overlay_layout_h1->setMargin(0); - overlay_layout_h1->setSpacing(4); -// overlay_layout_h1->addWidget(gcsButton); -// overlay_layout_h1->addWidget(uavButton); -// overlay_layout_h1->addSpacing(10); - overlay_layout_h1->addWidget(zoomout); - overlay_layout_h1->addWidget(zoomin); - overlay_layout_h1->addStretch(0); - - QHBoxLayout* overlay_layout_h2 = new QHBoxLayout; - overlay_layout_h2->setMargin(0); - overlay_layout_h2->setSpacing(4); - overlay_layout_h2->addStretch(0); -// overlay_layout_h2->addWidget(&statusLabel); - overlay_layout_h2->addStretch(0); - - overlay_layout_v1->addSpacing(10); - overlay_layout_v1->addLayout(overlay_layout_h1); - overlay_layout_v1->addStretch(0); -// overlay_layout_v1->addLayout(overlay_layout_h2); - overlay_layout_v1->addSpacing(10); - - m_map->setLayout(overlay_layout_v1); -} - // ************************************************************************************* // Context menu stuff diff --git a/ground/src/plugins/opmap/opmapgadgetwidget.h b/ground/src/plugins/opmap/opmapgadgetwidget.h index 6800e194a..ce50ba66d 100644 --- a/ground/src/plugins/opmap/opmapgadgetwidget.h +++ b/ground/src/plugins/opmap/opmapgadgetwidget.h @@ -38,9 +38,11 @@ #include "uavobjects/uavobjectmanager.h" #include "uavobjects/positionactual.h" +#include "opmap_mapoverlaywidget.h" #include "opmap_waypointeditor_dialog.h" -namespace Ui { +namespace Ui +{ class OPMap_Widget; } @@ -163,9 +165,9 @@ private: opmap_waypointeditor_dialog *waypoint_editor; - QPushButton * createTransparentButton(QWidget *parent, QString text, QString icon); - void createMapOverlayUserControls(); - + QGraphicsScene *m_map_graphics_scene; + QGraphicsProxyWidget *m_map_scene_proxy; + OPMap_MapOverlayWidget *m_map_overlay_widget; QStandardItemModel *wayPoint_treeView_model;