From a6db807c1bbffc90b68513171348cad0b4469eac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vuka=C5=A1in=20Vojinovi=C4=87?= Date: Tue, 26 Nov 2024 19:34:43 +0100 Subject: [PATCH] fix --- src/app/mod.rs | 25 +------------------------ src/theme/style/iced.rs | 26 ++++++++++++++++++++++---- 2 files changed, 23 insertions(+), 28 deletions(-) diff --git a/src/app/mod.rs b/src/app/mod.rs index 6051a2e91f9..6e85ff73643 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -882,30 +882,7 @@ impl ApplicationExt for App { header = header.end(element.map(Message::App)); } - header - // Needed for apps without a content container, but with a header bar - .apply(container) - .style(move |theme| container::Style { - background: if content_container { - None - } else { - Some(iced::Background::Color( - theme.cosmic().background.base.into(), - )) - }, - border: iced::Border { - radius: [ - theme.cosmic().radius_s()[0] - 1.0, - theme.cosmic().radius_s()[1] - 1.0, - theme.cosmic().radius_0()[2], - theme.cosmic().radius_0()[3], - ] - .into(), - ..Default::default() - }, - ..Default::default() - }) - .apply(|w| id_container(w, iced_core::id::Id::new("COSMIC_header"))) + header.apply(|w| id_container(w, iced_core::id::Id::new("COSMIC_header"))) }) } else { None diff --git a/src/theme/style/iced.rs b/src/theme/style/iced.rs index 1bf20524c7a..f51e2650ab0 100644 --- a/src/theme/style/iced.rs +++ b/src/theme/style/iced.rs @@ -469,8 +469,17 @@ impl iced_container::Catalog for Theme { Container::WindowBackground => iced_container::Style { icon_color: Some(Color::from(cosmic.background.on)), text_color: Some(Color::from(cosmic.background.on)), - background: None, - border: Border::default(), + background: Some(iced::Background::Color(cosmic.background.base.into())), + border: Border { + radius: [ + cosmic.corner_radii.radius_0[0], + cosmic.corner_radii.radius_0[1], + cosmic.corner_radii.radius_s[2], + cosmic.corner_radii.radius_s[3], + ] + .into(), + ..Default::default() + }, shadow: Shadow::default(), }, @@ -504,8 +513,17 @@ impl iced_container::Catalog for Theme { iced_container::Style { icon_color: Some(icon_color), text_color: Some(text_color), - background: None, - border: Border::default(), + background: Some(iced::Background::Color(cosmic.background.base.into())), + border: Border { + radius: [ + cosmic.corner_radii.radius_s[0], + cosmic.corner_radii.radius_s[1], + cosmic.corner_radii.radius_0[2], + cosmic.corner_radii.radius_0[3], + ] + .into(), + ..Default::default() + }, shadow: Shadow::default(), } }