From b1e857cf1471d1871a9396696b22fa531da98249 Mon Sep 17 00:00:00 2001 From: Aldrik Ramaekers Date: Sat, 23 Nov 2024 22:33:43 +0100 Subject: add projbase to repo --- project-base/src/qui/fixed_container.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 project-base/src/qui/fixed_container.c (limited to 'project-base/src/qui/fixed_container.c') diff --git a/project-base/src/qui/fixed_container.c b/project-base/src/qui/fixed_container.c new file mode 100644 index 0000000..acc3b05 --- /dev/null +++ b/project-base/src/qui/fixed_container.c @@ -0,0 +1,21 @@ +void _qui_update_fixed_container(qui_widget* el) { +} + +void _qui_render_fixed_container(qui_widget* el) { + renderer->render_rectangle(el->x, el->y, el->width, el->height, rgb(0,255,0)); +} + +qui_widget* qui_create_fixed_container(qui_widget* qui, u16 size) +{ + log_assert(qui->type == WIDGET_VERTICAL_LAYOUT, "Fixed container can only be added to vertical or horizontal layout"); + + qui_widget* wg = _qui_create_empty_widget(qui); + wg->type = WIDGET_FIXED_CONTAINER; + if (qui && qui->type == WIDGET_VERTICAL_LAYOUT) { + wg->height = size; + } + else { + log_assert(0, "Fixed container must be placed in vertical or horizontal layout"); + } + return wg; +} \ No newline at end of file -- cgit v1.2.3-70-g09d2