refactor: add dropdown widget type

This commit is contained in:
CJ van den Berg 2025-12-18 15:22:48 +01:00
parent 3c9cf07f9d
commit 1f67c8e2ce
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
3 changed files with 5 additions and 0 deletions

View file

@ -53,6 +53,7 @@ start_debugger_on_crash: bool = false,
widget_style: WidgetStyle = .compact,
palette_style: WidgetStyle = .bars_top_bottom,
dropdown_style: WidgetStyle = .compact,
panel_style: WidgetStyle = .compact,
home_style: WidgetStyle = .bars_top_bottom,
pane_left_style: WidgetStyle = .bar_right,
@ -103,6 +104,7 @@ pub const WidgetType = enum {
pane_left,
pane_right,
hint_window,
dropdown,
};
pub const WidgetStyle = enum {

View file

@ -158,6 +158,7 @@ pub fn theme_style_from_type(style_type: WidgetType, theme: *const Theme) Theme.
.none => theme.editor,
.palette => .{ .fg = theme.editor_widget_border.fg, .bg = theme.editor_widget.bg },
.panel => .{ .fg = theme.editor_widget_border.fg, .bg = theme.editor.bg },
.dropdown => .{ .fg = theme.editor_widget_border.fg, .bg = theme.editor.bg },
.home => .{ .fg = theme.editor_widget_border.fg, .bg = theme.editor.bg },
.pane_left => switch (tui.config().pane_style) {
.panel => .{ .fg = theme.editor_widget.bg, .bg = theme.panel.bg },

View file

@ -2225,6 +2225,7 @@ pub fn get_widget_style(widget_type: WidgetType) *const WidgetStyle {
return switch (widget_type) {
.none => WidgetStyle.from_tag(config_.widget_style),
.palette => WidgetStyle.from_tag(config_.palette_style),
.dropdown => WidgetStyle.from_tag(config_.dropdown_style),
.panel => WidgetStyle.from_tag(config_.panel_style),
.home => WidgetStyle.from_tag(config_.home_style),
.pane_left => WidgetStyle.from_tag(config_.pane_left_style),
@ -2252,6 +2253,7 @@ fn widget_type_config_variable(widget_type: WidgetType) *ConfigWidgetStyle {
return switch (widget_type) {
.none => &config_.widget_style,
.palette => &config_.palette_style,
.dropdown => &config_.dropdown_style,
.panel => &config_.panel_style,
.home => &config_.home_style,
.pane_left => &config_.pane_left_style,