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]
button_labels = [" [Y]es ", " (N)o "]
border = { fg = "blue" }
title = { fg = "blue" }
content = { }
list = { }
button_yes = { reversed = true }
button_no = { }
border = { fg = "blue" }
title = { fg = "blue" }
content = {}
list = {}
btn_yes = { reversed = true }
btn_no = {}
btn_labels = [ " [Y]es ", " (N)o " ]
# : }}}

View file

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

View file

@ -8,10 +8,10 @@ impl Widget for Buttons {
let chunks =
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()
.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()
.render(chunks[1], buf);
}