diff --git a/src/app/mod.rs b/src/app/mod.rs index 4b13d11a..5e1d413f 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -591,7 +591,7 @@ impl ApplicationExt for App { vertical_rule(1) .class(crate::theme::Rule::Custom(Box::new( |_: &crate::Theme| rule::Style { - color: iced_core::Color::from_rgba8(224, 224, 224, 1.0), + color: crate::theme::LIGHT_GRAY, width: 1, radius: 0.0.into(), fill_mode: rule::FillMode::Full, diff --git a/src/theme/mod.rs b/src/theme/mod.rs index 5232c058..8393e579 100644 --- a/src/theme/mod.rs +++ b/src/theme/mod.rs @@ -28,6 +28,14 @@ pub const STATE_DEFAULT_COLOR: iced_core::Color = pub const STATE_DEFAULT_BG: iced_core::Color = iced_core::Color::from_rgba(0.0, 0.588_235_3, 0.533_333_3, 0.10); +pub const LIGHT_GRAY: iced_core::Color = iced_core::Color::from_rgb(0.878_431_4, 0.878_431_4, 0.878_431_4); + +pub const HANDLE_GRAY: iced_core::Color = iced_core::Color::from_rgb(0.705_882_4, 0.705_882_4, 0.705_882_4); + +pub const CLOSE_RED: iced_core::Color = iced_core::Color::from_rgb(1.0, 0.0, 0.0); + +pub const CLOSE_RED_BG: iced_core::Color = iced_core::Color::from_rgba(1.0, 0.0, 0.0, 0.10); + pub type CosmicColor = ::palette::rgb::Srgba; pub type CosmicComponent = cosmic_theme::Component; pub type CosmicTheme = cosmic_theme::Theme; diff --git a/src/theme/style/button.rs b/src/theme/style/button.rs index 17dac774..1f6e9530 100644 --- a/src/theme/style/button.rs +++ b/src/theme/style/button.rs @@ -62,7 +62,7 @@ pub fn appearance( Button::Secondary => { corner_radii = &cosmic.corner_radii.radius_m; - appearance.background = Some(Background::Color(Color::from_rgb8(224, 224, 224))); + appearance.background = Some(Background::Color(crate::theme::LIGHT_GRAY)); appearance.text_color = Some(Color::BLACK); appearance.icon_color = Some(Color::BLACK); } diff --git a/src/theme/style/iced.rs b/src/theme/style/iced.rs index ce2824e6..5cac05d1 100644 --- a/src/theme/style/iced.rs +++ b/src/theme/style/iced.rs @@ -710,12 +710,12 @@ impl slider::Catalog for Theme { color: Color::TRANSPARENT, width: 0.0, }, - width: 4.0, + width: 6.0, }, handle: slider::Handle { shape: slider::HandleShape::Circle { - radius: 6.0, + radius: 9.0, }, border_color: Color::from_rgba8(0, 0, 0, 0.12), border_width: 1.0, @@ -739,7 +739,7 @@ impl slider::Catalog for Theme { slider::Status::Hovered => match class { Slider::Standard => { appearance.handle.shape = slider::HandleShape::Circle { - radius: 7.0, + radius: 11.0, }; appearance.handle.border_width = 1.0; appearance.handle.border_color = Color::from_rgba8(0, 0, 0, 0.12); @@ -755,7 +755,7 @@ impl slider::Catalog for Theme { slider::Status::Dragged => match class { Slider::Standard => { appearance.handle.shape = slider::HandleShape::Circle { - radius: 7.0, + radius: 11.0, }; appearance.handle.border_width = 1.0; appearance.handle.border_color = Color::from_rgba8(0, 0, 0, 0.12); @@ -810,16 +810,11 @@ impl pick_list::Catalog for Theme { background: Color::TRANSPARENT.into(), placeholder_color: cosmic.on_bg_color().into(), border: Border { - radius: cosmic.corner_radii.radius_m.into(), - width: if hc { 1. } else { 0. }, - color: if hc { - self.current_container().component.border.into() - } else { - Color::TRANSPARENT - }, + radius: cosmic.corner_radii.radius_s.into(), + width: 1.0, + color: crate::theme::LIGHT_GRAY, }, - // icon_size: 0.7, // TODO: how to replace - handle_color: cosmic.on_bg_color().into(), + handle_color: crate::theme::HANDLE_GRAY, }; match status { @@ -907,7 +902,7 @@ impl toggler::Catalog for Theme { let track_color = if is_toggled { crate::theme::STATE_DEFAULT_COLOR } else { - Color::from_rgb8(224, 224, 224) + crate::theme::LIGHT_GRAY }; let mut style = toggler::Style { diff --git a/src/widget/dropdown/multi/widget.rs b/src/widget/dropdown/multi/widget.rs index b1215684..30fab27a 100644 --- a/src/widget/dropdown/multi/widget.rs +++ b/src/widget/dropdown/multi/widget.rs @@ -516,7 +516,7 @@ pub fn draw<'a, S, Item: Clone + PartialEq + 'static>( ); if let Some(handle) = state.icon.as_ref() { - let svg_handle = iced_core::Svg::new(handle.clone()).color(style.text_color); + let svg_handle = iced_core::Svg::new(handle.clone()).color(style.handle_color); svg::Renderer::draw_svg( renderer, svg_handle, diff --git a/src/widget/dropdown/widget.rs b/src/widget/dropdown/widget.rs index 5fbedaff..a3a5d921 100644 --- a/src/widget/dropdown/widget.rs +++ b/src/widget/dropdown/widget.rs @@ -883,7 +883,7 @@ pub fn draw<'a, S>( ); if let Some(handle) = state.icon.clone() { - let svg_handle = svg::Svg::new(handle).color(style.text_color); + let svg_handle = svg::Svg::new(handle).color(style.handle_color); svg::Renderer::draw_svg( renderer, diff --git a/src/widget/header_bar.rs b/src/widget/header_bar.rs index e7b9340f..67477798 100644 --- a/src/widget/header_bar.rs +++ b/src/widget/header_bar.rs @@ -514,7 +514,7 @@ impl<'a, Message: Clone + 'static> HeaderBar<'a, Message> { .push( horizontal_rule(1).class(crate::theme::Rule::Custom(Box::new( |_: &crate::Theme| rule::Style { - color: Color::from_rgba8(224, 224, 224, 1.0), + color: crate::theme::LIGHT_GRAY, width: 1, radius: 0.0.into(), fill_mode: rule::FillMode::Full, diff --git a/src/widget/segmented_button/widget.rs b/src/widget/segmented_button/widget.rs index f8e58ece..e616f717 100644 --- a/src/widget/segmented_button/widget.rs +++ b/src/widget/segmented_button/widget.rs @@ -2060,19 +2060,33 @@ where }, shadow: Shadow::default(), }, - Background::Color(iced_core::Color::from_rgba(1.0, 0.0, 0.0, 0.1)), + Background::Color(crate::theme::CLOSE_RED_BG), ); } + let close_color = if state.close_hovered == Some(key) { + crate::theme::CLOSE_RED + } else { + status_appearance.text_color + }; + + let close_icon = self.close_icon.clone().class( + crate::theme::Svg::Custom(std::rc::Rc::new( + move |_theme| iced::widget::svg::Style { + color: Some(close_color), + }, + )), + ); + draw_icon::( renderer, theme, style, cursor, viewport, - status_appearance.text_color, + close_color, close_button_bounds, - self.close_icon.clone(), + close_icon, ); }