aboutsummaryrefslogtreecommitdiff
path: root/include/mgui/list.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/mgui/list.h')
-rw-r--r--include/mgui/list.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/include/mgui/list.h b/include/mgui/list.h
index af1ceae..7769ab6 100644
--- a/include/mgui/list.h
+++ b/include/mgui/list.h
@@ -3,6 +3,7 @@
#include "widget.h"
#include <stddef.h>
+#include <stdint.h>
#include <mgl/graphics/color.h>
typedef struct mgl_window mgl_window;
@@ -14,11 +15,14 @@ typedef enum {
} mgui_list_direction;
typedef struct {
+ mgui_widget *widget;
+} mgui_list_item;
+
+typedef struct {
mgui_widget widget;
mgui_list_direction direction;
mgl_vec2i position;
- mgl_color background_color;
- mgui_widget **items;
+ mgui_list_item *items;
size_t items_capacity;
size_t num_items;
} mgui_list;
@@ -29,11 +33,9 @@ mgui_widget* mgui_list_to_widget(mgui_list *list);
mgui_list* mgui_widget_to_list(mgui_widget *widget);
void mgui_list_set_position(mgui_list *self, mgl_vec2i position);
-void mgui_list_set_width(mgui_list *self, int width);
-void mgui_list_set_background_color(mgui_list *self, mgl_color color);
+void mgui_list_calculate_size(mgui_list *self, mgl_vec2i max_size);
void mgui_list_append(mgui_list *self, mgui_widget *widget);
void mgui_list_on_event(mgui_list *self, mgl_window *window, mgl_event *event);
-/* Returns the size of the widget */
-mgl_vec2i mgui_list_draw(mgui_list *self, mgl_window *window);
+void mgui_list_draw(mgui_list *self, mgl_window *window);
#endif /* MGUI_LIST_H */