From 09920126ddcc84d98e333287566d8483ad3410a8 Mon Sep 17 00:00:00 2001 From: StapleButter Date: Mon, 2 Oct 2017 01:58:09 +0200 Subject: add support for setting an explicit min size for libui controls. for now only supported by uiArea. --- src/libui_sdl/libui/common/control.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/libui_sdl/libui/common/control.c') 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; } -- cgit v1.2.3