feat: add scrollbar_auto_hide config option
This commit is contained in:
parent
8f873ae3ee
commit
9bebebc086
2 changed files with 4 additions and 1 deletions
|
|
@ -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,
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue