feat: continued reskin
This commit is contained in:
parent
551565cdd8
commit
d5d3027148
8 changed files with 39 additions and 22 deletions
|
|
@ -591,7 +591,7 @@ impl<App: Application> 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,
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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::<Message>(
|
||||
renderer,
|
||||
theme,
|
||||
style,
|
||||
cursor,
|
||||
viewport,
|
||||
status_appearance.text_color,
|
||||
close_color,
|
||||
close_button_bounds,
|
||||
self.close_icon.clone(),
|
||||
close_icon,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue