cosmic/theme/style/
dropdown.rs

1// Copyright 2023 System76 <info@system76.com>
2// SPDX-License-Identifier: MPL-2.0
3
4use crate::Theme;
5use crate::widget::dropdown;
6use iced::{Background, Color};
7
8impl dropdown::menu::StyleSheet for Theme {
9    type Style = ();
10
11    fn appearance(&self, _style: &Self::Style) -> dropdown::menu::Appearance {
12        let cosmic = self.cosmic();
13
14        dropdown::menu::Appearance {
15            text_color: cosmic.on_bg_color().into(),
16            background: Background::Color(cosmic.background.component.base.into()),
17            border_width: 0.0,
18            border_radius: cosmic.corner_radii.radius_m.into(),
19            border_color: Color::TRANSPARENT,
20
21            hovered_text_color: cosmic.on_bg_color().into(),
22            hovered_background: Background::Color(cosmic.primary.component.hover.into()),
23
24            selected_text_color: cosmic.accent.base.into(),
25            selected_background: Background::Color(cosmic.primary.component.hover.into()),
26
27            description_color: cosmic.primary.component.on_disabled.into(),
28        }
29    }
30}