aboutsummaryrefslogtreecommitdiff
path: root/src/libui_sdl/libui/common/control.c
diff options
context:
space:
mode:
authorStapleButter <thetotalworm@gmail.com>2017-10-02 01:58:09 +0200
committerStapleButter <thetotalworm@gmail.com>2017-10-02 01:58:09 +0200
commit09920126ddcc84d98e333287566d8483ad3410a8 (patch)
treeede915edf24788c3998cdfc7adef5249f47a7e7a /src/libui_sdl/libui/common/control.c
parentce592a1d80db2eb1de0dc5ac55c2270e3a6befb3 (diff)
add support for setting an explicit min size for libui controls. for now only supported by uiArea.
Diffstat (limited to 'src/libui_sdl/libui/common/control.c')
-rw-r--r--src/libui_sdl/libui/common/control.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libui_sdl/libui/common/control.c b/src/libui_sdl/libui/common/control.c
index 771a29d..f811728 100644
--- a/src/libui_sdl/libui/common/control.c
+++ b/src/libui_sdl/libui/common/control.c
@@ -62,6 +62,14 @@ void uiControlSetFocus(uiControl *c)
(*(c->SetFocus))(c);
}
+void uiControlSetMinSize(uiControl *c, int w, int h)
+{
+ c->MinWidth = w;
+ c->MinHeight = h;
+
+ // TODO: resize if needed
+}
+
#define uiControlSignature 0x7569436F
uiControl *uiAllocControl(size_t size, uint32_t OSsig, uint32_t typesig, const char *typenamestr)
@@ -72,6 +80,10 @@ uiControl *uiAllocControl(size_t size, uint32_t OSsig, uint32_t typesig, const c
c->Signature = uiControlSignature;
c->OSSignature = OSsig;
c->TypeSignature = typesig;
+
+ c->MinWidth = -1;
+ c->MinHeight = -1;
+
return c;
}