mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
Refactor
This commit is contained in:
parent
7f01ed16ec
commit
79b4304576
3 changed files with 16 additions and 16 deletions
|
|
@ -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 " ]
|
||||
|
||||
# : }}}
|
||||
|
||||
|
|
|
|||
|
|
@ -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)]
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue