[PATCH] Avoid marble widget resize when switching dives

subsurface at henrik.synth.no subsurface at henrik.synth.no
Fri May 24 12:16:04 PDT 2013


From: Henrik Brautaset Aronsen <subsurface at henrik.synth.no>

The "no dive location" message box was displayed above the marble
widget, which made the layout splitter move horizontally.

Made the message box as an overlay on the map instead.

Signed-off-by: Henrik Brautaset Aronsen <subsurface at henrik.synth.no>
---
 qt-ui/globe.cpp      | 5 +++--
 qt-ui/mainwindow.cpp | 3 ---
 qt-ui/mainwindow.ui  | 3 ---
 3 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/qt-ui/globe.cpp b/qt-ui/globe.cpp
index 7eee4fb..d131f22 100644
--- a/qt-ui/globe.cpp
+++ b/qt-ui/globe.cpp
@@ -18,6 +18,9 @@
 
 GlobeGPS::GlobeGPS(QWidget* parent) : MarbleWidget(parent), loadedDives(0)
 {
+	messageWidget = new KMessageWidget(this);
+	messageWidget->setGeometry(5, 5, 300, 200);
+	messageWidget->setCloseButtonVisible(false);
 
 	setMapThemeId("earth/bluemarble/bluemarble.dgml");
 	//setMapThemeId("earth/openstreetmap/openstreetmap.dgml");
@@ -51,8 +54,6 @@ void GlobeGPS::reload()
 		editingDiveCoords = 0;
 	}
 
-	messageWidget->animatedHide();
-
 	loadedDives = new GeoDataDocument;
 
 	diveLocations.clear();
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index 53138f5..18bfd2e 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -39,10 +39,7 @@ MainWindow::MainWindow() : ui(new Ui::MainWindow())
 	ui->setupUi(this);
 	setWindowIcon(QIcon(":subsurface-icon"));
 	connect(ui->ListWidget, SIGNAL(currentDiveChanged(int)), this, SLOT(current_dive_changed(int)));
-	ui->globeMessage->hide();
 	ui->mainErrorMessage->hide();
-	ui->globe->setMessageWidget(ui->globeMessage);
-	ui->globeMessage->setCloseButtonVisible(false);
 	ui->ProfileWidget->setFocusProxy(ui->ListWidget);
 	ui->ListWidget->reload();
 	readSettings();
diff --git a/qt-ui/mainwindow.ui b/qt-ui/mainwindow.ui
index 658f22c..3f97267 100644
--- a/qt-ui/mainwindow.ui
+++ b/qt-ui/mainwindow.ui
@@ -85,9 +85,6 @@
        <widget class="QWidget" name="layoutWidget">
         <layout class="QVBoxLayout" name="verticalLayout">
          <item>
-          <widget class="KMessageWidget" name="globeMessage" native="true"/>
-         </item>
-         <item>
           <widget class="GlobeGPS" name="globe" native="true"/>
          </item>
         </layout>
-- 
1.8.1.3



More information about the subsurface mailing list