diff options
| author | Jonas Kümmerlin <jonas@kuemmerlin.eu> | 2020-04-29 14:59:38 +0200 |
|---|---|---|
| committer | Jonas Kümmerlin <jonas@kuemmerlin.eu> | 2020-04-29 14:59:38 +0200 |
| commit | d28cd7fb71a6fe56a04d4e21f2b95907a1ec105c (patch) | |
| tree | b8b529e63d520e604418b077a2ae91bdd343c909 /alf/alfcombobox.cpp | |
| parent | d752fd2f1ff39fc27b8703fdb8c7f0d68dd87c53 (diff) | |
layout: make minimum size actually work as a minimum
Diffstat (limited to 'alf/alfcombobox.cpp')
| -rw-r--r-- | alf/alfcombobox.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/alf/alfcombobox.cpp b/alf/alfcombobox.cpp index 994806e..f94c744 100644 --- a/alf/alfcombobox.cpp +++ b/alf/alfcombobox.cpp @@ -171,15 +171,16 @@ ALF__ComboWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) if (GetTextMetrics(hDc, &tm)) { SIZE *ps = (SIZE*)lParam; - if (!ps->cx) { - ps->cx = ALF_CentipointsToPixels(12000, priv->dpi); - } - - if (!ps->cy) { - ps->cy = tm.tmHeight + 2*ALF_Compat_GetSystemMetricsForDpi( + int cx = ALF_CentipointsToPixels(12000, priv->dpi); + int cy = ps->cy = tm.tmHeight + 2*ALF_Compat_GetSystemMetricsForDpi( SM_CYEDGE, (UINT)priv->dpi) + 4 /* padding internal to the edit control */; - } + + if (ps->cx < cx) + ps->cx = cx; + + if (ps->cy < cy) + ps->cy = cy; } SelectFont(hDc, oldfont); |
