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>
This commit is contained in:
Dirk Hohndel 2021-01-14 17:08:13 -08:00
parent 1472117541
commit 323e97c603
6 changed files with 37 additions and 26 deletions

View file

@ -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();