[GB.FORM.MDI]
* NEW: Use more granular sizes for stock icons, so that they are not too small for some font sizes. [GB.QT4] * BUG: Desktop.Scale is now updated before window Font events are sent. [GB.QT5] * BUG: Desktop.Scale is now updated before window Font events are sent. git-svn-id: svn://localhost/gambas/trunk@7380 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
parent
fa54b1e89b
commit
64e95ed8e1
5 changed files with 10 additions and 15 deletions
Binary file not shown.
Before Width: | Height: | Size: 597 B After Width: | Height: | Size: 641 B |
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include <QEventLoop>
|
||||
#include <QSessionManager>
|
||||
#include <QClipboard>
|
||||
#include <QFont>
|
||||
|
||||
#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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue