summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2022-06-17 15:54:12 +0300
committerGeorge Hazan <ghazan@miranda.im>2022-06-17 15:54:12 +0300
commitddb6b3bc34d9199225cc81ae7eae7578c7a62693 (patch)
tree25e14711fcb90ca44dc2be2c40fd6223a38c6045 /src
parent308358f6e93fa4b8930ff7e27647fd0c698c5f60 (diff)
fix for giant font size in chats
Diffstat (limited to 'src')
-rw-r--r--src/mir_app/src/FontService.cpp4
-rw-r--r--src/mir_app/src/clcutils.cpp6
2 files changed, 6 insertions, 4 deletions
diff --git a/src/mir_app/src/FontService.cpp b/src/mir_app/src/FontService.cpp
index 3cccbdfc1a..1d8cede252 100644
--- a/src/mir_app/src/FontService.cpp
+++ b/src/mir_app/src/FontService.cpp
@@ -110,10 +110,8 @@ static void GetDefaultFontSetting(LOGFONT *lf, COLORREF *colour)
if (colour)
*colour = GetSysColor(COLOR_WINDOWTEXT);
- lf->lfHeight = 10;
-
HDC hdc = GetDC(nullptr);
- lf->lfHeight = -MulDiv(lf->lfHeight, GetDeviceCaps(hdc, LOGPIXELSY), 72);
+ lf->lfHeight = -MulDiv(lf->lfHeight, 72, GetDeviceCaps(hdc, LOGPIXELSY));
ReleaseDC(nullptr, hdc);
}
diff --git a/src/mir_app/src/clcutils.cpp b/src/mir_app/src/clcutils.cpp
index dbc9342571..c3849572cb 100644
--- a/src/mir_app/src/clcutils.cpp
+++ b/src/mir_app/src/clcutils.cpp
@@ -661,7 +661,11 @@ void fnGetDefaultFontSetting(int i, LOGFONT *lf, COLORREF *colour)
{
SystemParametersInfo(SPI_GETICONTITLELOGFONT, sizeof(LOGFONT), lf, FALSE);
*colour = GetSysColor(COLOR_WINDOWTEXT);
- lf->lfHeight = 8;
+
+ HDC hdc = GetDC(nullptr);
+ lf->lfHeight = -MulDiv(lf->lfHeight, 72, GetDeviceCaps(hdc, LOGPIXELSY));
+ ReleaseDC(nullptr, hdc);
+
switch (i) {
case FONTID_GROUPS:
lf->lfWeight = FW_BOLD;