From 6b301ea64ca71777e38611d8c49dd119808b4365 Mon Sep 17 00:00:00 2001 From: Jonas Kümmerlin Date: Fri, 25 Jan 2019 22:06:18 +0100 Subject: remove edit control margins to match up with button we'll owner-draw the button to get rid of the margin --- alf/alfcombobox.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'alf/alfcombobox.cpp') diff --git a/alf/alfcombobox.cpp b/alf/alfcombobox.cpp index df88730..0444b14 100644 --- a/alf/alfcombobox.cpp +++ b/alf/alfcombobox.cpp @@ -153,8 +153,7 @@ ALF__ComboWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) if (!ps->cy) { ps->cy = tm.tmHeight + 2*ALF_Compat_GetSystemMetricsForDpi( SM_CYEDGE, ALF_CentipointsToPixels(GetParent(hwnd), 7200)) - + 4 /* padding internal to the edit control */ - + 2 /* external padding to line up with themed button */; + + 4 /* padding internal to the edit control */; } } @@ -241,16 +240,14 @@ ALF__ComboWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) DWORD sel = SendMessage(hwndChild, CB_GETEDITSEL, 0, 0); SendMessage(hwndChild, CB_SETEDITSEL, 0, -1); // SWP_NOCOPYBITS because NT 3.51 doesn't properly repaint the drop-down button - SetWindowPos(hwndChild, NULL, 0, 1, pos->cx, 200, SWP_NOZORDER|SWP_NOACTIVATE|SWP_NOCOPYBITS); + SetWindowPos(hwndChild, NULL, 0, 0, pos->cx, 200, SWP_NOZORDER|SWP_NOACTIVATE|SWP_NOCOPYBITS); SendMessage(hwndChild, CB_SETEDITSEL, 0, (LPARAM)sel); DWORD heightOffset = 0; if (LOBYTE(LOWORD(GetVersion())) >= 4) { heightOffset = - 2*ALF_Compat_GetSystemMetricsForDpi( SM_CYEDGE, ALF_CentipointsToPixels(GetParent(hwnd), 7200)) - - 4; - } else { - heightOffset = -2; + - 2; } SendMessage(hwndChild, CB_SETITEMHEIGHT, (WPARAM)-1, pos->cy + heightOffset); -- cgit v1.2.3