feat: add option to disable modal dim effect

For some terminal themes is cooler to not dim the screen when palettes
are showing.
This commit is contained in:
CJ van den Berg 2025-11-19 17:48:44 +01:00
parent 85c3e7ae7c
commit 395dadf6e3
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
2 changed files with 2 additions and 0 deletions

View file

@ -9,6 +9,7 @@ gutter_line_numbers_style: DigitStyle = .ascii,
gutter_symbols: bool = true,
enable_terminal_cursor: bool = true,
enable_terminal_color_scheme: bool = false,
enable_modal_dim: bool = true,
highlight_current_line: bool = true,
highlight_current_line_gutter: bool = true,
highlight_columns: []const u16 = &.{ 80, 100, 120 },

View file

@ -87,6 +87,7 @@ pub fn State(ctx_type: type) type {
}
pub fn render(self: *Self, theme: *const Widget.Theme) bool {
if (!tui.config().enable_modal_dim) return false;
return self.opts.on_render(self.opts.ctx, self, theme);
}