From 3b3c5827990bce4007067096e086659a2e993954 Mon Sep 17 00:00:00 2001 From: pip Date: Fri, 18 Jun 2010 10:40:30 +0000 Subject: [PATCH] More minor new map user control updates git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@810 ebee16cc-31ac-478f-84a7-5cbb03baadba --- ground/src/plugins/opmap/images/minus.png | Bin 0 -> 1006 bytes ground/src/plugins/opmap/images/plus.png | Bin 0 -> 1133 bytes ground/src/plugins/opmap/opmap.qrc | 2 + .../src/plugins/opmap/opmapgadgetwidget.cpp | 74 ++++++++++-------- 4 files changed, 42 insertions(+), 34 deletions(-) create mode 100644 ground/src/plugins/opmap/images/minus.png create mode 100644 ground/src/plugins/opmap/images/plus.png diff --git a/ground/src/plugins/opmap/images/minus.png b/ground/src/plugins/opmap/images/minus.png new file mode 100644 index 0000000000000000000000000000000000000000..ed29f8f1861262fbb7fa00e632364c0434126e35 GIT binary patch literal 1006 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabR7dyIwh_VCC){ui6xo&c?uz!xv30p zMVShQ77AXac?w1bh6V}-mR80_R;Gpux&}b7=#JZ6pg#5zPhVH|TWmrcraDt@Gi(3~ zaTa()7Bet#eE?xbr!^)sfPyUPj=qiz3>*8o|0J?9FfcO&_=LDJGBR?z`8R$(?X_fs z^VIpX|Nrg#e{b>s|3LMlU^E1VeF$6)cbfq8Bx6aCUoeBivm0qZj*h2`V@SoVckB%`pgT0)}A!P$!wDi|2rWtdKR>`u)Ag_NhOpUXO@ GgeCwt*iI+_ literal 0 HcmV?d00001 diff --git a/ground/src/plugins/opmap/images/plus.png b/ground/src/plugins/opmap/images/plus.png new file mode 100644 index 0000000000000000000000000000000000000000..e191fde5de07d7787df46d72fffab70441842f01 GIT binary patch literal 1133 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabR7dyIwh_VCC){ui6xo&c?uz!xv30p zMVShQ77AXac?w1bh6V}-mR3dl?zx&}a?-tO7})W=@p>FdgVi%p2bOqg>*ogYw$ zv%n*=n1O-o0|+xZtudJa6l6(v^mSxl*x1kgCy|wbftew|C&U#f&h6&k_5V`zzTI9+ zHh3-DWIti%{Qv)F|NlMt|MMyT-_8F2ck2I-egE&x{{M68|JS|$Z%+9CXwv@|eyg{5 zEL)d(>0syoi⩔D!6l`_y66A|DR6(|8epE|3DLfCXa&A5E$ek(0Mrc9MFl3B|(0{ z3=Yq3qyagrJzX3_DsG*fbegYOLBN%jed4JVKO9zm`oI6??iHPD7xs3W&AaRCrxug8 z=}l5c?~)Dcc3lcu#=6!!`dMYv3a!&^FRnL9w=LdqwY%`4LErIhOkW*(E*5>*w^neA zjp_pXh&68|cCanHQ{R5z@jb&YRtF^>J8_)(p7~1PjPG04nZg$hs?OV-E$(+%Wua=5 z8GStVzWR2(SG#^5-(<(NL*q+$rsJY@T3uT{yj`{a6!YXaJO&B8Nryqf?CI*~vd$@? F2>@(k%ANoK literal 0 HcmV?d00001 diff --git a/ground/src/plugins/opmap/opmap.qrc b/ground/src/plugins/opmap/opmap.qrc index 5a1287328..f133b0240 100644 --- a/ground/src/plugins/opmap/opmap.qrc +++ b/ground/src/plugins/opmap/opmap.qrc @@ -3,5 +3,7 @@ images/gcs.png images/uav.png images/waypoint.png + images/minus.png + images/plus.png diff --git a/ground/src/plugins/opmap/opmapgadgetwidget.cpp b/ground/src/plugins/opmap/opmapgadgetwidget.cpp index 4436ec54a..405b6521f 100644 --- a/ground/src/plugins/opmap/opmapgadgetwidget.cpp +++ b/ground/src/plugins/opmap/opmapgadgetwidget.cpp @@ -380,47 +380,53 @@ QPushButton * OPMapGadgetWidget::createTransparentButton(QWidget *parent, QStrin void OPMapGadgetWidget::createMapOverlayUserControls() { - QPushButton *zoomin = createTransparentButton(map, "", QString::fromUtf8(":/core/images/plus.png")); - zoomin->setStyleSheet(""); -// QPushButton *zoomin = new QPushButton(""); - zoomin->setFixedSize(24, 24); + QPushButton *zoomout = new QPushButton(""); + zoomout->setFlat(true); + zoomout->setToolTip(tr("Zoom out")); + zoomout->setCursor(Qt::OpenHandCursor); + zoomout->setIcon(QIcon(QString::fromUtf8(":/opmap/images/minus.png"))); +// zoomout->setIconSize(QSize(12, 12)); + zoomout->setIconSize(QSize(32, 32)); + zoomout->setFixedSize(32, 32); +// zoomout->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); +// zoomout->setWindowOpacity(0.7); +// zoomout->setBackgroundRole(QPalette(QColor(0, 0, 0, 0))); + 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(":/core/images/plus.png"))); - zoomin->setIconSize(QSize(12, 12)); + zoomin->setIcon(QIcon(QString::fromUtf8(":/opmap/images/plus.png"))); +// zoomin->setIconSize(QSize(12, 12)); + zoomin->setIconSize(QSize(32, 32)); + zoomin->setFixedSize(32, 32); +// zoomin->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); connect(zoomin, SIGNAL(clicked(bool)), this, SLOT(zoomIn())); - QPushButton *zoomout = new QPushButton(""); - zoomout->setFixedSize(24, 24); - zoomout->setToolTip(tr("Zoom out")); - zoomout->setCursor(Qt::OpenHandCursor); - zoomout->setIcon(QIcon(QString::fromUtf8(":/core/images/minus.png"))); - zoomout->setIconSize(QSize(12, 12)); -// zoomout->setWindowOpacity(0.7); -// zoomout->setBackgroundRole(QPalette(QColor(0, 0, 0, 0))); - connect(zoomout, SIGNAL(clicked(bool)), this, SLOT(zoomOut())); + // 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); + overlay_layout_v1->addSpacing(10); - // 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); - overlay_layout_v1->addSpacing(10); + QHBoxLayout* overlay_layout_h1 = new QHBoxLayout; + overlay_layout_h1->setMargin(0); + overlay_layout_h1->setSpacing(4); + overlay_layout_h1->addSpacing(10); +// 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_h1 = new QHBoxLayout; - overlay_layout_h1->setMargin(0); - overlay_layout_h1->setSpacing(4); - overlay_layout_h1->addSpacing(10); -// 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); + overlay_layout_v1->addLayout(overlay_layout_h1); + overlay_layout_v1->addStretch(0); - overlay_layout_v1->addLayout(overlay_layout_h1); - overlay_layout_v1->addStretch(0); - - map->setLayout(overlay_layout_v1); + map->setLayout(overlay_layout_v1); } // *************************************************************************************