From 8f873ae3ee26de0d8a0aa1578702dbf662e1fe02 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Wed, 19 Nov 2025 18:25:58 +0100 Subject: [PATCH 1/2] feat: add pane_style config option --- src/config.zig | 6 ++++++ src/tui/WidgetStyle.zig | 11 +++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/config.zig b/src/config.zig index 60993d8..ad16685 100644 --- a/src/config.zig +++ b/src/config.zig @@ -46,6 +46,7 @@ panel_style: WidgetStyle = .compact, home_style: WidgetStyle = .bars_top_bottom, pane_left_style: WidgetStyle = .bar_right, pane_right_style: WidgetStyle = .bar_left, +pane_style: PaneStyle = .panel, centered_view: bool = false, centered_view_width: usize = 145, @@ -125,3 +126,8 @@ pub const CursorShape = enum { beam_blink, beam, }; + +pub const PaneStyle = enum { + panel, + editor, +}; diff --git a/src/tui/WidgetStyle.zig b/src/tui/WidgetStyle.zig index fd5e713..99cd19e 100644 --- a/src/tui/WidgetStyle.zig +++ b/src/tui/WidgetStyle.zig @@ -3,6 +3,7 @@ border: Border = Border.blank, pub const WidgetType = @import("config").WidgetType; pub const WidgetStyle = @import("config").WidgetStyle; +pub const tui = @import("tui.zig"); pub const Padding = struct { pub const Unit = u16; @@ -151,7 +152,13 @@ pub fn theme_style_from_type(style_type: WidgetType, theme: *const Theme) Theme. .palette => .{ .fg = theme.editor_widget_border.fg, .bg = theme.editor_widget.bg }, .panel => .{ .fg = theme.editor_widget_border.fg, .bg = theme.editor.bg }, .home => .{ .fg = theme.editor_widget_border.fg, .bg = theme.editor.bg }, - .pane_left => .{ .fg = theme.editor_widget.bg, .bg = theme.panel.bg }, - .pane_right => .{ .fg = theme.editor_widget.bg, .bg = theme.panel.bg }, + .pane_left => switch (tui.config().pane_style) { + .panel => .{ .fg = theme.editor_widget.bg, .bg = theme.panel.bg }, + .editor => .{ .fg = theme.editor_widget.bg, .bg = theme.editor.bg }, + }, + .pane_right => switch (tui.config().pane_style) { + .panel => .{ .fg = theme.editor_widget.bg, .bg = theme.panel.bg }, + .editor => .{ .fg = theme.editor_widget.bg, .bg = theme.editor.bg }, + }, }; } From 9bebebc086677973ed3d9a580d573d255392b451 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Wed, 19 Nov 2025 18:26:23 +0100 Subject: [PATCH 2/2] feat: add scrollbar_auto_hide config option --- src/config.zig | 1 + src/tui/scrollbar_v.zig | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/config.zig b/src/config.zig index ad16685..72f4988 100644 --- a/src/config.zig +++ b/src/config.zig @@ -37,6 +37,7 @@ top_bar: []const u8 = "tabs", bottom_bar: []const u8 = "mode file log selection diagnostics keybind branch linenumber clock spacer", show_scrollbars: bool = true, show_fileicons: bool = true, +scrollbar_auto_hide: bool = false, start_debugger_on_crash: bool = false, diff --git a/src/tui/scrollbar_v.zig b/src/tui/scrollbar_v.zig index 306521e..d307bcd 100644 --- a/src/tui/scrollbar_v.zig +++ b/src/tui/scrollbar_v.zig @@ -6,6 +6,7 @@ const Plane = @import("renderer").Plane; const input = @import("input"); const EventHandler = @import("EventHandler"); +const tui = @import("tui.zig"); const Widget = @import("Widget.zig"); plane: Plane, @@ -128,7 +129,8 @@ pub fn render(self: *Self, theme: *const Widget.Theme) bool { defer frame.deinit(); self.plane.set_base_style(style); self.plane.erase(); - smooth_bar_at(&self.plane, @intCast(self.pos_scrn), @intCast(self.view_scrn)) catch {}; + if (!(tui.config().scrollbar_auto_hide and self.size_scrn == self.view_scrn)) + smooth_bar_at(&self.plane, @intCast(self.pos_scrn), @intCast(self.view_scrn)) catch {}; return false; }