feat(theme): border style

This commit is contained in:
sand4rt 2025-04-24 17:36:50 +02:00
parent bfad57d86f
commit b67bfa71e1
No known key found for this signature in database
GPG key ID: 8751B9BA696B12FB
3 changed files with 73 additions and 63 deletions

View file

@ -122,7 +122,7 @@ pub struct Which {
#[derive(Deserialize, DeserializeOver2, Serialize)] #[derive(Deserialize, DeserializeOver2, Serialize)]
pub struct Confirm { pub struct Confirm {
pub border: Style, pub border: BorderStyle,
pub title: Style, pub title: Style,
pub content: Style, pub content: Style,
pub list: Style, pub list: Style,
@ -134,7 +134,7 @@ pub struct Confirm {
#[derive(Deserialize, DeserializeOver2, Serialize)] #[derive(Deserialize, DeserializeOver2, Serialize)]
pub struct Spot { pub struct Spot {
pub border: Style, pub border: BorderStyle,
pub title: Style, pub title: Style,
pub tbl_col: Style, pub tbl_col: Style,
@ -154,14 +154,14 @@ pub struct Notify {
#[derive(Deserialize, DeserializeOver2, Serialize)] #[derive(Deserialize, DeserializeOver2, Serialize)]
pub struct Pick { pub struct Pick {
pub border: Style, pub border: BorderStyle,
pub active: Style, pub active: Style,
pub inactive: Style, pub inactive: Style,
} }
#[derive(Deserialize, DeserializeOver2, Serialize)] #[derive(Deserialize, DeserializeOver2, Serialize)]
pub struct Input { pub struct Input {
pub border: Style, pub border: BorderStyle,
pub title: Style, pub title: Style,
pub value: Style, pub value: Style,
pub selected: Style, pub selected: Style,
@ -169,7 +169,7 @@ pub struct Input {
#[derive(Deserialize, DeserializeOver2, Serialize)] #[derive(Deserialize, DeserializeOver2, Serialize)]
pub struct Cmp { pub struct Cmp {
pub border: Style, pub border: BorderStyle,
pub active: Style, pub active: Style,
pub inactive: Style, pub inactive: Style,
@ -180,7 +180,7 @@ pub struct Cmp {
#[derive(Deserialize, DeserializeOver2, Serialize)] #[derive(Deserialize, DeserializeOver2, Serialize)]
pub struct Tasks { pub struct Tasks {
pub border: Style, pub border: BorderStyle,
pub title: Style, pub title: Style,
pub hovered: Style, pub hovered: Style,
} }

View file

@ -0,0 +1,10 @@
use super::Style;
use ratatui::widgets::BorderType;
use serde::{Deserialize, Serialize, Serializer, ser::SerializeMap};
#[derive(Clone, Copy, Debug, Default, Deserialize)]
pub struct BorderStyle {
#[serde(flatten)]
pub style: Style,
pub r#type: BorderType,
}

View file

@ -1 +1 @@
yazi_macro::mod_flat!(color icon style); yazi_macro::mod_flat!(color icon style border_style);