refactor: add dropdown widget type
This commit is contained in:
parent
3c9cf07f9d
commit
1f67c8e2ce
3 changed files with 5 additions and 0 deletions
|
|
@ -53,6 +53,7 @@ start_debugger_on_crash: bool = false,
|
||||||
|
|
||||||
widget_style: WidgetStyle = .compact,
|
widget_style: WidgetStyle = .compact,
|
||||||
palette_style: WidgetStyle = .bars_top_bottom,
|
palette_style: WidgetStyle = .bars_top_bottom,
|
||||||
|
dropdown_style: WidgetStyle = .compact,
|
||||||
panel_style: WidgetStyle = .compact,
|
panel_style: WidgetStyle = .compact,
|
||||||
home_style: WidgetStyle = .bars_top_bottom,
|
home_style: WidgetStyle = .bars_top_bottom,
|
||||||
pane_left_style: WidgetStyle = .bar_right,
|
pane_left_style: WidgetStyle = .bar_right,
|
||||||
|
|
@ -103,6 +104,7 @@ pub const WidgetType = enum {
|
||||||
pane_left,
|
pane_left,
|
||||||
pane_right,
|
pane_right,
|
||||||
hint_window,
|
hint_window,
|
||||||
|
dropdown,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub const WidgetStyle = enum {
|
pub const WidgetStyle = enum {
|
||||||
|
|
|
||||||
|
|
@ -158,6 +158,7 @@ pub fn theme_style_from_type(style_type: WidgetType, theme: *const Theme) Theme.
|
||||||
.none => theme.editor,
|
.none => theme.editor,
|
||||||
.palette => .{ .fg = theme.editor_widget_border.fg, .bg = theme.editor_widget.bg },
|
.palette => .{ .fg = theme.editor_widget_border.fg, .bg = theme.editor_widget.bg },
|
||||||
.panel => .{ .fg = theme.editor_widget_border.fg, .bg = theme.editor.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 },
|
.home => .{ .fg = theme.editor_widget_border.fg, .bg = theme.editor.bg },
|
||||||
.pane_left => switch (tui.config().pane_style) {
|
.pane_left => switch (tui.config().pane_style) {
|
||||||
.panel => .{ .fg = theme.editor_widget.bg, .bg = theme.panel.bg },
|
.panel => .{ .fg = theme.editor_widget.bg, .bg = theme.panel.bg },
|
||||||
|
|
|
||||||
|
|
@ -2225,6 +2225,7 @@ pub fn get_widget_style(widget_type: WidgetType) *const WidgetStyle {
|
||||||
return switch (widget_type) {
|
return switch (widget_type) {
|
||||||
.none => WidgetStyle.from_tag(config_.widget_style),
|
.none => WidgetStyle.from_tag(config_.widget_style),
|
||||||
.palette => WidgetStyle.from_tag(config_.palette_style),
|
.palette => WidgetStyle.from_tag(config_.palette_style),
|
||||||
|
.dropdown => WidgetStyle.from_tag(config_.dropdown_style),
|
||||||
.panel => WidgetStyle.from_tag(config_.panel_style),
|
.panel => WidgetStyle.from_tag(config_.panel_style),
|
||||||
.home => WidgetStyle.from_tag(config_.home_style),
|
.home => WidgetStyle.from_tag(config_.home_style),
|
||||||
.pane_left => WidgetStyle.from_tag(config_.pane_left_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) {
|
return switch (widget_type) {
|
||||||
.none => &config_.widget_style,
|
.none => &config_.widget_style,
|
||||||
.palette => &config_.palette_style,
|
.palette => &config_.palette_style,
|
||||||
|
.dropdown => &config_.dropdown_style,
|
||||||
.panel => &config_.panel_style,
|
.panel => &config_.panel_style,
|
||||||
.home => &config_.home_style,
|
.home => &config_.home_style,
|
||||||
.pane_left => &config_.pane_left_style,
|
.pane_left => &config_.pane_left_style,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue