From b0a4e8a443837c089183a397258f618b46cd44a5 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Fri, 13 Sep 2019 21:41:42 +0200 Subject: Mobile: allow setting a width via environment variable This should make it much easier to debug and hopefully fix some of the odd scenarios where we get font sizes (or even the screen layout) wrong. Signed-off-by: Dirk Hohndel --- subsurface-helper.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'subsurface-helper.cpp') diff --git a/subsurface-helper.cpp b/subsurface-helper.cpp index 5671ffc58..b60d015dc 100644 --- a/subsurface-helper.cpp +++ b/subsurface-helper.cpp @@ -123,8 +123,17 @@ void run_ui() manager->screenChanged(screen); qDebug() << "qqwindow screen has ldpi/pdpi" << screen->logicalDotsPerInch() << screen->physicalDotsPerInch(); #if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS) + int width = 800; + if (qEnvironmentVariableIsSet("SUBSURFACE_MOBILE_WIDTH")) { + bool ok; + int width_override = qEnvironmentVariableIntValue("SUBSURFACE_MOBILE_WIDTH", &ok); + if (ok) { + width = width_override; + qDebug() << "overriding window width:" << width; + } + } qml_window->setHeight(1200); - qml_window->setWidth(800); + qml_window->setWidth(width); #endif // not Q_OS_ANDROID and not Q_OS_IOS qml_window->show(); LOG_STP("run_ui running exec"); -- cgit v1.2.3-70-g09d2