diff options
| author | iamcheeseman <[email protected]> | 2026-05-22 11:54:35 -0400 |
|---|---|---|
| committer | iamcheeseman <[email protected]> | 2026-05-22 11:54:35 -0400 |
| commit | b6b91c8b0a404d5d59087d98a063c20eb28685e0 (patch) | |
| tree | e5aad5953c25e0fe506154e57bf62b1af0152664 /teensy/teensy_ui.c | |
| parent | ba6eec44b5a49ed5ee6a119520d4e3ebf1213842 (diff) | |
tyui: add slider value to style
Diffstat (limited to 'teensy/teensy_ui.c')
| -rw-r--r-- | teensy/teensy_ui.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/teensy/teensy_ui.c b/teensy/teensy_ui.c index f5ba00f..98c7277 100644 --- a/teensy/teensy_ui.c +++ b/teensy/teensy_ui.c @@ -89,6 +89,7 @@ tyui_Style default_style = { .control_padding = 2, .frame_size = 1, .grabber_size = 4, + .slider_fmt = "%2d" }; static @@ -488,8 +489,13 @@ void tyui_slider_ex( float value = *value_ptr; draw_frame(rect, bg_col); - if (show_value) - text_cmd(ty_format("%d", (int)round(value)), rect, value_align); + if (show_value) { + text_cmd( + ty_format(uictx.style.slider_fmt, (int)round(value)), + rect, + value_align + ); + } // Grabber { |
