improv: remove double coloring of content_container windows
This sets the main content and the header bar to transparent when `content_container` is true, so that things aren't colored twice and overlayed on top of each other. This ensures that modifying color alpha behaves as expected, especially for frosted glass.
This commit is contained in:
parent
9fcd449611
commit
b71a7c9edf
3 changed files with 13 additions and 2 deletions
|
|
@ -396,6 +396,7 @@ pub enum Container<'a> {
|
|||
HeaderBar {
|
||||
focused: bool,
|
||||
sharp_corners: bool,
|
||||
transparent: bool,
|
||||
},
|
||||
List,
|
||||
Primary,
|
||||
|
|
@ -511,6 +512,7 @@ impl iced_container::Catalog for Theme {
|
|||
Container::HeaderBar {
|
||||
focused,
|
||||
sharp_corners,
|
||||
transparent,
|
||||
} => {
|
||||
let (icon_color, text_color) = if *focused {
|
||||
(
|
||||
|
|
@ -527,7 +529,11 @@ impl iced_container::Catalog for Theme {
|
|||
iced_container::Style {
|
||||
icon_color: Some(icon_color),
|
||||
text_color: Some(text_color),
|
||||
background: Some(iced::Background::Color(cosmic.background.base.into())),
|
||||
background: if *transparent {
|
||||
None
|
||||
} else {
|
||||
Some(iced::Background::Color(cosmic.background.base.into()))
|
||||
},
|
||||
border: Border {
|
||||
radius: [
|
||||
if *sharp_corners {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue