From d19993c9d4891978c0b593eced6376d17aa1ffec Mon Sep 17 00:00:00 2001 From: Jonas Kümmerlin Date: Tue, 1 Jan 2019 22:54:54 +0100 Subject: change edit and button paddings to look better --- alf/alfbutton.cpp | 8 ++++---- alf/alfedit.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'alf') diff --git a/alf/alfbutton.cpp b/alf/alfbutton.cpp index c46693e..2df9fc9 100644 --- a/alf/alfbutton.cpp +++ b/alf/alfbutton.cpp @@ -22,7 +22,7 @@ ALF__ButtonSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT if ((style & BS_MULTILINE) == 0) format |= DT_SINGLELINE; - RECT r = { 0, 0, 100, 100 }; + RECT r = { 0, 0, 0x7FFFFFFF, 100 }; int textlen = GetWindowTextLength(hwnd); TCHAR *textbuf = (TCHAR*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY|HEAP_GENERATE_EXCEPTIONS, (textlen + 1)*sizeof(TCHAR)); @@ -33,9 +33,9 @@ ALF__ButtonSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT HeapFree(GetProcessHeap(), 0, textbuf); int xpadding = app->compatFn->GetSystemMetricsForDpi(SM_CXEDGE, - ALF_CentipointsToPixels(GetParent(hwnd), 7200)) * 3; + ALF_CentipointsToPixels(GetParent(hwnd), 7200)) * 2 + 6; int ypadding = app->compatFn->GetSystemMetricsForDpi(SM_CYEDGE, - ALF_CentipointsToPixels(GetParent(hwnd), 7200)) * 3; + ALF_CentipointsToPixels(GetParent(hwnd), 7200)) * 2 + 6; SIZE *pSize = (SIZE*)(void*)lParam; if (pSize->cx < r.right - r.left + xpadding) { @@ -93,7 +93,7 @@ ALF_AddButton(HWND win, WORD id, UINT x, UINT y, const TCHAR *text) p.hwnd = hwndButton; p.x = x; p.y = y; - p.width = 5625; + p.width = 0; p.height = 0; p.flags = ALF_QUERYSIZE | ALF_MESSAGEFONT | ALF_APPLYSIZE; diff --git a/alf/alfedit.cpp b/alf/alfedit.cpp index 7c247b1..2dae626 100644 --- a/alf/alfedit.cpp +++ b/alf/alfedit.cpp @@ -28,7 +28,7 @@ ALF__EditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_P if (!ps->cy) { ps->cy = tm.tmHeight + 2*app->compatFn->GetSystemMetricsForDpi( SM_CYEDGE, ALF_CentipointsToPixels(GetParent(hwnd), 7200)) - + 2 /* padding internal to the edit control */ + + 4 /* padding internal to the edit control */ + 2 /* external padding to line up with themed button */; } } -- cgit v1.2.3