diff --git a/src/config.rs b/src/config.rs index c37a83c7..1ff2d7cf 100644 --- a/src/config.rs +++ b/src/config.rs @@ -888,6 +888,26 @@ impl Default for MenuAppearance { } } +#[derive(Deserialize, Clone, Copy, Debug)] +#[serde(default)] +pub struct Radius { + pub sm: f32, + pub md: f32, + pub lg: f32, + pub xl: f32, +} + +impl Default for Radius { + fn default() -> Self { + Self { + sm: 4.0, + md: 8.0, + lg: 16.0, + xl: 32.0, + } + } +} + #[derive(Deserialize, Clone, Debug)] #[serde(default)] pub struct Appearance { @@ -898,6 +918,7 @@ pub struct Appearance { #[serde(deserialize_with = "opacity_deserializer")] pub opacity: f32, pub menu: MenuAppearance, + pub radius: Radius, pub background_color: BackgroundAppearanceColor, pub primary_color: AppearanceColor, pub success_color: AppearanceColor, @@ -962,6 +983,7 @@ impl Default for Appearance { style: AppearanceStyle::default(), opacity: default_opacity(), menu: MenuAppearance::default(), + radius: Radius::default(), background_color: BackgroundAppearanceColor::Complete { base: HexColor::rgb(26, 27, 38), weakest: None, diff --git a/src/theme.rs b/src/theme.rs index 994e9ba3..a99b7d6a 100644 --- a/src/theme.rs +++ b/src/theme.rs @@ -4,6 +4,7 @@ use crate::{ components::button::{ButtonHierarchy, ButtonKind}, config::{ Appearance, AppearanceColor, AppearanceStyle, BackgroundLevel, MenuAppearance, Position, + Radius, }, }; use iced::{ @@ -53,26 +54,6 @@ impl Default for Space { } } -#[allow(unused)] -#[derive(Debug, Clone, Copy)] -pub struct Radius { - pub sm: f32, - pub md: f32, - pub lg: f32, - pub xl: f32, -} - -impl Default for Radius { - fn default() -> Self { - Self { - sm: 4.0, - md: 8.0, - lg: 16.0, - xl: 32.0, - } - } -} - #[allow(unused)] #[derive(Debug, Copy, Clone)] pub struct FontSize { @@ -123,7 +104,7 @@ impl Default for AshellTheme { AshellTheme { space: Space::default(), - radius: Radius::default(), + radius: appearance.radius, font_size: FontSize::default(), bar_position: Position::default(), bar_style: appearance.style, @@ -249,7 +230,7 @@ impl AshellTheme { AshellTheme { animations_enabled: animations.enabled, space: Space::default(), - radius: Radius::default(), + radius: appearance.radius, font_size: FontSize::default(), bar_position: position, bar_style: appearance.style,