summaryrefslogtreecommitdiff
path: root/alf/alfbutton.cpp
diff options
context:
space:
mode:
authorJonas Kümmerlin <jonas@kuemmerlin.eu>2019-01-25 22:06:18 +0100
committerJonas Kümmerlin <jonas@kuemmerlin.eu>2019-01-25 22:06:18 +0100
commit6b301ea64ca71777e38611d8c49dd119808b4365 (patch)
treeed03de73b802a337b62eafe1ae28f10e6312d8d9 /alf/alfbutton.cpp
parent55211af76164fe6c39249c14be47363d35a4db0f (diff)
remove edit control margins to match up with button
we'll owner-draw the button to get rid of the margin
Diffstat (limited to 'alf/alfbutton.cpp')
-rw-r--r--alf/alfbutton.cpp17
1 files changed, 2 insertions, 15 deletions
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);