summaryrefslogtreecommitdiff
path: root/alf/alflabel.cpp
diff options
context:
space:
mode:
authorJonas Kümmerlin <jonas@kuemmerlin.eu>2020-04-16 18:17:56 +0200
committerJonas Kümmerlin <jonas@kuemmerlin.eu>2020-04-16 18:17:56 +0200
commit536ea04c34ba761d7031eeabb6d50adab0f0f2bd (patch)
tree7def1b680705497636c2f5e5649c0ffeb477539c /alf/alflabel.cpp
parent5cbb664bd49cd2b9c035ccfc3024aa436d28c36c (diff)
rework grid layout
Fractional expand is now supported like Qt, and also per row/column instead of as a widget attribute. Instead of margins, you're now supposed to use empty rows/columns instead. Spacer is also gone, use empty rows/columns with minimum size. Layout engine is prepared to directly calculate edit, button, etc. sizes without subclassing these controls
Diffstat (limited to 'alf/alflabel.cpp')
-rw-r--r--alf/alflabel.cpp13
1 files changed, 2 insertions, 11 deletions
diff --git a/alf/alflabel.cpp b/alf/alflabel.cpp
index f400f4f..b0abc4b 100644
--- a/alf/alflabel.cpp
+++ b/alf/alflabel.cpp
@@ -212,7 +212,7 @@ ALF__LabelWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
}
HWND
-ALF_AddLabel(HWND win, WORD id, UINT x, UINT y, const TCHAR *text)
+ALF_AddLabel(HWND win, WORD id, int x, int y, const TCHAR *text)
{
HWND hwndLabel = CreateWindow(_alf_labelClass,
text,
@@ -227,16 +227,7 @@ ALF_AddLabel(HWND win, WORD id, UINT x, UINT y, const TCHAR *text)
priv->style = ALF_LABEL_ALIGN_LEFT | ALF_LABEL_ALIGN_TOP_LIKE_EDIT;
SetWindowLongPtr(hwndLabel, 0, (LONG_PTR)priv);
- ALFWidgetLayoutParams p;
- ZeroMemory(&p, sizeof(p));
- p.hwnd = hwndLabel;
- p.x = x;
- p.y = y;
- p.width = 0;
- p.height = 0;
- p.flags = ALF_QUERYSIZE | ALF_INHERITFONT;
-
- ALF_AddWidgetEx(win, &p);
+ ALF_AddWidget(win, x, y, hwndLabel, 0, 0, ALF_LAYOUT_SIZE_QUERY | ALF_LAYOUT_INHERITFONT);
return hwndLabel;
}