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 {{{
|
||||||
|
|
||||||
[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 " ]
|
||||||
|
|
||||||
# : }}}
|
# : }}}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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)]
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue