From 3dd9efa66e7f745cd57920361a892aa4a4411387 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Wed, 14 Aug 2024 21:45:30 +0200 Subject: [PATCH] feat: make the statusbar gripper a litte more subtle by moving it to the left edge --- src/tui/status/statusbar.zig | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/tui/status/statusbar.zig b/src/tui/status/statusbar.zig index 0248e00..6c41bdf 100644 --- a/src/tui/status/statusbar.zig +++ b/src/tui/status/statusbar.zig @@ -24,10 +24,16 @@ pub fn create(a: std.mem.Allocator, parent: Widget, event_handler: ?Widget.Event fn render_grip(ctx: ?*anyopaque, theme: *const Widget.Theme) void { const w: *WidgetList = @ptrCast(@alignCast(ctx.?)); if (w.hover()) { - w.plane.set_style(theme.statusbar_hover); - const width = w.plane.dim_x(); - const grip_pos = width / 2; - w.plane.cursor_move_yx(0, @intCast(grip_pos)) catch {}; + const w0 = &w.widgets.items[0].widget; + const style = if (tui.current().config.modestate_show) + if (w0.hover()) + theme.editor_selection + else + theme.statusbar_hover + else + theme.statusbar_hover; + w.plane.set_style(style); + w.plane.cursor_move_yx(0, 0) catch {}; _ = w.plane.putstr("  ") catch {}; } }