summaryrefslogtreecommitdiff
path: root/src/widget.rs
blob: f1eb0f33699b8f53fd498cb5d9a881d11ec681c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use iced::Element;
use iced::widget::{container, text, tooltip};

pub mod tip {
    pub use super::tooltip::Position;
}

pub fn tip<'a, Message: 'a>(
    target: impl Into<Element<'a, Message>>,
    tip: &'a str,
    position: tip::Position,
) -> Element<'a, Message> {
    tooltip(
        target,
        container(text(tip).size(14))
            .padding(5)
            .style(container::rounded_box),
        position,
    )
    .into()
}