From 86021b24d98c385b10ccc2fefab5cf22f3a03b54 Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava <tcanabrava@kde.org>
Date: Fri, 17 May 2013 21:58:49 -0300
Subject: Borrowed the KMessageWidget code to better show passive information.

Borrowed the code from KMessageWidget from Aurelian Gateau, Kdelibs,
to better show passive information and notifications. instead of a
popup blowing in the user's face, a nice, animated and well designed
widget will gracefully fade-in, show the notes, and fade out when
not needed anymore.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
---
 qt-ui/mainwindow.cpp | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

(limited to 'qt-ui/mainwindow.cpp')

diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index c5a4e5ce3..e5cf5ed37 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -32,16 +32,18 @@ MainWindow::MainWindow() : ui(new Ui::MainWindow())
 	readSettings();
 	setWindowIcon(QIcon(":subsurface-icon"));
 	connect(ui->ListWidget, SIGNAL(currentDiveChanged(int)), this, SLOT(current_dive_changed(int)));
+	ui->globeMessage->hide();
+	ui->globe->setMessageWidget(ui->globeMessage);
 	ui->ProfileWidget->setFocusProxy(ui->ListWidget);
 	ui->ListWidget->reload();
 	ui->ListWidget->setFocus();
-	ui->widget->reload();
+	ui->globe->reload();
 }
 
 void MainWindow::current_dive_changed(int divenr)
 {
 	select_dive(divenr);
-	ui->widget->centerOn(get_dive(selected_dive));
+	ui->globe->centerOn(get_dive(selected_dive));
 	redrawProfile();
 	ui->InfoWidget->updateDiveInfo(divenr);
 }
@@ -79,7 +81,7 @@ void MainWindow::on_actionOpen_triggered()
 	process_dives(FALSE, FALSE);
 
 	ui->InfoWidget->reload();
-	ui->widget->reload();
+	ui->globe->reload();
 	ui->ListWidget->reload();
 	ui->ListWidget->setFocus();
 }
-- 
cgit v1.2.3-70-g09d2


From 7509360173b7434a9cbf4c8d6542b322938407d2 Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava <tcanabrava@kde.org>
Date: Fri, 17 May 2013 22:52:04 -0300
Subject: Prettification of the map view.

Just some prettifications, better defaults, etc.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
---
 qt-ui/globe.cpp          |  6 ++++--
 qt-ui/kmessagewidget.cpp | 10 +++++-----
 qt-ui/mainwindow.cpp     |  1 +
 3 files changed, 10 insertions(+), 7 deletions(-)

(limited to 'qt-ui/mainwindow.cpp')

diff --git a/qt-ui/globe.cpp b/qt-ui/globe.cpp
index 43763e338..56c99849c 100644
--- a/qt-ui/globe.cpp
+++ b/qt-ui/globe.cpp
@@ -15,17 +15,19 @@
 
 GlobeGPS::GlobeGPS(QWidget* parent) : MarbleWidget(parent), loadedDives(0)
 {
+
 	setMapThemeId("earth/bluemarble/bluemarble.dgml");
+	//setMapThemeId("earth/openstreetmap/openstreetmap.dgml");
 	setProjection( Marble::Spherical );
 
 	setAnimationsEnabled(true);
 	setShowClouds( false );
 	setShowBorders( false );
-	setShowPlaces( false );
+	setShowPlaces( true );
 	setShowCrosshairs( false );
 	setShowGrid( false );
 	setShowOverviewMap(false);
-	setShowScaleBar(false);
+	setShowScaleBar(true);
 
 	Q_FOREACH( AbstractFloatItem * floatItem, floatItems() ){
 		if ( floatItem && floatItem->nameId() == "compass" ) {
diff --git a/qt-ui/kmessagewidget.cpp b/qt-ui/kmessagewidget.cpp
index 653d52f4f..dc200654e 100644
--- a/qt-ui/kmessagewidget.cpp
+++ b/qt-ui/kmessagewidget.cpp
@@ -217,22 +217,22 @@ void KMessageWidget::setMessageType(KMessageWidget::MessageType type)
 
 	switch (type) {
 	case Positive:
-		bg1 = QColor(Qt::green);
+		bg1 = QColor("#72D594"); // nice green
 		fg = QColor(Qt::white);
 		break;
 
 	case Information:
-		bg1 = QColor(Qt::blue);
+		bg1 = QColor("#41A8E3"); // nice blue
 		fg = QColor(Qt::black);
 		break;
 
 	case Warning:
-		bg1 = QColor(Qt::yellow);
+		bg1 = QColor("#72D594"); // nice yellow
 		fg = QColor(Qt::black);
 		break;
 
 	case Error:
-		bg1 = QColor(Qt::red);
+		bg1 = QColor("#E4B7B7"); // nice red.
 		fg = QColor(Qt::black);
 		break;
 	}
@@ -240,7 +240,7 @@ void KMessageWidget::setMessageType(KMessageWidget::MessageType type)
 	// Colors
 	bg0 = bg1.lighter(110);
 	bg2 = bg1.darker(110);
-	border = QColor(Qt::black);
+	border = bg2.darker(110);
 	d->content->setStyleSheet(
 		QString(".QFrame {"
 			"background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,"
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index e5cf5ed37..1eb741244 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -34,6 +34,7 @@ MainWindow::MainWindow() : ui(new Ui::MainWindow())
 	connect(ui->ListWidget, SIGNAL(currentDiveChanged(int)), this, SLOT(current_dive_changed(int)));
 	ui->globeMessage->hide();
 	ui->globe->setMessageWidget(ui->globeMessage);
+	ui->globeMessage->setCloseButtonVisible(false);
 	ui->ProfileWidget->setFocusProxy(ui->ListWidget);
 	ui->ListWidget->reload();
 	ui->ListWidget->setFocus();
-- 
cgit v1.2.3-70-g09d2