Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
25 changes: 3 additions & 22 deletions src/theme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use crate::{
components::button::{ButtonHierarchy, ButtonKind},
config::{
Appearance, AppearanceColor, AppearanceStyle, BackgroundLevel, MenuAppearance, Position,
Radius,
},
};
use iced::{
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down