mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
feat: separate button style config
This commit is contained in:
parent
d2fe67ab86
commit
f584c1b508
3 changed files with 6 additions and 4 deletions
|
|
@ -106,7 +106,8 @@ border = { fg = "blue" }
|
||||||
title = { fg = "blue" }
|
title = { fg = "blue" }
|
||||||
content = { }
|
content = { }
|
||||||
list = { }
|
list = { }
|
||||||
buttons = { reversed = true }
|
button_yes = { reversed = true }
|
||||||
|
button_no = { }
|
||||||
|
|
||||||
# : }}}
|
# : }}}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -122,7 +122,8 @@ pub struct Confirm {
|
||||||
pub title: Style,
|
pub title: Style,
|
||||||
pub content: Style,
|
pub content: Style,
|
||||||
pub list: Style,
|
pub list: Style,
|
||||||
pub buttons: Style,
|
pub button_yes: Style,
|
||||||
|
pub button_no: Style,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize, Serialize)]
|
#[derive(Deserialize, Serialize)]
|
||||||
|
|
|
||||||
|
|
@ -14,10 +14,10 @@ impl Widget for Buttons {
|
||||||
let chunks =
|
let chunks =
|
||||||
ratatui::layout::Layout::horizontal([Constraint::Fill(1), Constraint::Fill(1)]).split(area);
|
ratatui::layout::Layout::horizontal([Constraint::Fill(1), Constraint::Fill(1)]).split(area);
|
||||||
|
|
||||||
Paragraph::new(Span::raw(&THEME.confirm.button_labels[0]).style(THEME.confirm.buttons))
|
Paragraph::new(Span::raw(&THEME.confirm.button_labels[0]).style(THEME.confirm.button_yes))
|
||||||
.centered()
|
.centered()
|
||||||
.render(chunks[0], buf);
|
.render(chunks[0], buf);
|
||||||
Paragraph::new(Span::raw(&THEME.confirm.button_labels[1]).style(THEME.confirm.buttons))
|
Paragraph::new(Span::raw(&THEME.confirm.button_labels[1]).style(THEME.confirm.button_no))
|
||||||
.centered()
|
.centered()
|
||||||
.render(chunks[1], buf);
|
.render(chunks[1], buf);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue