aboutsummaryrefslogtreecommitdiffstats
path: root/subsurface-mobile-main.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-mobile-main.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-mobile-main.cpp')
-rw-r--r--subsurface-mobile-main.cpp6
1 files changed, 5 insertions, 1 deletions
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 <QApplication>
+#include <QFont>
#include <QLocale>
#include <QLoggingCategory>
#include <QStringList>
@@ -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();