summaryrefslogtreecommitdiff
path: root/alf/alfcombobox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'alf/alfcombobox.cpp')
-rw-r--r--alf/alfcombobox.cpp15
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);