From b98d216add98579c3a91b74fa5233f8534200297 Mon Sep 17 00:00:00 2001 From: iamcheeseman Date: Thu, 21 May 2026 06:46:48 -0400 Subject: a buncha ui stuff idk even know anymore --- teensy/teensy_ui.h | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'teensy/teensy_ui.h') diff --git a/teensy/teensy_ui.h b/teensy/teensy_ui.h index ce35ec1..802ec84 100644 --- a/teensy/teensy_ui.h +++ b/teensy/teensy_ui.h @@ -4,6 +4,8 @@ #include "teensy_common.h" #include "teensy.h" +#define TYUI_MAX_LAYOUT_SIZE (16) + #define TYUI_WIN_NORESIZE (1 << 0) #define TYUI_WIN_NOCLOSE (1 << 1) #define TYUI_WIN_NOMOVE (1 << 2) @@ -11,14 +13,29 @@ #define tyui_begin_window(title, rect, id) \ tyui_begin_window_ex(title, rect, id, 0, NULL) +#define tyui_text(...) tyui_text_ex(TYUI_ALIGN_LEFT, __VA_ARGS__) + +typedef uint8_t tyui_Align; +enum { + TYUI_ALIGN_LEFT, + TYUI_ALIGN_RIGHT, + TYUI_ALIGN_CENTER, +}; typedef struct { ty_Color fg_normal; ty_Color bg_normal; ty_Color fg_hover; ty_Color bg_hover; + ty_Color fg_pressed; + ty_Color bg_pressed; ty_Color win_bg; ty_Color win_title; + ty_Color frame; + int title_bar_height; + int padding; + int control_padding; + int frame_size; } tyui_Style; typedef uint8_t tyui_Id; @@ -26,7 +43,8 @@ typedef uint8_t tyui_Id; void tyui_init(const ty_Font *font); void tyui_deinit(void); -void tyui_layout(const float *layout); +void tyui_push_layout(const float *column_widths); +void tyui_pop_layout(void); void tyui_draw(void); @@ -38,9 +56,8 @@ bool tyui_begin_window_ex( bool *closed ); void tyui_end_window(void); -bool tyui_button(const char *text); -void tyui_slider(float min, float max, float step, float *value); -void tyui_text(const char *fmt, ...); +bool tyui_button(const char *text); +void tyui_text_ex(tyui_Align align, const char *fmt, ...); #endif // TEENSY_UI_H_ -- cgit v1.3-2-g0d8e