From 79b430457642b34be58453bf461728c5fc0d975f Mon Sep 17 00:00:00 2001 From: sxyazi Date: Thu, 17 Oct 2024 18:29:45 +0800 Subject: [PATCH] Refactor --- yazi-config/preset/theme.toml | 14 +++++++------- yazi-config/src/theme/theme.rs | 14 +++++++------- yazi-fm/src/confirm/buttons.rs | 4 ++-- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/yazi-config/preset/theme.toml b/yazi-config/preset/theme.toml index a10142eb..f6c1f347 100644 --- a/yazi-config/preset/theme.toml +++ b/yazi-config/preset/theme.toml @@ -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 " ] # : }}} diff --git a/yazi-config/src/theme/theme.rs b/yazi-config/src/theme/theme.rs index 72841e50..9227e8c2 100644 --- a/yazi-config/src/theme/theme.rs +++ b/yazi-config/src/theme/theme.rs @@ -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)] diff --git a/yazi-fm/src/confirm/buttons.rs b/yazi-fm/src/confirm/buttons.rs index 5d2e3af4..727bc913 100644 --- a/yazi-fm/src/confirm/buttons.rs +++ b/yazi-fm/src/confirm/buttons.rs @@ -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); }