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/alfbutton.cpp | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'alf/alfbutton.cpp') diff --git a/alf/alfbutton.cpp b/alf/alfbutton.cpp index 5f7a638..9cf7c1d 100644 --- a/alf/alfbutton.cpp +++ b/alf/alfbutton.cpp @@ -33,7 +33,7 @@ ALF__ButtonSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT int xpadding = ALF_Compat_GetSystemMetricsForDpi(SM_CXEDGE, ALF_CentipointsToPixels(GetParent(hwnd), 7200)) * 2 + 6; int ypadding = ALF_Compat_GetSystemMetricsForDpi(SM_CYEDGE, - ALF_CentipointsToPixels(GetParent(hwnd), 7200)) * 2 + 6; + ALF_CentipointsToPixels(GetParent(hwnd), 7200)) * 2 + 4; SIZE *pSize = (SIZE*)(void*)lParam; if (pSize->cx < r.right - r.left + xpadding) { @@ -50,19 +50,6 @@ ALF__ButtonSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT SelectFont(hdc, oldFont); ReleaseDC(hwnd, hdc); - } else if (uMsg == ALF_WM_APPLYSIZE) { - // HACK: a themed button contains a 1px margin. An unthemed button - // does not, so we add one. - - RECT *p = (RECT *)lParam; - - int padding = ALF_Compat_IsAppThemed() ? 0 : 1; - - return (LRESULT)DeferWindowPos((HDWP)wParam, - hwnd, NULL, - p->left, p->top + padding, - p->right - p->left, p->bottom - p->top - 2*padding, - SWP_NOZORDER|SWP_NOACTIVATE); } else if (uMsg == WM_DESTROY) { ALF_Compat_RemoveWindowSubclass(hwnd, ALF__ButtonSubclassProc, 0); } @@ -93,7 +80,7 @@ ALF_AddButton(HWND win, WORD id, UINT x, UINT y, const TCHAR *text) p.y = y; p.width = 0; p.height = 0; - p.flags = ALF_QUERYSIZE | ALF_MESSAGEFONT | ALF_APPLYSIZE; + p.flags = ALF_QUERYSIZE | ALF_MESSAGEFONT; ALF_AddWidgetEx(win, &p); -- cgit v1.2.3