Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
git-f0x authored and wash2 committed Nov 26, 2024
1 parent 96c67e2 commit a6db807
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 28 deletions.
25 changes: 1 addition & 24 deletions src/app/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -882,30 +882,7 @@ impl<App: Application> 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
Expand Down
26 changes: 22 additions & 4 deletions src/theme/style/iced.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
},

Expand Down Expand Up @@ -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(),
}
}
Expand Down

0 comments on commit a6db807

Please sign in to comment.