summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/globe.cpp18
-rw-r--r--qt-ui/globe.h3
-rw-r--r--qt-ui/mainwindow.cpp3
-rw-r--r--qt-ui/mainwindow.ui3
4 files changed, 14 insertions, 13 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);
+}
diff --git a/qt-ui/globe.h b/qt-ui/globe.h
index 1e0960b76..0d42ab90a 100644
--- a/qt-ui/globe.h
+++ b/qt-ui/globe.h
@@ -18,6 +18,7 @@ public:
GlobeGPS(QWidget *parent);
void reload();
void centerOn(struct dive* dive);
+ void resizeEvent(QResizeEvent *event);
protected:
virtual void mousePressEvent(QMouseEvent* event);
@@ -30,8 +31,6 @@ private:
public Q_SLOTS:
void changeDiveGeoPosition(qreal lon,qreal lat,GeoDataCoordinates::Unit);
- void setMessageWidget(KMessageWidget* globeMessage);
-
};
#endif
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index b343140b0..8e0e54eaa 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -40,10 +40,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 658f22c41..3f9726785 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>