feat: theme configuration for completion

This commit is contained in:
XOR-op 2023-10-26 23:35:35 -04:00
parent 03fd890f10
commit fd81366de8
3 changed files with 29 additions and 14 deletions

View file

@ -84,6 +84,15 @@ inactive = {}
# : }}} # : }}}
# : Completion {{{
[completion]
border = { fg = "blue" }
active = { fg = "lightcyan" }
inactive = {}
# : }}}
# : Tasks {{{ # : Tasks {{{

View file

@ -81,6 +81,13 @@ pub struct Select {
pub inactive: Style, pub inactive: Style,
} }
#[derive(Deserialize, Serialize)]
pub struct Completion {
pub border: Style,
pub active: Style,
pub inactive: Style,
}
#[derive(Deserialize, Serialize)] #[derive(Deserialize, Serialize)]
pub struct Tasks { pub struct Tasks {
pub border: Style, pub border: Style,
@ -115,6 +122,7 @@ pub struct Theme {
status: Status, status: Status,
pub input: Input, pub input: Input,
pub select: Select, pub select: Select,
pub completion: Completion,
pub tasks: Tasks, pub tasks: Tasks,
pub which: Which, pub which: Which,
pub help: Help, pub help: Help,

View file

@ -35,11 +35,10 @@ impl<'a> Widget for Completion<'a> {
} else { } else {
s.split_at(max_width - 1).0.to_string() + "" s.split_at(max_width - 1).0.to_string() + ""
}) })
// todo
.style(if completion.cursor() == idx { .style(if completion.cursor() == idx {
THEME.select.active.into() THEME.completion.active.into()
} else { } else {
THEME.select.inactive.into() THEME.completion.inactive.into()
}), }),
); );
} }
@ -49,8 +48,7 @@ impl<'a> Widget for Completion<'a> {
Block::new() Block::new()
.borders(Borders::ALL) .borders(Borders::ALL)
.border_type(BorderType::Double) .border_type(BorderType::Double)
// todo .border_style(THEME.completion.border.into()),
.border_style(THEME.select.border.into()),
) )
.widths(&constraint) .widths(&constraint)
}; };