aboutsummaryrefslogtreecommitdiff
path: root/teensy/teensy_ui.c
diff options
context:
space:
mode:
Diffstat (limited to 'teensy/teensy_ui.c')
-rw-r--r--teensy/teensy_ui.c10
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
{