libcosmic-yoda/src/theme/style/dropdown.rs

41 lines
1.3 KiB
Rust
Raw Normal View History

// Copyright 2023 System76 <info@system76.com>
// SPDX-License-Identifier: MPL-2.0
use crate::Theme;
2025-03-21 13:33:07 +01:00
use crate::widget::dropdown;
use iced::{Background, Color};
impl dropdown::menu::StyleSheet for Theme {
type Style = ();
fn appearance(&self, _style: &Self::Style) -> dropdown::menu::Appearance {
let cosmic = self.cosmic();
dropdown::menu::Appearance {
text_color: cosmic.on_bg_color().into(),
2026-04-15 15:06:07 -04:00
background: Background::Color(
cosmic.background(self.transparent).component.base.into(),
),
border_width: 0.0,
border_radius: cosmic.corner_radii.radius_m.into(),
border_color: Color::TRANSPARENT,
hovered_text_color: cosmic.on_bg_color().into(),
2026-04-15 15:06:07 -04:00
hovered_background: Background::Color(
cosmic.primary(self.transparent).component.hover.into(),
),
2025-07-21 10:49:47 -04:00
selected_text_color: cosmic.accent_text_color().into(),
2026-04-15 15:06:07 -04:00
selected_background: Background::Color(
cosmic.primary(self.transparent).component.hover.into(),
),
2026-04-15 15:06:07 -04:00
description_color: cosmic
.primary(self.transparent)
.component
.on_disabled
.into(),
}
}
}