diff --git a/comp/src/gb.form.mdi/.hidden/control/toolbar.png b/comp/src/gb.form.mdi/.hidden/control/toolbar.png index 14ebb9677..410a1c09c 100644 Binary files a/comp/src/gb.form.mdi/.hidden/control/toolbar.png and b/comp/src/gb.form.mdi/.hidden/control/toolbar.png differ diff --git a/comp/src/gb.form/.src/Stock.class b/comp/src/gb.form/.src/Stock.class index 017d6e608..769794b8b 100644 --- a/comp/src/gb.form/.src/Stock.class +++ b/comp/src/gb.form/.src/Stock.class @@ -316,13 +316,13 @@ Static Public Function GetSize(Size As String) As Integer Select Case Size Case "small" - iSize = (CInt(Desktop.Scale * 2.5) \ 8) * 8 '16 'CInt(Desktop.Scale * 5 / 8 + 0.5) * 4 + iSize = (CInt(Desktop.Scale * 2.5) \ 4) * 4 '16 'CInt(Desktop.Scale * 5 / 8 + 0.5) * 4 Case "medium" - iSize = (CInt(Desktop.Scale * 2.5) \ 8) * 11 '22 'CInt(Desktop.Scale * 5 / 8 * 1.5 + 0.5) * 4 + iSize = (CInt(Desktop.Scale * 2.5) \ 4) * 5.5 '22 'CInt(Desktop.Scale * 5 / 8 * 1.5 + 0.5) * 4 Case "large" - iSize = (CInt(Desktop.Scale * 2.5) \ 8) * 16 '32 'CInt(Desktop.Scale * 5 / 8 + 0.5) * 8 + iSize = (CInt(Desktop.Scale * 2.5) \ 4) * 8 '32 'CInt(Desktop.Scale * 5 / 8 + 0.5) * 8 Case "huge" - iSize = (CInt(Desktop.Scale * 2.5) \ 8) * 24 '48 'CInt(Desktop.Scale * 5 / 8 * 1.5 + 0.5) * 8 + iSize = (CInt(Desktop.Scale * 2.5) \ 4) * 12 '48 'CInt(Desktop.Scale * 5 / 8 * 1.5 + 0.5) * 8 Case Else Try iSize = CInt(Size) End Select diff --git a/gb.qt4/src/CScreen.cpp b/gb.qt4/src/CScreen.cpp index 1c317f300..241f63451 100644 --- a/gb.qt4/src/CScreen.cpp +++ b/gb.qt4/src/CScreen.cpp @@ -165,8 +165,8 @@ END_METHOD static void set_font(QFont &font, void *object = 0) { + MAIN_update_scale(font); qApp->setFont(font); - MAIN_update_scale(); } BEGIN_PROPERTY(Application_Font) diff --git a/gb.qt4/src/main.cpp b/gb.qt4/src/main.cpp index 34c118bdd..ef302f2bc 100644 --- a/gb.qt4/src/main.cpp +++ b/gb.qt4/src/main.cpp @@ -860,15 +860,9 @@ void MAIN_check_quit(void) _check_quit_posted = true; } -void MAIN_update_scale(void) +void MAIN_update_scale(const QFont &font) { - //QFontMetrics fm(qApp->desktop()->font()); - //MAIN_scale = GET_DESKTOP_SCALE(fm.height()); - #ifdef NO_X_WINDOW - MAIN_scale = GET_DESKTOP_SCALE(qApp->desktop()->font().pointSize(), 96); - #else - MAIN_scale = GET_DESKTOP_SCALE(qApp->desktop()->font().pointSize(), QX11Info::appDpiY()); - #endif + MAIN_scale = GET_DESKTOP_SCALE(font.pointSize(), QX11Info::appDpiY()); } static void QT_InitEventLoop(void) @@ -902,7 +896,7 @@ static void QT_Init(void) } - MAIN_update_scale(); + MAIN_update_scale(qApp->desktop()->font()); qApp->installEventFilter(&CWidget::manager); #ifdef QT5 diff --git a/gb.qt4/src/main.h b/gb.qt4/src/main.h index 41b2164a1..35e45ffa1 100644 --- a/gb.qt4/src/main.h +++ b/gb.qt4/src/main.h @@ -33,6 +33,7 @@ #include #include #include +#include #define DO_NOT_USE_QT_INTERFACE #include "gb.qt.h" @@ -140,7 +141,7 @@ private: #define UTF8_NBUF 4 void MAIN_check_quit(void); -void MAIN_update_scale(void); +void MAIN_update_scale(const QFont &); void MAIN_process_events(void); void MAIN_init_error(void);