changeset 29270:6570a35920c4

improve detection of systems font size at first startup (bug #59829) * resource-manager.cc (get_default_font): use QApplication::font for a font with a suitable size from the systems font configuration
author Torsten Lilge <ttl-octave@mailbox.org>
date Wed, 06 Jan 2021 22:46:49 +0100
parents d8cb0f06ffb1
children 11bc1b22b29f
files libgui/src/resource-manager.cc
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/src/resource-manager.cc	Tue Jan 05 22:10:29 2021 +0100
+++ b/libgui/src/resource-manager.cc	Wed Jan 06 22:46:49 2021 +0100
@@ -259,8 +259,11 @@
   {
     QString default_family = get_default_font_family ();
 
-    // determine the fefault fotn size of the system
-    QFont font = QFont (default_family);
+    // determine the fefault font size of the system
+    // FIXME: QApplication::font () does not return the monospace font,
+    //        but the size should be probably near to the monospace font
+    QFont font = QApplication::font ();
+
     int font_size = font.pointSize ();
     if (font_size == -1)
       font_size = static_cast <int> (std::floor(font.pointSizeF ()));