From 0817e451578b2920ec30a2ebb88fe908cf60c0e0 Mon Sep 17 00:00:00 2001 From: Jonas Kümmerlin Date: Tue, 23 Jun 2020 15:10:37 +0200 Subject: button: new padding calculation this is more in line with how win10 does things and IMHO leads to better results on high-dpi displays. --- alf/alflayout.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'alf/alflayout.cpp') diff --git a/alf/alflayout.cpp b/alf/alflayout.cpp index 38e69a2..176070d 100644 --- a/alf/alflayout.cpp +++ b/alf/alflayout.cpp @@ -277,10 +277,8 @@ ALF_Layout_CalcButtonSize(HWND hwndWindow, ALFLayout *layout, HWND hwndButton, S DrawText(hdc, textbuf, -1, &r, format); ALF_Free(textbuf); - int xpadding = ALF_Compat_GetSystemMetricsForDpi(SM_CXEDGE, - (UINT)layout->dpi) * 2 + 6; - int ypadding = ALF_Compat_GetSystemMetricsForDpi(SM_CYEDGE, - (UINT)layout->dpi) * 2 + 4; + int xpadding = ALF_CentipointsToPixels(1800, layout->dpi); + int ypadding = ALF_CentipointsToPixels(600, layout->dpi); if (pSize->cx < r.right - r.left + xpadding) { pSize->cx = r.right - r.left + xpadding; -- cgit v1.2.3