diff options
| author | Jonas Kümmerlin <jonas@kuemmerlin.eu> | 2018-12-28 22:14:07 +0100 |
|---|---|---|
| committer | Jonas Kümmerlin <jonas@kuemmerlin.eu> | 2018-12-28 22:14:07 +0100 |
| commit | 520cf456ddca96328c0e51e9ee81db10006f248d (patch) | |
| tree | 6ca0e49272de1f3e585da8cf928eb27fddb75018 /alf/alf.cpp | |
| parent | 774cbae7824e4410b5523762496c0ddb35da13d8 (diff) | |
different method for button margin
this one works with WM_CLIPCHILDREN, which we intend to make default
Diffstat (limited to 'alf/alf.cpp')
| -rw-r--r-- | alf/alf.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
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 }, |
