summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Wildemann <gta04@metalstrolche.de>2017-04-03 13:50:57 +0200
committerStefan Wildemann <gta04@metalstrolche.de>2017-04-03 13:50:57 +0200
commit7833c355ee325887889df840a6486952b92f5f19 (patch)
tree1a0ef520ad7fa363a64c9d42fcba68a44f185acf
parent9d9f2f9cbd7982657d37ce3e747d2f43372b2af2 (diff)
downloadnavit-7833c355ee325887889df840a6486952b92f5f19.tar.gz
Fix: Make window as big as possible if w and h are not given
-rw-r--r--navit/graphics/qt5/graphics_qt5.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/navit/graphics/qt5/graphics_qt5.cpp b/navit/graphics/qt5/graphics_qt5.cpp
index 900374394..c7408690d 100644
--- a/navit/graphics/qt5/graphics_qt5.cpp
+++ b/navit/graphics/qt5/graphics_qt5.cpp
@@ -44,6 +44,7 @@
#include <QDBusConnection>
#include <QDBusInterface>
#include <QFile>
+#include <QScreen>
#if USE_QML
#include <QQuickWindow>
#include <QQmlApplicationEngine>
@@ -940,6 +941,12 @@ graphics_qt5_new(struct navit *nav, struct graphics_methods *meth, struct attr *
QRect geomet;
geomet.setHeight(100);
geomet.setWidth(100);
+ /* get desktop size */
+ QScreen *primary = navit_app->primaryScreen();
+ if(primary != NULL)
+ {
+ geomet = primary->availableGeometry();
+ }
/* check for height */
if ((h = attr_search(attrs, NULL, attr_h)) && (h->u.num > 100))
geomet.setHeight(h->u.num);