diff options
| author | Jonas Kümmerlin <jonas@kuemmerlin.eu> | 2018-12-27 22:54:55 +0100 |
|---|---|---|
| committer | Jonas Kümmerlin <jonas@kuemmerlin.eu> | 2018-12-27 23:01:28 +0100 |
| commit | a5f3ea9ac12fccbc9faf3f152d4dfbe7f263268e (patch) | |
| tree | 7e66ed4d7cb7e4b4ae56d8b562ff08121bf43026 /alf/alf.cpp | |
| parent | b0b0e97aa5a06b22768bb9c9ea5e8caf383d78a4 (diff) | |
make label, edit and button text line up perfectly
Diffstat (limited to 'alf/alf.cpp')
| -rw-r--r-- | alf/alf.cpp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/alf/alf.cpp b/alf/alf.cpp index 3bcde5b..2ec33ca 100644 --- a/alf/alf.cpp +++ b/alf/alf.cpp @@ -249,13 +249,20 @@ ALF_ApplyLayout(HWND hwnd, ALFWindowPriv *win) int margintop = ALF_CentipointsToPxPriv(win, c->cptMarginTop); int marginbottom = ALF_CentipointsToPxPriv(win, c->cptMarginBottom); - hdwp = DeferWindowPos(hdwp, - c->hwnd, 0, - win->layout.columns[c->x].allocatedPosition + marginleft, - win->layout.rows[c->y].allocatedPosition + margintop, - win->layout.columns[c->x].allocatedWidth - marginleft - marginright, - win->layout.rows[c->y].allocatedWidth - margintop - marginbottom, - SWP_NOACTIVATE | SWP_NOZORDER); + RECT r = { 0,0,0,0 }; + r.left = win->layout.columns[c->x].allocatedPosition + marginleft; + r.right = r.left + win->layout.columns[c->x].allocatedWidth - marginleft - marginright; + r.top = win->layout.rows[c->y].allocatedPosition + margintop; + r.bottom = r.top + win->layout.rows[c->y].allocatedWidth - margintop - marginbottom; + + if (c->flags & ALF_APPLYSIZE) { + hdwp = (HDWP)SendMessage(c->hwnd, ALF_WM_APPLYSIZE, (WPARAM)hdwp, (LPARAM)&r); + } else { + hdwp = DeferWindowPos(hdwp, + c->hwnd, 0, + r.left, r.top, r.right - r.left, r.bottom - r.top, + SWP_NOACTIVATE | SWP_NOZORDER); + } } EndDeferWindowPos(hdwp); |
