feat: add scrollbar_auto_hide config option

This commit is contained in:
CJ van den Berg 2025-11-19 18:26:23 +01:00
parent 8f873ae3ee
commit 9bebebc086
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
2 changed files with 4 additions and 1 deletions

View file

@ -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,

View file

@ -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;
}