summaryrefslogtreecommitdiffstats
path: root/subsurface-helper.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2020-02-11 22:15:32 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-02-11 22:16:47 -0800
commit6026f95247285f2385d1e7ada67ee6fc689fec9f (patch)
tree7f31a56756aeddf3a1f207859725d97603e8671a /subsurface-helper.cpp
parent1336ea755b7ad2ef18cb869ca6219a1a6e237ff9 (diff)
downloadsubsurface-6026f95247285f2385d1e7ada67ee6fc689fec9f.tar.gz
mobile UI: add second environment variable for height
This is intended for testing on the desktop; this way a developer can reproduce the screen size (in grid units) that a user might experience. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'subsurface-helper.cpp')
-rw-r--r--subsurface-helper.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/subsurface-helper.cpp b/subsurface-helper.cpp
index 1ef93102d..06aaa47fa 100644
--- a/subsurface-helper.cpp
+++ b/subsurface-helper.cpp
@@ -146,6 +146,7 @@ void run_ui()
qDebug() << "qqwindow screen has ldpi/pdpi" << screen->logicalDotsPerInch() << screen->physicalDotsPerInch();
#if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS)
int width = 800;
+ int height = 1200;
if (qEnvironmentVariableIsSet("SUBSURFACE_MOBILE_WIDTH")) {
bool ok;
int width_override = qEnvironmentVariableIntValue("SUBSURFACE_MOBILE_WIDTH", &ok);
@@ -154,7 +155,15 @@ void run_ui()
qDebug() << "overriding window width:" << width;
}
}
- qml_window->setHeight(1200);
+ if (qEnvironmentVariableIsSet("SUBSURFACE_MOBILE_HEIGHT")) {
+ bool ok;
+ int height_override = qEnvironmentVariableIntValue("SUBSURFACE_MOBILE_HEIGHT", &ok);
+ if (ok) {
+ height = height_override;
+ qDebug() << "overriding window height:" << height;
+ }
+ }
+ qml_window->setHeight(height);
qml_window->setWidth(width);
#endif // not Q_OS_ANDROID and not Q_OS_IOS
qml_window->show();