diff --git a/ground/src/plugins/opmap/opmap_edit_waypoint_dialog.ui b/ground/src/plugins/opmap/opmap_edit_waypoint_dialog.ui
index 7db936a9b..2b3397c0f 100644
--- a/ground/src/plugins/opmap/opmap_edit_waypoint_dialog.ui
+++ b/ground/src/plugins/opmap/opmap_edit_waypoint_dialog.ui
@@ -181,7 +181,7 @@
- Height
+ Altitude
Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
@@ -189,7 +189,7 @@
-
-
+
0
diff --git a/ground/src/plugins/opmap/opmap_mapoverlaywidget.ui b/ground/src/plugins/opmap/opmap_mapoverlaywidget.ui
index b5d68b64e..09a24c61c 100644
--- a/ground/src/plugins/opmap/opmap_mapoverlaywidget.ui
+++ b/ground/src/plugins/opmap/opmap_mapoverlaywidget.ui
@@ -6,8 +6,8 @@
0
0
- 287
- 299
+ 476
+ 289
@@ -95,7 +95,7 @@ background-color: white;
color: black;
border: 1px solid black;
padding: 5px;
-border-radius: 2px;
+border-radius: 5px;
/* opacity: 170; */
}
@@ -114,193 +114,7 @@ border-radius: 2px;
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
-
-
-
-
+
-
@@ -315,44 +129,166 @@ 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);
-}
-
+
+
+
+ 0
+ 0
+
-
-
-
-
-
- :/opmap/images/right_but.png:/opmap/images/right_but.png
-
-
+
- 17
- 48
+ 27
+ 170
+
+
+ 27
+ 170
+
+
+
+ background-color: rgba(0, 0, 0, 100);
+border: none;
+border-radius: 12px;
+
+
+ QFrame::NoFrame
+
+
+ QFrame::Raised
+
+
+
+ 3
+
+
+ 3
+
+
-
+
+
+
+ 0
+ 0
+
+
+
+ background-color: rgba(255, 255, 255, 0);
+
+
+
+
+
+
+ :/opmap/images/plus.png:/opmap/images/plus.png
+
+
+ true
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 0
+ 120
+
+
+
+
+ 16777215
+ 120
+
+
+
+ QSlider {
+}
+background-color: rgba(255, 255, 255, 0);
+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
+
+
+
+ background-color: rgba(255, 255, 255, 0);
+
+
+
+
+
+
+ :/opmap/images/minus.png:/opmap/images/minus.png
+
+
+ true
+
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+ QSizePolicy::Fixed
+
+
+
+ 10
+ 20
+
+
+
+
-
@@ -369,84 +305,106 @@ color: rgb(255, 255, 255);
-
-
-
- 20
-
-
- 20
-
-
- 20
-
-
-
- -
-
-
- background-color: rgba(0, 0, 0, 100);
-
-
- QFrame::StyledPanel
-
-
- QFrame::Raised
-
-
-
- 3
-
-
- 3
-
-
-
-
-
- QLabel { /* all label types */
+
+
-
+
+
+ Qt::Horizontal
+
+
+ QSizePolicy::Fixed
+
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
+ background-color: rgba(0, 0, 0, 100);
+border: none;
+border-radius: 8px;
+border-bottom-left-radius: 0px;
+border-bottom-right-radius: 0px;
+
+
+ QFrame::StyledPanel
+
+
+ QFrame::Raised
+
+
+
+ 0
+
+
+ 0
+
+
-
+
+
+ QLabel { /* all label types */
color: rgb(255, 255, 255);
background-color: rgba(255, 255, 255, 0);
border: none;
border-radius: 10px;
}
-
-
- QFrame::NoFrame
-
-
- TextLabel
-
-
- Qt::AlignCenter
-
-
- 1
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
- -
-
-
-
- 16777215
- 15
-
-
-
- QProgressBar {
+
+
+ QFrame::NoFrame
+
+
+ labelStatus
+
+
+ Qt::AlignCenter
+
+
+ 1
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 100
+ 0
+
+
+
+
+ 100
+ 14
+
+
+
+ QProgressBar {
border: nonei;
+border-radius: 5px;
padding: 3px;
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);
@@ -457,25 +415,41 @@ background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0
border: none;
border-radius: 3px;
}
-
-
- 24
-
-
- Qt::AlignCenter
-
-
- %v
-
-
-
-
-
+
+
+ 24
+
+
+ Qt::AlignCenter
+
+
+ %v
+
+
+
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+ QSizePolicy::Fixed
+
+
+
+ 40
+ 20
+
+
+
+
+
-
-
-
+
diff --git a/ground/src/plugins/opmap/opmap_waypointeditor_dialog.ui b/ground/src/plugins/opmap/opmap_waypointeditor_dialog.ui
index d73031162..9beee66be 100644
--- a/ground/src/plugins/opmap/opmap_waypointeditor_dialog.ui
+++ b/ground/src/plugins/opmap/opmap_waypointeditor_dialog.ui
@@ -126,7 +126,7 @@ QSplitter::handle:vertical {
- Height
+ Altitude
diff --git a/ground/src/plugins/opmap/opmap_widget.ui b/ground/src/plugins/opmap/opmap_widget.ui
index f3bec5d70..2bb32e590 100644
--- a/ground/src/plugins/opmap/opmap_widget.ui
+++ b/ground/src/plugins/opmap/opmap_widget.ui
@@ -118,37 +118,30 @@ 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);
+border: 1px solid black;
+border-radius: 0px;
}
QComboBox::down-arrow:on {
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));
-top: 1px; left: 1px; /* shift the arrow when popup is open */
+top: 1px; left: 1px; /* move the arrow when the popup is open */
}
QComboBox::down-arrow {
image: url(:/opmap/images/combobox_down_arrow.png);
}
QComboBox:drop-down {
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));
- subcontrol-origin: padding;
+/* subcontrol-origin: padding;
subcontrol-position: top right;
border-left-style: 1px solid white;
border-top-right-radius: 1px;
- border-bottom-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;
-border-radius: 3px;
-}
-
-QToolTip {
-background-color: white;
-color: black;
border: 1px solid black;
-padding: 5px;
-border-radius: 3px;
-/* opacity: 170; */
+selection-background-color: rgb(128, 128, 128);
+border-radius: 2px;
}
@@ -797,7 +790,7 @@ QTreeView::branch:open:has-children:!has-siblings, QTreeView::branch:open:has-ch
-background-color: black;
+/* background-color: black; */
border: 1px solid black;
QLabel { /* all label types */
@@ -858,15 +851,6 @@ QComboBox:drop-down {
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; */
-}
@@ -918,15 +902,6 @@ 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(180, 180, 180, 255));
color: rgb(255, 255, 255);
}
-
-QToolTip {
-background-color: white;
-color: black;
-border: 1px solid black;
-padding: 2px;
-border-radius: 3px;
-/* opacity: 170; */
-}
@@ -1185,15 +1160,6 @@ color: rgb(255, 255, 255);
border: none;
border-radius: 3px;
}
-
-QToolTip {
-background-color: rgb(255, 255, 255);
-color: rgb(0, 0, 0);
-border: 1px solid blacki;
-padding: 5px;
-border-radius: 3px;
-/* opacity: 170; */
-}
diff --git a/ground/src/plugins/opmap/opmapgadgetoptionspage.ui b/ground/src/plugins/opmap/opmapgadgetoptionspage.ui
index 20f991374..66ad4365a 100644
--- a/ground/src/plugins/opmap/opmapgadgetoptionspage.ui
+++ b/ground/src/plugins/opmap/opmapgadgetoptionspage.ui
@@ -24,7 +24,7 @@
5
-
-
+
-
@@ -37,6 +37,15 @@
-
+
+
+ 120
+ 0
+
+
+
+ true
+
8
@@ -63,6 +72,15 @@
-
+
+
+ 120
+ 0
+
+
+
+ true
+
8
@@ -86,6 +104,18 @@
-
+
+
+ 50
+ 16777215
+
+
+
+ true
+
+
+ 2
+
18
@@ -106,6 +136,12 @@
OpenHandCursor
+
+ 15
+
+
+ true
+
-
@@ -134,6 +170,19 @@
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
-
@@ -260,6 +309,9 @@
OpenHandCursor
+
+ true
+
@@ -278,6 +330,9 @@
false
+
+ 512
+
-
diff --git a/ground/src/plugins/opmap/opmapgadgetwidget.cpp b/ground/src/plugins/opmap/opmapgadgetwidget.cpp
index bf0ee5354..1a6dc3ca7 100644
--- a/ground/src/plugins/opmap/opmapgadgetwidget.cpp
+++ b/ground/src/plugins/opmap/opmapgadgetwidget.cpp
@@ -50,6 +50,8 @@ OPMapGadgetWidget::OPMapGadgetWidget(QWidget *parent) : QWidget(parent)
m_map_scene_proxy = NULL;
m_map_overlay_widget = NULL;
+ m_mouse_waypoint = NULL;
+
prev_tile_number = 0;
// **************
@@ -71,8 +73,6 @@ OPMapGadgetWidget::OPMapGadgetWidget(QWidget *parent) : QWidget(parent)
m_map->setFrameStyle(QFrame::NoFrame);
m_map->configuration->DragButton = Qt::LeftButton; // use the left mouse button for map dragging
-
- m_map->setStyleSheet(" QToolTip { background-color: white; color: black; border: 1px solid black; padding: 5px; border-radius: 2px; /* opacity: 170; */ } ");
}
// **************
@@ -94,7 +94,7 @@ OPMapGadgetWidget::OPMapGadgetWidget(QWidget *parent) : QWidget(parent)
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());
+ m_map_overlay_widget->setGeometry(m_widget->mapWidget->geometry());
*/
// **************
// Get required UAVObjects
@@ -291,7 +291,23 @@ void OPMapGadgetWidget::mouseMoveEvent(QMouseEvent *event)
void OPMapGadgetWidget::contextMenuEvent(QContextMenuEvent *event)
{
+ if (!m_map)
+ return; // we don't appear to have a map to work with!
+
+ if (event->reason() != QContextMenuEvent::Mouse)
+ return; // not a mouse click event
+
+ QPoint p = m_map->mapFromGlobal(QCursor::pos());
+
+ if (!m_map->contentsRect().contains(p))
+ return; // the mouse click was not on the map
+
+ // find out if we have a waypoint under the mouse cursor
+ QGraphicsItem *item = m_map->itemAt(p);
+ m_mouse_waypoint = qgraphicsitem_cast(item);
+
// ****************
+ // create the popup menu
QMenu zoomMenu(tr("&Zoom ") + "(" + QString::number(m_map->Zoom()) + ")", this);
zoomMenu.addAction(zoom2Act);
@@ -348,11 +364,18 @@ void OPMapGadgetWidget::contextMenuEvent(QContextMenuEvent *event)
menu.addAction(wayPointEditorAct);
menu.addAction(addWayPointAct);
- menu.addAction(editWayPointAct);
- menu.addAction(deleteWayPointAct);
- menu.addAction(clearWayPointsAct);
+ if (m_mouse_waypoint)
+ { // we have a waypoint under the mouse
+ menu.addAction(editWayPointAct);
+ menu.addAction(deleteWayPointAct);
+ }
- menu.addSeparator();
+ m_waypoint_list_mutex.lock();
+ if (m_waypoint_list.count() > 0)
+ menu.addAction(clearWayPointsAct); // we have waypoints
+ m_waypoint_list_mutex.unlock();
+
+// menu.addSeparator();
menu.exec(event->globalPos());
@@ -1070,12 +1093,17 @@ void OPMapGadgetWidget::addWayPoint()
void OPMapGadgetWidget::editWayPoint()
{
+ if (!m_mouse_waypoint) return;
+
// to do
+
waypoint_edit_dialog.show();
}
void OPMapGadgetWidget::deleteWayPoint()
{
+ if (!m_mouse_waypoint) return;
+
// to do
}
diff --git a/ground/src/plugins/opmap/opmapgadgetwidget.h b/ground/src/plugins/opmap/opmapgadgetwidget.h
index 7311a0436..ebe99b05f 100644
--- a/ground/src/plugins/opmap/opmapgadgetwidget.h
+++ b/ground/src/plugins/opmap/opmapgadgetwidget.h
@@ -211,6 +211,8 @@ private:
QStandardItemModel *wayPoint_treeView_model;
+ mapcontrol::WayPointItem *m_mouse_waypoint;
+
QList m_waypoint_list;
QMutex m_waypoint_list_mutex;