From 323e97c60370f06bb30e57580c8c4fce39df95f7 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Thu, 14 Jan 2021 17:08:13 -0800 Subject: 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 --- subsurface-mobile-main.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'subsurface-mobile-main.cpp') diff --git a/subsurface-mobile-main.cpp b/subsurface-mobile-main.cpp index 89a1f4c64..2b224b595 100644 --- a/subsurface-mobile-main.cpp +++ b/subsurface-mobile-main.cpp @@ -19,6 +19,7 @@ #include "core/settings/qPrefCloudStorage.h" #include +#include #include #include #include @@ -60,6 +61,9 @@ int main(int argc, char **argv) parse_xml_init(); taglist_init_global(); + + // grab the system font size before we overwrite this when we load preferences + double initial_font_size = QGuiApplication::font().pointSizeF(); init_ui(); if (prefs.default_file_behavior == LOCAL_DEFAULT_FILE) set_filename(prefs.default_filename); @@ -76,7 +80,7 @@ int main(int argc, char **argv) init_proxy(); if (!quit) - run_mobile_ui(); + run_mobile_ui(initial_font_size); exit_ui(); taglist_free(g_tag_list); parse_xml_exit(); -- cgit v1.2.3-70-g09d2