This commit is contained in:
sxyazi 2024-10-17 18:29:45 +08:00
parent 7f01ed16ec
commit 79b4304576
No known key found for this signature in database
3 changed files with 16 additions and 16 deletions

View file

@ -101,13 +101,13 @@ selected = { reversed = true }
# : Confirm {{{ # : Confirm {{{
[confirm] [confirm]
button_labels = [" [Y]es ", " (N)o "] border = { fg = "blue" }
border = { fg = "blue" } title = { fg = "blue" }
title = { fg = "blue" } content = {}
content = { } list = {}
list = { } btn_yes = { reversed = true }
button_yes = { reversed = true } btn_no = {}
button_no = { } btn_labels = [ " [Y]es ", " (N)o " ]
# : }}} # : }}}

View file

@ -117,13 +117,13 @@ pub struct Input {
#[derive(Deserialize, Serialize)] #[derive(Deserialize, Serialize)]
pub struct Confirm { pub struct Confirm {
pub button_labels: [String; 2], pub border: Style,
pub border: Style, pub title: Style,
pub title: Style, pub content: Style,
pub content: Style, pub list: Style,
pub list: Style, pub btn_yes: Style,
pub button_yes: Style, pub btn_no: Style,
pub button_no: Style, pub btn_labels: [String; 2],
} }
#[derive(Deserialize, Serialize)] #[derive(Deserialize, Serialize)]

View file

@ -8,10 +8,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.button_yes)) Paragraph::new(Span::raw(&THEME.confirm.btn_labels[0]).style(THEME.confirm.btn_yes))
.centered() .centered()
.render(chunks[0], buf); .render(chunks[0], buf);
Paragraph::new(Span::raw(&THEME.confirm.button_labels[1]).style(THEME.confirm.button_no)) Paragraph::new(Span::raw(&THEME.confirm.btn_labels[1]).style(THEME.confirm.btn_no))
.centered() .centered()
.render(chunks[1], buf); .render(chunks[1], buf);
} }