From 520cf456ddca96328c0e51e9ee81db10006f248d Mon Sep 17 00:00:00 2001 From: Jonas Kümmerlin Date: Fri, 28 Dec 2018 22:14:07 +0100 Subject: different method for button margin this one works with WM_CLIPCHILDREN, which we intend to make default --- alf/alf.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'alf/alf.cpp') diff --git a/alf/alf.cpp b/alf/alf.cpp index 2f3af7c..e71e3a1 100644 --- a/alf/alf.cpp +++ b/alf/alf.cpp @@ -414,11 +414,16 @@ ALF_DefWindowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) if (msg == WM_DPICHANGED) { ALF_UpdateFonts(hwnd); - ALF_RecalculateLayout(hwnd); + ALF_CalculateSizes(priv); RECT *r = (RECT*)lparam; SetWindowPos(hwnd, NULL, r->left, r->top, r->right-r->left, r->bottom-r->top, SWP_NOACTIVATE|SWP_NOZORDER); } + if (msg == WM_THEMECHANGED || msg == WM_SETTINGCHANGE) { + ALF_UpdateFonts(hwnd); + ALF_RecalculateLayout(hwnd); + } + if (msg == DM_GETDEFID) { if (priv->defid == (WORD)-1) { return 0; @@ -606,11 +611,17 @@ ALF_CentipointsToPixels(HWND win, int cptValue) } void -ALF_ResizeWindow(HWND win, UINT cptWidth, UINT cptHeight) +ALF_ResizeWindow(HWND win, int cptWidth, int cptHeight) { int pxwidth = ALF_CentipointsToPixels(win, cptWidth); int pxheight = ALF_CentipointsToPixels(win, cptHeight); + ALF_ResizeWindowPx(win, pxwidth, pxheight); +} + +void +ALF_ResizeWindowPx(HWND win, int pxwidth, int pxheight) +{ MINMAXINFO tmp = { { 0, 0 }, { pxwidth, pxheight }, -- cgit v1.2.3