mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
feat: theme configuration for completion
This commit is contained in:
parent
03fd890f10
commit
fd81366de8
3 changed files with 29 additions and 14 deletions
|
|
@ -84,6 +84,15 @@ inactive = {}
|
|||
|
||||
# : }}}
|
||||
|
||||
# : Completion {{{
|
||||
|
||||
[completion]
|
||||
border = { fg = "blue" }
|
||||
active = { fg = "lightcyan" }
|
||||
inactive = {}
|
||||
|
||||
# : }}}
|
||||
|
||||
|
||||
# : Tasks {{{
|
||||
|
||||
|
|
|
|||
|
|
@ -81,6 +81,13 @@ pub struct Select {
|
|||
pub inactive: Style,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize)]
|
||||
pub struct Completion {
|
||||
pub border: Style,
|
||||
pub active: Style,
|
||||
pub inactive: Style,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize)]
|
||||
pub struct Tasks {
|
||||
pub border: Style,
|
||||
|
|
@ -111,13 +118,14 @@ pub struct Help {
|
|||
|
||||
#[derive(Deserialize, Serialize)]
|
||||
pub struct Theme {
|
||||
pub manager: Manager,
|
||||
status: Status,
|
||||
pub input: Input,
|
||||
pub select: Select,
|
||||
pub tasks: Tasks,
|
||||
pub which: Which,
|
||||
pub help: Help,
|
||||
pub manager: Manager,
|
||||
status: Status,
|
||||
pub input: Input,
|
||||
pub select: Select,
|
||||
pub completion: Completion,
|
||||
pub tasks: Tasks,
|
||||
pub which: Which,
|
||||
pub help: Help,
|
||||
|
||||
// File-specific styles
|
||||
#[serde(rename = "filetype", deserialize_with = "Filetype::deserialize", skip_serializing)]
|
||||
|
|
|
|||
|
|
@ -35,11 +35,10 @@ impl<'a> Widget for Completion<'a> {
|
|||
} else {
|
||||
s.split_at(max_width - 1).0.to_string() + "…"
|
||||
})
|
||||
// todo
|
||||
.style(if completion.cursor() == idx {
|
||||
THEME.select.active.into()
|
||||
THEME.completion.active.into()
|
||||
} else {
|
||||
THEME.select.inactive.into()
|
||||
THEME.completion.inactive.into()
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
|
@ -47,10 +46,9 @@ impl<'a> Widget for Completion<'a> {
|
|||
Table::new(table)
|
||||
.block(
|
||||
Block::new()
|
||||
.borders(Borders::ALL)
|
||||
.border_type(BorderType::Double)
|
||||
// todo
|
||||
.border_style(THEME.select.border.into()),
|
||||
.borders(Borders::ALL)
|
||||
.border_type(BorderType::Double)
|
||||
.border_style(THEME.completion.border.into()),
|
||||
)
|
||||
.widths(&constraint)
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue