From 20535abf53d54843c6c46f66c289d238bae7bc99 Mon Sep 17 00:00:00 2001 From: pip Date: Mon, 21 Jun 2010 15:40:41 +0000 Subject: [PATCH] Re-arranged the user controls and changed the colours on the new map plug-in. git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@848 ebee16cc-31ac-478f-84a7-5cbb03baadba --- ground/src/plugins/opmap/opmap_widget.ui | 955 +++++++++++------- .../src/plugins/opmap/opmapgadgetwidget.cpp | 15 +- 2 files changed, 596 insertions(+), 374 deletions(-) diff --git a/ground/src/plugins/opmap/opmap_widget.ui b/ground/src/plugins/opmap/opmap_widget.ui index 6f3d9474b..d3f6fe332 100644 --- a/ground/src/plugins/opmap/opmap_widget.ui +++ b/ground/src/plugins/opmap/opmap_widget.ui @@ -6,8 +6,8 @@ 0 0 - 732 - 372 + 647 + 441 @@ -30,390 +30,403 @@ 0 - + - 8 + 0 - 8 + 0 - 8 + 0 - + - - 0 - 0 - - - - Reload map - - - Reload - - - - 20 - 20 - - - - true - - - Qt::NoArrow - - - - - - - Qt::Vertical - - - - - - - Find place - - - - - - - :/core/images/find.png:/core/images/find.png - - - - 20 - 20 - - - - true - - - Qt::NoArrow - - - - - - - Qt::Vertical - - - - - - - Zoom out - - - - - - - :/core/images/minus.png:/core/images/minus.png - - - - 20 - 20 - - - - true - - - - - - - Zoom in - - - - - - - :/core/images/plus.png:/core/images/plus.png - - - - 20 - 20 - - - - true - - - - - - - - 0 - 0 - - - - - 8 - 50 - false - - - - Zoom - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - Qt::Vertical - - - - - - - Rotate anticlockwise - - - - - - - :/core/images/undo.png:/core/images/undo.png - - - - 20 - 20 - - - - true - - - - - - - Reset rotation - - - - - - - :/core/images/clear.png:/core/images/clear.png - - - - 20 - 20 - - - - true - - - - - - - Rotate clockwise - - - - - - - :/core/images/redo.png:/core/images/redo.png - - - - 20 - 20 - - - - true - - - - - - - - 0 - 0 - - - - - 8 - 50 - false - - - - Rotate - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - Qt::Vertical - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - + 0 0 - 40 - 14 + 0 + 0 - - - 100 - 10 - - - - false - - QProgressBar { -/*border: 1px solid black;*/ -border: none; -padding: 1px; -/*border-top-left-radius: 7px; -border-bottom-left-radius: 7px;*/ -background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(0, 0, 0, 255), stop:1 rgba(100, 100, 100, 255)); -/*width: 15px;*/ - color: rgb(255, 255, 255); -} -QProgressBar::chunk { - background-color: rgb(85, 85, 255); -border: none; -} + background-color: rgb(72, 72, 72); - - 50 + + QFrame::NoFrame - - Qt::AlignCenter - - - true - - - false - - - %v - - - - - - - Qt::Vertical - - - - - - - - 0 - 0 - - - - - 9 - 50 - false - false - true - - - - labelMapPos - - - Qt::AlignCenter - - - - - - - Qt::Vertical - - - - - - - - 0 - 0 - - - - - 9 - 50 - false - false - true - - - - labelMousePos - - - Qt::AlignCenter + + QFrame::Raised + + + 0 + + + 0 + + + 5 + + + 0 + + + 0 + + + + + 8 + + + 8 + + + 8 + + + + + + 0 + 0 + + + + Reload map + + + background-color: rgba(255, 255, 255, 0); +color: rgb(255, 255, 255); + + + Reload + + + + 16 + 16 + + + + true + + + Qt::NoArrow + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + Find place + + + background-color: rgba(255, 255, 255, 0); +color: rgb(255, 255, 255); + + + + + + + :/core/images/find.png:/core/images/find.png + + + + 16 + 16 + + + + true + + + Qt::NoArrow + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + Zoom out + + + background-color: rgba(255, 255, 255, 0); +color: rgb(255, 255, 255); + + + + + + + :/core/images/minus.png:/core/images/minus.png + + + + 16 + 16 + + + + true + + + + + + + Zoom in + + + background-color: rgba(255, 255, 255, 0); +color: rgb(255, 255, 255); + + + + + + + :/core/images/plus.png:/core/images/plus.png + + + + 16 + 16 + + + + true + + + + + + + + 0 + 0 + + + + + 8 + 50 + false + + + + background-color: rgba(255, 255, 255, 0); +color: rgb(255, 255, 255); + + + Zoom + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + Rotate anticlockwise + + + background-color: rgba(255, 255, 255, 0); +color: rgb(255, 255, 255); + + + + + + + :/core/images/undo.png:/core/images/undo.png + + + + 16 + 16 + + + + true + + + true + + + + + + + Reset rotation + + + background-color: rgba(255, 255, 255, 0); +color: rgb(255, 255, 255); + + + + + + + :/core/images/clear.png:/core/images/clear.png + + + + 16 + 16 + + + + true + + + + + + + Rotate clockwise + + + background-color: rgba(255, 255, 255, 0); +color: rgb(255, 255, 255); + + + + + + + :/core/images/redo.png:/core/images/redo.png + + + + 16 + 16 + + + + true + + + true + + + + + + + + 0 + 0 + + + + + 8 + 50 + false + + + + background-color: rgba(255, 255, 255, 0); +color: rgb(255, 255, 255); + + + Rotate + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + @@ -434,6 +447,216 @@ border: none; + + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + + 0 + 0 + + + + background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(68, 68, 68, 255), stop:1 rgba(117, 117, 117, 255)); + + + QFrame::NoFrame + + + QFrame::Raised + + + + 0 + + + 0 + + + + + 8 + + + 8 + + + 8 + + + + + + 0 + 0 + + + + + 9 + 50 + false + false + true + + + + Map position + + + color: rgb(255, 255, 255); +background-color: rgba(255, 255, 255, 0); + + + labelMapPos + + + Qt::AlignCenter + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + 0 + 0 + + + + + 9 + 50 + false + false + true + + + + Mouse position + + + color: rgb(255, 255, 255); +background-color: rgba(255, 255, 255, 0); + + + labelMousePos + + + Qt::AlignCenter + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 40 + 12 + + + + + 100 + 10 + + + + false + + + QProgressBar { +/*border: 1px solid black;*/ +border: none; +padding: 1px; +/*border-top-left-radius: 7px; +border-bottom-left-radius: 7px;*/ +background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(0, 0, 0, 255), stop:1 rgba(100, 100, 100, 255)); +/*width: 15px;*/ + color: rgb(255, 255, 255); +} +QProgressBar::chunk { + background-color: rgb(85, 85, 255); +border: none; +} + + + 50 + + + Qt::AlignCenter + + + true + + + false + + + %v + + + + + + + labelMapPos + layoutWidget_2 + + + + diff --git a/ground/src/plugins/opmap/opmapgadgetwidget.cpp b/ground/src/plugins/opmap/opmapgadgetwidget.cpp index d007de400..cd7b18e1e 100644 --- a/ground/src/plugins/opmap/opmapgadgetwidget.cpp +++ b/ground/src/plugins/opmap/opmapgadgetwidget.cpp @@ -54,6 +54,7 @@ OPMapGadgetWidget::OPMapGadgetWidget(QWidget *parent) : QWidget(parent) m_positionActual = PositionActual::GetInstance(objManager); // ************** + // create the widget that holds the user controls and the map m_widget = new Ui_OPMap_Widget(); m_widget->setupUi(this); @@ -62,7 +63,6 @@ OPMapGadgetWidget::OPMapGadgetWidget(QWidget *parent) : QWidget(parent) // create the map display m_map = new mapcontrol::OPMapWidget(); -// m_map = new mapcontrol::OPMapWidget(widget->mapWidget); if (m_map) { @@ -75,8 +75,8 @@ OPMapGadgetWidget::OPMapGadgetWidget(QWidget *parent) : QWidget(parent) // ************** // set the user control options - m_widget->labelZoom->setText(" " + QString::number(m_map->Zoom())); - m_widget->labelRotate->setText(" " + QString::number(m_map->Rotate())); + m_widget->labelZoom->setText(QString::number(m_map->Zoom())); + m_widget->labelRotate->setText(QString::number(m_map->Rotate())); // m_widget->labelNumTilesToLoad->setText(" 0"); m_widget->labelMapPos->setText(""); m_widget->labelMousePos->setText(""); @@ -96,20 +96,20 @@ OPMapGadgetWidget::OPMapGadgetWidget(QWidget *parent) : QWidget(parent) { connect(m_map, SIGNAL(zoomChanged(double)), this, SLOT(zoomChanged(double))); // map zoom change signals connect(m_map, SIGNAL(OnCurrentPositionChanged(internals::PointLatLng)), this, SLOT(OnCurrentPositionChanged(internals::PointLatLng))); // map poisition change signals - connect(m_map, SIGNAL(OnTileLoadComplete()), this, SLOT(OnTileLoadComplete())); // tile loading stop signals + connect(m_map, SIGNAL(OnTileLoadComplete()), this, SLOT(OnTileLoadComplete())); // tile loading stop signals connect(m_map, SIGNAL(OnTileLoadStart()), this, SLOT(OnTileLoadStart())); // tile loading start signals connect(m_map, SIGNAL(OnMapDrag()), this, SLOT(OnMapDrag())); // map drag signals connect(m_map, SIGNAL(OnMapZoomChanged()), this, SLOT(OnMapZoomChanged())); // map zoom changed - connect(m_map, SIGNAL(OnMapTypeChanged(MapType::Types)), this, SLOT(OnMapTypeChanged(MapType::Types))); // map type changed + connect(m_map, SIGNAL(OnMapTypeChanged(MapType::Types)), this, SLOT(OnMapTypeChanged(MapType::Types))); // map type changed connect(m_map, SIGNAL(OnEmptyTileError(int, core::Point)), this, SLOT(OnEmptyTileError(int, core::Point))); // tile error connect(m_map, SIGNAL(OnTilesStillToLoad(int)), this, SLOT(OnTilesStillToLoad(int))); // tile loading signals m_map->SetMaxZoom(19); // increase the maximum zoom level - m_map->SetMouseWheelZoomType(internals::MouseWheelZoomType::MousePositionWithoutCenter); // set how the mouse wheel zoom functions + m_map->SetMouseWheelZoomType(internals::MouseWheelZoomType::MousePositionWithoutCenter); // set how the mouse wheel zoom functions m_map->SetFollowMouse(true); // we want a contiuous mouse position reading m_map->SetUseOpenGL(openGLAct->isChecked()); // enable/disable openGL m_map->SetShowTileGridLines(gridLinesAct->isChecked()); // map grid lines on/off - m_map->SetCurrentPosition(internals::PointLatLng(data.Latitude, data.Longitude)); // set the default map position + m_map->SetCurrentPosition(internals::PointLatLng(data.Latitude, data.Longitude)); // set the default map position } // ************** @@ -157,7 +157,6 @@ OPMapGadgetWidget::~OPMapGadgetWidget() void OPMapGadgetWidget::resizeEvent(QResizeEvent *event) { -// if (map) map->resize(QSize(width(), height())); update(); QWidget::resizeEvent(event); }