summaryrefslogtreecommitdiffstats
path: root/subsurface-helper.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2021-01-14 17:08:13 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2021-01-19 12:35:29 -0800
commit323e97c60370f06bb30e57580c8c4fce39df95f7 (patch)
tree577e0aa0d87e5c7012c57c7829587f5f9aeb8b31 /subsurface-helper.cpp
parent14721175416772d23c9757e74b78ec8be448aac7 (diff)
downloadsubsurface-323e97c60370f06bb30e57580c8c4fce39df95f7.tar.gz
mobile/UI: remember the system default font size
We need to do this before the preferences are loaded, or the system default size is lost. Given that our other sizes are all relative to this value, that would be a problem. With this we can now ensure that we always have the right font size for smaller, regular, and larger theme settings. Also removes some obsolete commented out code. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'subsurface-helper.cpp')
-rw-r--r--subsurface-helper.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/subsurface-helper.cpp b/subsurface-helper.cpp
index c8cb8f8ee..11f471a8b 100644
--- a/subsurface-helper.cpp
+++ b/subsurface-helper.cpp
@@ -69,7 +69,7 @@ void exit_ui()
}
#ifdef SUBSURFACE_MOBILE
-void run_mobile_ui()
+void run_mobile_ui(double initial_font_size)
{
#if defined(Q_OS_ANDROID)
// work around an odd interaction between the OnePlus flavor of Android and Qt font handling
@@ -127,9 +127,13 @@ void run_mobile_ui()
ctxt->setContextProperty("diveModel", MobileModels::instance()->listModel());
set_non_bt_addresses();
+ // we need to setup the initial font size before the QML UI is instantiated
+ ThemeInterface *themeInterface = ThemeInterface::instance();
+ themeInterface->setInitialFontSize(initial_font_size);
+
ctxt->setContextProperty("connectionListModel", &connectionListModel);
ctxt->setContextProperty("logModel", MessageHandlerModel::self());
- ctxt->setContextProperty("subsurfaceTheme", ThemeInterface::instance());
+ ctxt->setContextProperty("subsurfaceTheme", themeInterface);
qmlRegisterUncreatableType<QMLManager>("org.subsurfacedivelog.mobile",1,0,"ExportType","Enum is not a type");