diff options
Diffstat (limited to 'qt-ui/globe.cpp')
-rw-r--r-- | qt-ui/globe.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/qt-ui/globe.cpp b/qt-ui/globe.cpp index 19dbb048b..95db19083 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->setCloseButtonVisible(false); + messageWidget->setHidden(true); setMapThemeId("earth/googlesat/googlesat.dgml"); //setMapThemeId("earth/openstreetmap/openstreetmap.dgml"); @@ -51,8 +54,6 @@ void GlobeGPS::reload() editingDiveCoords = 0; } - messageWidget->animatedHide(); - loadedDives = new GeoDataDocument; diveLocations.clear(); @@ -132,9 +133,16 @@ void GlobeGPS::mousePressEvent(QMouseEvent* event) } } -void GlobeGPS::setMessageWidget(KMessageWidget* globeMessage) +void GlobeGPS::resizeEvent(QResizeEvent* event) { - messageWidget = globeMessage; -} + int size = event->size().width(); + MarbleWidget::resizeEvent(event); + if (size > 600) + messageWidget->setGeometry((size - 600) / 2, 5, 600, 0); + else + messageWidget->setGeometry(5, 5, size - 10, 0); + + messageWidget->setMaximumHeight(500); +} |