wip: tooltips
This commit is contained in:
parent
f91369bdbb
commit
bd36d6bb8c
10 changed files with 939 additions and 69 deletions
|
|
@ -31,3 +31,6 @@ pub use self::segmented_button::SegmentedButton;
|
|||
mod text_input;
|
||||
#[doc(inline)]
|
||||
pub use self::text_input::TextInput;
|
||||
|
||||
pub mod tooltip;
|
||||
pub use tooltip::Tooltip;
|
||||
|
|
|
|||
31
src/theme/style/tooltip.rs
Normal file
31
src/theme/style/tooltip.rs
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
use iced::{Background, Color};
|
||||
|
||||
use crate::widget::wayland::tooltip::Catalog;
|
||||
|
||||
#[derive(Default)]
|
||||
pub enum Tooltip {
|
||||
#[default]
|
||||
Default,
|
||||
}
|
||||
|
||||
impl Catalog for crate::Theme {
|
||||
type Class = Tooltip;
|
||||
|
||||
fn style(&self, style: &Self::Class) -> crate::widget::wayland::tooltip::Style {
|
||||
let cosmic = self.cosmic();
|
||||
|
||||
match style {
|
||||
Tooltip::Default => crate::widget::wayland::tooltip::Style {
|
||||
text_color: cosmic.on_bg_color().into(),
|
||||
background: Some(Background::Color(cosmic.background.component.base.into())),
|
||||
border_width: 0.0,
|
||||
border_radius: cosmic.corner_radii.radius_m.into(),
|
||||
border_color: Color::TRANSPARENT,
|
||||
shadow_offset: iced::Vector::default(),
|
||||
outline_width: Default::default(),
|
||||
outline_color: Color::TRANSPARENT,
|
||||
icon_color: None,
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue