From d891af6553288b2ae98fb72042862aea397d0d06 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Tue, 20 Jan 2026 20:13:01 +0100 Subject: [PATCH] refactor: allow changing the hover mouse cursor for buttons --- src/tui/Button.zig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tui/Button.zig b/src/tui/Button.zig index b8e29ae..4e3bfa8 100644 --- a/src/tui/Button.zig +++ b/src/tui/Button.zig @@ -13,6 +13,7 @@ pub fn Options(context: type) type { label: []const u8 = "button", pos: Widget.Box = .{ .y = 0, .x = 0, .w = 8, .h = 1 }, ctx: Context, + cursor: tui.renderer.MouseCursorShape = .pointer, on_click: ClickHandler = do_nothing, on_click2: ClickHandler = do_nothing, @@ -156,7 +157,7 @@ fn State(ctx_type: type) type { tui.need_render(@src()); return true; } else if (try m.match(.{ "H", tp.extract(&self.hover) })) { - tui.rdr().request_mouse_cursor_pointer(self.hover); + tui.rdr().request_mouse_cursor(self.opts.cursor, self.hover); tui.need_render(@src()); return true; }