From 5079b1d3489e981d3dfc19e64a642a99923092e2 Mon Sep 17 00:00:00 2001 From: pip Date: Sun, 4 Jul 2010 09:28:52 +0000 Subject: [PATCH] Disabled the waypointeditor dialog git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1018 ebee16cc-31ac-478f-84a7-5cbb03baadba --- ground/src/plugins/opmap/opmap.pro | 18 +- .../plugins/opmap/opmap_mapoverlaywidget.cpp | 63 ----- .../plugins/opmap/opmap_mapoverlaywidget.h | 54 ----- .../plugins/opmap/opmap_overlay_widget.cpp | 14 ++ .../src/plugins/opmap/opmap_overlay_widget.h | 22 ++ ...erlaywidget.ui => opmap_overlay_widget.ui} | 223 +++++++----------- .../plugins/opmap/opmap_statusbar_widget.cpp | 14 ++ .../plugins/opmap/opmap_statusbar_widget.h | 22 ++ .../plugins/opmap/opmap_statusbar_widget.ui | 184 +++++++++++++++ .../opmap/opmap_zoom_slider_widget.cpp | 14 ++ .../plugins/opmap/opmap_zoom_slider_widget.h | 22 ++ .../plugins/opmap/opmap_zoom_slider_widget.ui | 196 +++++++++++++++ .../src/plugins/opmap/opmapgadgetwidget.cpp | 37 ++- ground/src/plugins/opmap/opmapgadgetwidget.h | 9 +- 14 files changed, 620 insertions(+), 272 deletions(-) delete mode 100644 ground/src/plugins/opmap/opmap_mapoverlaywidget.cpp delete mode 100644 ground/src/plugins/opmap/opmap_mapoverlaywidget.h create mode 100644 ground/src/plugins/opmap/opmap_overlay_widget.cpp create mode 100644 ground/src/plugins/opmap/opmap_overlay_widget.h rename ground/src/plugins/opmap/{opmap_mapoverlaywidget.ui => opmap_overlay_widget.ui} (76%) create mode 100644 ground/src/plugins/opmap/opmap_statusbar_widget.cpp create mode 100644 ground/src/plugins/opmap/opmap_statusbar_widget.h create mode 100644 ground/src/plugins/opmap/opmap_statusbar_widget.ui create mode 100644 ground/src/plugins/opmap/opmap_zoom_slider_widget.cpp create mode 100644 ground/src/plugins/opmap/opmap_zoom_slider_widget.h create mode 100644 ground/src/plugins/opmap/opmap_zoom_slider_widget.ui diff --git a/ground/src/plugins/opmap/opmap.pro b/ground/src/plugins/opmap/opmap.pro index 6d0146a2e..a66d5352b 100644 --- a/ground/src/plugins/opmap/opmap.pro +++ b/ground/src/plugins/opmap/opmap.pro @@ -11,8 +11,10 @@ HEADERS += opmapplugin.h \ opmapgadget.h \ opmapgadgetwidget.h \ opmap_waypointeditor_dialog.h \ - opmap_mapoverlaywidget.h \ - opmap_edit_waypoint_dialog.h + opmap_edit_waypoint_dialog.h \ + opmap_zoom_slider_widget.h \ + opmap_statusbar_widget.h \ + opmap_overlay_widget.h SOURCES += opmapplugin.cpp \ opmapgadgetwidget.cpp \ opmapgadgetoptionspage.cpp \ @@ -20,12 +22,16 @@ SOURCES += opmapplugin.cpp \ opmapgadgetconfiguration.cpp \ opmapgadget.cpp \ opmap_waypointeditor_dialog.cpp \ - opmap_mapoverlaywidget.cpp \ - opmap_edit_waypoint_dialog.cpp + opmap_edit_waypoint_dialog.cpp \ + opmap_zoom_slider_widget.cpp \ + opmap_statusbar_widget.cpp \ + opmap_overlay_widget.cpp OTHER_FILES += OPMapGadget.pluginspec FORMS += opmapgadgetoptionspage.ui \ opmap_widget.ui \ opmap_waypointeditor_dialog.ui \ - opmap_mapoverlaywidget.ui \ - opmap_edit_waypoint_dialog.ui + opmap_edit_waypoint_dialog.ui \ + opmap_zoom_slider_widget.ui \ + opmap_statusbar_widget.ui \ + opmap_overlay_widget.ui RESOURCES += opmap.qrc diff --git a/ground/src/plugins/opmap/opmap_mapoverlaywidget.cpp b/ground/src/plugins/opmap/opmap_mapoverlaywidget.cpp deleted file mode 100644 index a19b08fc7..000000000 --- a/ground/src/plugins/opmap/opmap_mapoverlaywidget.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/** - ****************************************************************************** - * - * @file opmap_mapoverlaywidget.cpp - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. - * @brief - * @see The GNU Public License (GPL) Version 3 - * @defgroup opmap - * @{ - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#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 deleted file mode 100644 index 11a0123b5..000000000 --- a/ground/src/plugins/opmap/opmap_mapoverlaywidget.h +++ /dev/null @@ -1,54 +0,0 @@ -/** - ****************************************************************************** - * - * @file opmap_mapoverlaywidget.h - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. - * @brief - * @see The GNU Public License (GPL) Version 3 - * @defgroup opmap - * @{ - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#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_overlay_widget.cpp b/ground/src/plugins/opmap/opmap_overlay_widget.cpp new file mode 100644 index 000000000..fb4b9d6d6 --- /dev/null +++ b/ground/src/plugins/opmap/opmap_overlay_widget.cpp @@ -0,0 +1,14 @@ +#include "opmap_overlay_widget.h" +#include "ui_opmap_overlay_widget.h" + +opmap_overlay_widget::opmap_overlay_widget(QWidget *parent) : + QWidget(parent), + ui(new Ui::opmap_overlay_widget) +{ + ui->setupUi(this); +} + +opmap_overlay_widget::~opmap_overlay_widget() +{ + delete ui; +} diff --git a/ground/src/plugins/opmap/opmap_overlay_widget.h b/ground/src/plugins/opmap/opmap_overlay_widget.h new file mode 100644 index 000000000..c50f29515 --- /dev/null +++ b/ground/src/plugins/opmap/opmap_overlay_widget.h @@ -0,0 +1,22 @@ +#ifndef OPMAP_OVERLAY_WIDGET_H +#define OPMAP_OVERLAY_WIDGET_H + +#include + +namespace Ui { + class opmap_overlay_widget; +} + +class opmap_overlay_widget : public QWidget +{ + Q_OBJECT + +public: + explicit opmap_overlay_widget(QWidget *parent = 0); + ~opmap_overlay_widget(); + +private: + Ui::opmap_overlay_widget *ui; +}; + +#endif // OPMAP_OVERLAY_WIDGET_H diff --git a/ground/src/plugins/opmap/opmap_mapoverlaywidget.ui b/ground/src/plugins/opmap/opmap_overlay_widget.ui similarity index 76% rename from ground/src/plugins/opmap/opmap_mapoverlaywidget.ui rename to ground/src/plugins/opmap/opmap_overlay_widget.ui index 09a24c61c..b57ea6e53 100644 --- a/ground/src/plugins/opmap/opmap_mapoverlaywidget.ui +++ b/ground/src/plugins/opmap/opmap_overlay_widget.ui @@ -1,13 +1,13 @@ - OPMap_MapOverlayWidget - + opmap_overlay_widget + 0 0 - 476 - 289 + 336 + 300 @@ -16,97 +16,23 @@ 0 - - + + true - - false + + Form - /*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: 5px; -/* opacity: 170; */ -} - + background-color: transparent; +border: none; - - - 0 - + 0 + + 20 + 0 @@ -131,35 +57,23 @@ border-radius: 5px; - + 0 0 - - - 27 - 170 - - - - - 27 - 170 - - background-color: rgba(0, 0, 0, 100); border: none; border-radius: 12px; - QFrame::NoFrame + QFrame::StyledPanel QFrame::Raised - + 3 @@ -175,13 +89,32 @@ border-radius: 12px; - background-color: rgba(255, 255, 255, 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/plus.png:/opmap/images/plus.png @@ -192,36 +125,30 @@ border-radius: 12px; - + 0 0 - - - 0 - 120 - - - - - 16777215 - 120 - - QSlider { +background-color: rgba(0, 0, 0, 0); } -background-color: rgba(255, 255, 255, 0); -QSlider::handle:vertical { + +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, y1:0, x2:1, y2:0, stop:0 rgba(128, 128, 128, 255), stop:1 rgba(255, 255, 255, 255)); +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; -height: 20px; margin: -2px 0; border-radius: 3px; } - @@ -233,18 +160,9 @@ border-radius: 3px; 1 - - true - Qt::Vertical - - false - - - false - @@ -256,13 +174,32 @@ border-radius: 3px; - background-color: rgba(255, 255, 255, 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/minus.png:/opmap/images/minus.png @@ -274,7 +211,7 @@ border-radius: 3px; - + Qt::Horizontal @@ -307,7 +244,7 @@ border-radius: 3px; - + Qt::Horizontal @@ -324,6 +261,12 @@ border-radius: 3px; + + + 0 + 0 + + background-color: rgba(0, 0, 0, 100); border: none; @@ -398,7 +341,7 @@ border-radius: 10px; 100 - 14 + 16 @@ -431,7 +374,7 @@ border-radius: 3px; - + Qt::Horizontal @@ -450,6 +393,8 @@ border-radius: 3px; - + + + diff --git a/ground/src/plugins/opmap/opmap_statusbar_widget.cpp b/ground/src/plugins/opmap/opmap_statusbar_widget.cpp new file mode 100644 index 000000000..62353fdcd --- /dev/null +++ b/ground/src/plugins/opmap/opmap_statusbar_widget.cpp @@ -0,0 +1,14 @@ +#include "opmap_statusbar_widget.h" +#include "ui_opmap_statusbar_widget.h" + +opmap_statusbar_widget::opmap_statusbar_widget(QWidget *parent) : + QWidget(parent), + ui(new Ui::opmap_statusbar_widget) +{ + ui->setupUi(this); +} + +opmap_statusbar_widget::~opmap_statusbar_widget() +{ + delete ui; +} diff --git a/ground/src/plugins/opmap/opmap_statusbar_widget.h b/ground/src/plugins/opmap/opmap_statusbar_widget.h new file mode 100644 index 000000000..d8a5f0451 --- /dev/null +++ b/ground/src/plugins/opmap/opmap_statusbar_widget.h @@ -0,0 +1,22 @@ +#ifndef OPMAP_STATUSBAR_WIDGET_H +#define OPMAP_STATUSBAR_WIDGET_H + +#include + +namespace Ui { + class opmap_statusbar_widget; +} + +class opmap_statusbar_widget : public QWidget +{ + Q_OBJECT + +public: + explicit opmap_statusbar_widget(QWidget *parent = 0); + ~opmap_statusbar_widget(); + +private: + Ui::opmap_statusbar_widget *ui; +}; + +#endif // OPMAP_STATUSBAR_WIDGET_H diff --git a/ground/src/plugins/opmap/opmap_statusbar_widget.ui b/ground/src/plugins/opmap/opmap_statusbar_widget.ui new file mode 100644 index 000000000..de0d73403 --- /dev/null +++ b/ground/src/plugins/opmap/opmap_statusbar_widget.ui @@ -0,0 +1,184 @@ + + + opmap_statusbar_widget + + + + 0 + 0 + 501 + 20 + + + + + 0 + 0 + + + + Form + + + background-color: rgba(0, 0, 0, 0); +border: none; + + + + + 0 + + + 0 + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + 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 + + + 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); +} +QProgressBar::chunk { +background-color: rgb(85, 85, 255); +background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(160, 160, 255, 255), stop:1 rgba(80, 80, 160, 255)); +border: none; +border-radius: 3px; +} + + + 24 + + + Qt::AlignCenter + + + %v + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 40 + 20 + + + + + + + + + diff --git a/ground/src/plugins/opmap/opmap_zoom_slider_widget.cpp b/ground/src/plugins/opmap/opmap_zoom_slider_widget.cpp new file mode 100644 index 000000000..6bd4208a7 --- /dev/null +++ b/ground/src/plugins/opmap/opmap_zoom_slider_widget.cpp @@ -0,0 +1,14 @@ +#include "opmap_zoom_slider_widget.h" +#include "ui_opmap_zoom_slider_widget.h" + +opmap_zoom_slider_widget::opmap_zoom_slider_widget(QWidget *parent) : + QWidget(parent), + ui(new Ui::opmap_zoom_slider_widget) +{ + ui->setupUi(this); +} + +opmap_zoom_slider_widget::~opmap_zoom_slider_widget() +{ + delete ui; +} diff --git a/ground/src/plugins/opmap/opmap_zoom_slider_widget.h b/ground/src/plugins/opmap/opmap_zoom_slider_widget.h new file mode 100644 index 000000000..5728c46c1 --- /dev/null +++ b/ground/src/plugins/opmap/opmap_zoom_slider_widget.h @@ -0,0 +1,22 @@ +#ifndef OPMAP_ZOOM_SLIDER_WIDGET_H +#define OPMAP_ZOOM_SLIDER_WIDGET_H + +#include + +namespace Ui { + class opmap_zoom_slider_widget; +} + +class opmap_zoom_slider_widget : public QWidget +{ + Q_OBJECT + +public: + explicit opmap_zoom_slider_widget(QWidget *parent = 0); + ~opmap_zoom_slider_widget(); + +private: + Ui::opmap_zoom_slider_widget *ui; +}; + +#endif // OPMAP_ZOOM_SLIDER_WIDGET_H diff --git a/ground/src/plugins/opmap/opmap_zoom_slider_widget.ui b/ground/src/plugins/opmap/opmap_zoom_slider_widget.ui new file mode 100644 index 000000000..4cc3aa9d8 --- /dev/null +++ b/ground/src/plugins/opmap/opmap_zoom_slider_widget.ui @@ -0,0 +1,196 @@ + + + opmap_zoom_slider_widget + + + + 0 + 0 + 27 + 187 + + + + + 0 + 0 + + + + Form + + + background-color: rgba(0, 0, 0, 0); +border: none; + + + + + 0 + + + 0 + + + + + + 0 + 0 + + + + background-color: rgba(0, 0, 0, 100); +border: none; +border-radius: 12px; + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 3 + + + 3 + + + + + + 0 + 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/plus.png:/opmap/images/plus.png + + + true + + + + + + + + 0 + 0 + + + + QSlider { +background-color: rgba(0, 0, 0, 0); +} + +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; +} + + + + 2 + + + 19 + + + 1 + + + Qt::Vertical + + + + + + + + 0 + 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/minus.png:/opmap/images/minus.png + + + true + + + + + + + + + + + + + diff --git a/ground/src/plugins/opmap/opmapgadgetwidget.cpp b/ground/src/plugins/opmap/opmapgadgetwidget.cpp index 7c527fdac..3850ee324 100644 --- a/ground/src/plugins/opmap/opmapgadgetwidget.cpp +++ b/ground/src/plugins/opmap/opmapgadgetwidget.cpp @@ -47,9 +47,13 @@ OPMapGadgetWidget::OPMapGadgetWidget(QWidget *parent) : QWidget(parent) m_widget = NULL; m_map = NULL; findPlaceCompleter = NULL; + m_overlay_widget = NULL; + m_map_graphics_scene = NULL; m_map_scene_proxy = NULL; - m_map_overlay_widget = NULL; + m_zoom_slider_widget = NULL; + m_statusbar_widget = NULL; + m_plugin_manager = NULL; m_objManager = NULL; @@ -100,18 +104,32 @@ OPMapGadgetWidget::OPMapGadgetWidget(QWidget *parent) : QWidget(parent) 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 + + // doing this makes the map VERY slow :( + /* - m_map_overlay_widget = new OPMap_MapOverlayWidget(); + m_zoom_slider_widget = new opmap_zoom_slider_widget(); + m_statusbar_widget = new opmap_statusbar_widget(); 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_widget->mapWidget->geometry()); + m_map_scene_proxy = m_map_graphics_scene->addWidget(m_zoom_slider_widget); + m_map_scene_proxy = m_map_graphics_scene->addWidget(m_statusbar_widget); + + m_zoom_slider_widget->move(m_map->width() - 20 - m_zoom_slider_widget->width(), 20); + m_statusbar_widget->move(0, m_map->height() - m_statusbar_widget->height()); +*/ +/* + m_overlay_widget = new opmap_overlay_widget(m_map); + QVBoxLayout *layout2 = new QVBoxLayout; + layout2->setSpacing(0); + layout2->setContentsMargins(0, 0, 0, 0); + layout2->addWidget(m_overlay_widget); + m_map->setLayout(layout2); */ // ************** // set the user control options @@ -294,7 +312,8 @@ OPMapGadgetWidget::~OPMapGadgetWidget() onClearWayPointsAct_triggered(); - if (m_map_overlay_widget) delete m_map_overlay_widget; + if (m_zoom_slider_widget) delete m_zoom_slider_widget; + if (m_statusbar_widget) delete m_statusbar_widget; if (m_map) delete m_map; if (m_widget) delete m_widget; } @@ -767,7 +786,8 @@ void OPMapGadgetWidget::on_toolButtonAddWaypoint_clicked() void OPMapGadgetWidget::on_toolButtonWaypointEditor_clicked() { - wayPointEditorAct->trigger(); + if (wayPointEditorAct->isEnabled()) + wayPointEditorAct->trigger(); } void OPMapGadgetWidget::on_treeViewWaypoints_clicked(QModelIndex index) @@ -949,6 +969,7 @@ void OPMapGadgetWidget::createActions() wayPointEditorAct = new QAction(tr("&Waypoint editor"), this); wayPointEditorAct->setShortcut(tr("Ctrl+W")); wayPointEditorAct->setStatusTip(tr("Open the waypoint editor")); + wayPointEditorAct->setEnabled(false); // temporary connect(wayPointEditorAct, SIGNAL(triggered()), this, SLOT(onOpenWayPointEditorAct_triggered())); addWayPointAct = new QAction(tr("&Add waypoint"), this); @@ -1102,7 +1123,7 @@ void OPMapGadgetWidget::onFollowUAVpositionAct_toggled(bool checked) if (m_map) { - m_map->SetCanDragMap(!checked); // allow/disallow manual map dragging +// m_map->SetCanDragMap(!checked); // allow/disallow manual map dragging if (!checked) m_map->SetRotate(0); // reset map rotation to 0deg } } diff --git a/ground/src/plugins/opmap/opmapgadgetwidget.h b/ground/src/plugins/opmap/opmapgadgetwidget.h index 89b31f123..4c2a773c0 100644 --- a/ground/src/plugins/opmap/opmapgadgetwidget.h +++ b/ground/src/plugins/opmap/opmapgadgetwidget.h @@ -41,7 +41,9 @@ #include "uavobjects/positionactual.h" #include "extensionsystem/pluginmanager.h" -#include "opmap_mapoverlaywidget.h" +#include "opmap_overlay_widget.h" +#include "opmap_zoom_slider_widget.h" +#include "opmap_statusbar_widget.h" #include "opmap_waypointeditor_dialog.h" #include "opmap_edit_waypoint_dialog.h" @@ -195,9 +197,12 @@ private: opmap_edit_waypoint_dialog waypoint_edit_dialog; + opmap_overlay_widget *m_overlay_widget; + QGraphicsScene *m_map_graphics_scene; QGraphicsProxyWidget *m_map_scene_proxy; - OPMap_MapOverlayWidget *m_map_overlay_widget; + opmap_zoom_slider_widget *m_zoom_slider_widget; + opmap_statusbar_widget *m_statusbar_widget; QStandardItemModel wayPoint_treeView_model;