chore: apply clippy suggestions
This commit is contained in:
parent
34f55d6720
commit
a27bb5e05d
34 changed files with 116 additions and 146 deletions
|
|
@ -22,15 +22,15 @@ pub type CosmicColor = ::palette::rgb::Srgba;
|
|||
pub type CosmicComponent = cosmic_theme::Component;
|
||||
pub type CosmicTheme = cosmic_theme::Theme;
|
||||
|
||||
pub static COSMIC_DARK: LazyLock<CosmicTheme> = LazyLock::new(|| CosmicTheme::dark_default());
|
||||
pub static COSMIC_DARK: LazyLock<CosmicTheme> = LazyLock::new(CosmicTheme::dark_default);
|
||||
|
||||
pub static COSMIC_HC_DARK: LazyLock<CosmicTheme> =
|
||||
LazyLock::new(|| CosmicTheme::high_contrast_dark_default());
|
||||
LazyLock::new(CosmicTheme::high_contrast_dark_default);
|
||||
|
||||
pub static COSMIC_LIGHT: LazyLock<CosmicTheme> = LazyLock::new(|| CosmicTheme::light_default());
|
||||
pub static COSMIC_LIGHT: LazyLock<CosmicTheme> = LazyLock::new(CosmicTheme::light_default);
|
||||
|
||||
pub static COSMIC_HC_LIGHT: LazyLock<CosmicTheme> =
|
||||
LazyLock::new(|| CosmicTheme::high_contrast_light_default());
|
||||
LazyLock::new(CosmicTheme::high_contrast_light_default);
|
||||
|
||||
pub static TRANSPARENT_COMPONENT: LazyLock<Component> = LazyLock::new(|| Component {
|
||||
base: CosmicColor::new(0.0, 0.0, 0.0, 0.0),
|
||||
|
|
|
|||
|
|
@ -898,12 +898,10 @@ impl toggler::Catalog for Theme {
|
|||
let mut active = toggler::Style {
|
||||
background: if matches!(status, toggler::Status::Active { is_toggled: true }) {
|
||||
cosmic.accent.base.into()
|
||||
} else if cosmic.is_dark {
|
||||
cosmic.palette.neutral_6.into()
|
||||
} else {
|
||||
if cosmic.is_dark {
|
||||
cosmic.palette.neutral_6.into()
|
||||
} else {
|
||||
cosmic.palette.neutral_5.into()
|
||||
}
|
||||
cosmic.palette.neutral_5.into()
|
||||
},
|
||||
foreground: cosmic.palette.neutral_2.into(),
|
||||
border_radius: cosmic.radius_xl().into(),
|
||||
|
|
@ -1166,11 +1164,7 @@ impl scrollable::Catalog for Theme {
|
|||
},
|
||||
gap: None,
|
||||
};
|
||||
let small_widget_container = self
|
||||
.current_container()
|
||||
.small_widget
|
||||
.clone()
|
||||
.with_alpha(0.7);
|
||||
let small_widget_container = self.current_container().small_widget.with_alpha(0.7);
|
||||
|
||||
if matches!(class, Scrollable::Permanent) {
|
||||
a.horizontal_rail.background =
|
||||
|
|
@ -1233,11 +1227,8 @@ impl scrollable::Catalog for Theme {
|
|||
};
|
||||
|
||||
if matches!(class, Scrollable::Permanent) {
|
||||
let small_widget_container = self
|
||||
.current_container()
|
||||
.small_widget
|
||||
.clone()
|
||||
.with_alpha(0.7);
|
||||
let small_widget_container =
|
||||
self.current_container().small_widget.with_alpha(0.7);
|
||||
|
||||
a.horizontal_rail.background =
|
||||
Some(Background::Color(small_widget_container.into()));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue