From c6e56abcb02a2c76b945cee6f44a8a3f01e674c9 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Mon, 17 Nov 2025 18:02:33 +0100 Subject: [PATCH] feat: add bar_left and bar_right widget styles --- src/config.zig | 6 ++++++ src/tui/WidgetStyle.zig | 14 ++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/config.zig b/src/config.zig index f232d3c..fb71304 100644 --- a/src/config.zig +++ b/src/config.zig @@ -43,6 +43,8 @@ widget_style: WidgetStyle = .compact, palette_style: WidgetStyle = .bars_top_bottom, panel_style: WidgetStyle = .compact, home_style: WidgetStyle = .bars_top_bottom, +pane_left_style: WidgetStyle = .bar_right, +pane_right_style: WidgetStyle = .bar_left, lsp_output: enum { quiet, verbose } = .quiet, @@ -78,11 +80,15 @@ pub const WidgetType = enum { palette, panel, home, + pane_left, + pane_right, }; pub const WidgetStyle = enum { bars_top_bottom, bars_left_right, + bar_left, + bar_right, thick_boxed, extra_thick_boxed, dotted_boxed, diff --git a/src/tui/WidgetStyle.zig b/src/tui/WidgetStyle.zig index 4f91d71..2dbd129 100644 --- a/src/tui/WidgetStyle.zig +++ b/src/tui/WidgetStyle.zig @@ -29,6 +29,8 @@ pub const Margin = struct { const @"top/bottom/2": Margin = .{ .top = 2, .bottom = 2, .left = 0, .right = 0 }; const @"left/right/1": Margin = .{ .top = 0, .bottom = 0, .left = 1, .right = 1 }; const @"left/right/2": Margin = .{ .top = 0, .bottom = 0, .left = 2, .right = 2 }; + const @"left/1": Margin = .{ .top = 0, .bottom = 0, .left = 1, .right = 0 }; + const @"right/1": Margin = .{ .top = 0, .bottom = 0, .left = 0, .right = 1 }; }; pub const Border = struct { @@ -112,6 +114,16 @@ const bars_left_right: @This() = .{ .border = Border.@"thick box (octant)", }; +const bar_left: @This() = .{ + .padding = Margin.@"left/1", + .border = Border.@"thick box (octant)", +}; + +const bar_right: @This() = .{ + .padding = Margin.@"right/1", + .border = Border.@"thick box (octant)", +}; + pub fn from_tag(tag: WidgetStyle) *const @This() { return switch (tag) { .compact => &compact, @@ -126,6 +138,8 @@ pub fn from_tag(tag: WidgetStyle) *const @This() { .extra_thick_boxed => &extra_thick_boxed, .bars_top_bottom => &bars_top_bottom, .bars_left_right => &bars_left_right, + .bar_left => &bar_left, + .bar_right => &bar_right, }; }