From f0319406c56cdaf6b91e35ef657c6570c1ebdf23 Mon Sep 17 00:00:00 2001 From: Jonas Kümmerlin Date: Mon, 1 Jun 2020 10:56:58 +0200 Subject: layout code reorganization and renaming s/Widget/Control/ throughout the code. Only the widget factory gets to keep its name for now. --- alf/alfpanel.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'alf/alfpanel.cpp') diff --git a/alf/alfpanel.cpp b/alf/alfpanel.cpp index 7bb3f61..62bac1e 100644 --- a/alf/alfpanel.cpp +++ b/alf/alfpanel.cpp @@ -161,23 +161,23 @@ ALF_Panel_DefWindowProc(HWND window, UINT msg, WPARAM wparam, LPARAM lparam) RECT c; GetClientRect(window, &c); - if (c.right > priv->layout.allocatedWidgetRect.right + priv->layout.containerMargins.right) { + if (c.right > priv->layout.allocatedControlRect.right + priv->layout.containerMargins.right) { // enlarged to the right -> invalidate place occupied by old border - RECT i = { priv->layout.allocatedWidgetRect.right, + RECT i = { priv->layout.allocatedControlRect.right, 0, c.right, c.bottom }; InvalidateRect(window, &i, TRUE); } - if (c.bottom > priv->layout.allocatedWidgetRect.bottom + priv->layout.containerMargins.bottom) { + if (c.bottom > priv->layout.allocatedControlRect.bottom + priv->layout.containerMargins.bottom) { // enlarged to the bottom -> invalidate place occupied by old border RECT i = { 0, - priv->layout.allocatedWidgetRect.bottom, + priv->layout.allocatedControlRect.bottom, c.right, c.bottom }; InvalidateRect(window, &i, TRUE); } - if (c.right < priv->layout.allocatedWidgetRect.right + priv->layout.containerMargins.right) { + if (c.right < priv->layout.allocatedControlRect.right + priv->layout.containerMargins.right) { // shrunk horizontally -> invalidate place now occupied by new border RECT i = { c.right - priv->layout.containerMargins.right, 0, @@ -185,7 +185,7 @@ ALF_Panel_DefWindowProc(HWND window, UINT msg, WPARAM wparam, LPARAM lparam) c.bottom }; InvalidateRect(window, &i, TRUE); } - if (c.bottom < priv->layout.allocatedWidgetRect.bottom + priv->layout.containerMargins.bottom) { + if (c.bottom < priv->layout.allocatedControlRect.bottom + priv->layout.containerMargins.bottom) { // shrunk vertically -> invalidate place now ocuupied by new border RECT i = { 0, c.bottom - priv->layout.containerMargins.bottom, @@ -266,7 +266,7 @@ ALF_AddPanel(HWND parent, WORD id, int x, int y) { HWND hwndPanel = ALF_CreatePanelWindow(parent, id); - ALF_AddWidget(parent, x, y, hwndPanel, 0, 0, ALF_LAYOUT_SIZE_QUERY | ALF_LAYOUT_INHERITFONT | ALF_LAYOUT_INHERITBGCOLOR | ALF_LAYOUT_SENDBGCHANGE | ALF_LAYOUT_SENDDPICHANGE); + ALF_AddControl(parent, x, y, hwndPanel, 0, 0, ALF_LAYOUT_SIZE_QUERY | ALF_LAYOUT_INHERITFONT | ALF_LAYOUT_INHERITBGCOLOR | ALF_LAYOUT_SENDBGCHANGE | ALF_LAYOUT_SENDDPICHANGE); return hwndPanel; } -- cgit v1.2.3