mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
1336ea755b
commit
6026f95247
1 changed files with 10 additions and 1 deletions
|
@ -146,6 +146,7 @@ void run_ui()
|
||||||
qDebug() << "qqwindow screen has ldpi/pdpi" << screen->logicalDotsPerInch() << screen->physicalDotsPerInch();
|
qDebug() << "qqwindow screen has ldpi/pdpi" << screen->logicalDotsPerInch() << screen->physicalDotsPerInch();
|
||||||
#if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS)
|
#if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS)
|
||||||
int width = 800;
|
int width = 800;
|
||||||
|
int height = 1200;
|
||||||
if (qEnvironmentVariableIsSet("SUBSURFACE_MOBILE_WIDTH")) {
|
if (qEnvironmentVariableIsSet("SUBSURFACE_MOBILE_WIDTH")) {
|
||||||
bool ok;
|
bool ok;
|
||||||
int width_override = qEnvironmentVariableIntValue("SUBSURFACE_MOBILE_WIDTH", &ok);
|
int width_override = qEnvironmentVariableIntValue("SUBSURFACE_MOBILE_WIDTH", &ok);
|
||||||
|
@ -154,7 +155,15 @@ void run_ui()
|
||||||
qDebug() << "overriding window width:" << width;
|
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);
|
qml_window->setWidth(width);
|
||||||
#endif // not Q_OS_ANDROID and not Q_OS_IOS
|
#endif // not Q_OS_ANDROID and not Q_OS_IOS
|
||||||
qml_window->show();
|
qml_window->show();
|
||||||
|
|
Loading…
Add table
Reference in a new issue