diff options
| author | Jonas Kümmerlin <jonas@kuemmerlin.eu> | 2020-06-23 15:10:37 +0200 |
|---|---|---|
| committer | Jonas Kümmerlin <jonas@kuemmerlin.eu> | 2020-06-23 15:10:37 +0200 |
| commit | 0817e451578b2920ec30a2ebb88fe908cf60c0e0 (patch) | |
| tree | 077d3c1a4149e27e0fc1522add26f506d6f1f81b /alf/alflayout.cpp | |
| parent | 8b3303ddbfbe86f5e33e8a92b1d02707ff56844a (diff) | |
button: new padding calculation
this is more in line with how win10 does things and IMHO leads to better
results on high-dpi displays.
Diffstat (limited to 'alf/alflayout.cpp')
| -rw-r--r-- | alf/alflayout.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
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; |
