refactor: remove extra opacity where it was added

This commit is contained in:
Ashley Wulber 2026-04-21 11:14:23 -04:00 • committed by Ashley Wulber
parent 732785a50c
commit 2d7f66d528
4 changed files with 31 additions and 10 deletions

View file

@ -389,7 +389,9 @@ pub enum Container<'a> {
WindowBackground,
Background,
Card,
ContextDrawer,
ContextDrawer {
transparent: bool,
},
Custom(Box<dyn Fn(&Theme) -> iced_container::Style + 'a>),
Dialog,
Dropdown,
@ -587,11 +589,8 @@ impl iced_container::Catalog for Theme {
}
}
Container::ContextDrawer => {
let mut a = Container::primary(cosmic, self.transparent);
if let Some(Background::Color(ref mut color)) = a.background {
color.a = (color.a + if cosmic.is_dark { 0.60 } else { 0.5 }).min(1.);
}
Container::ContextDrawer { transparent } => {
let mut a = Container::primary(cosmic, self.transparent && *transparent);
if cosmic.is_high_contrast {
a.border.width = 1.;

View file

@ -66,7 +66,6 @@ impl StyleSheet for Theme {
let cosmic = self.cosmic();
let component = &cosmic.background(self.transparent).component;
let mut bg = component.base;
bg.alpha = (bg.alpha + if cosmic.is_dark { 0.6 } else { 0.5 }).min(1.);
match style {
MenuBarStyle::Default => Appearance {