summaryrefslogtreecommitdiff
path: root/project-base/src/qui/flex_container.c
diff options
context:
space:
mode:
Diffstat (limited to 'project-base/src/qui/flex_container.c')
-rw-r--r--project-base/src/qui/flex_container.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/project-base/src/qui/flex_container.c b/project-base/src/qui/flex_container.c
new file mode 100644
index 0000000..ab4111f
--- /dev/null
+++ b/project-base/src/qui/flex_container.c
@@ -0,0 +1,23 @@
+void _qui_update_flex_container(qui_widget* el) {
+}
+
+void _qui_render_flex_container(qui_widget* el) {
+ // Nothing to do.
+}
+
+qui_widget* qui_create_flex_container(qui_widget* qui, u8 flex)
+{
+ log_assert(qui->type == WIDGET_VERTICAL_LAYOUT, "Flex container can only be added to vertical or horizontal layout");
+ qui_widget* wg = _qui_create_empty_widget(qui);
+ qui_flex_container* data = mem_alloc(sizeof(qui_flex_container));
+ data->flex = flex;
+ wg->data = (u8*)data;
+ wg->type = WIDGET_FLEX_CONTAINER;
+ if (qui && qui->type == WIDGET_VERTICAL_LAYOUT) {
+ wg->height = flex;
+ }
+ else {
+ log_assert(0, "Fixed container must be placed in vertical or horizontal layout");
+ }
+ return wg;
+} \ No newline at end of file