diff options
author | 2022-04-24 20:25:49 +0700 | |
---|---|---|
committer | 2022-04-24 20:25:49 +0700 | |
commit | 011b7d11126404eaeff1562e49d81693d4d852b2 (patch) | |
tree | d477c57a885f6e24c8e62e25c2bbb816dd703b63 /pure | |
parent | 5d67f9988c14adfca4a7e67dc7a9ddcd860b1c78 (diff) | |
download | iced-011b7d11126404eaeff1562e49d81693d4d852b2.tar.gz iced-011b7d11126404eaeff1562e49d81693d4d852b2.tar.bz2 iced-011b7d11126404eaeff1562e49d81693d4d852b2.zip |
Reuse `tooltip::Position` from `iced_native` in `iced_pure`
Diffstat (limited to 'pure')
-rw-r--r-- | pure/src/widget/tooltip.rs | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/pure/src/widget/tooltip.rs b/pure/src/widget/tooltip.rs index f0667e41..0155034b 100644 --- a/pure/src/widget/tooltip.rs +++ b/pure/src/widget/tooltip.rs @@ -2,15 +2,18 @@ use crate::widget::Tree; use crate::{Element, Widget}; use iced_native::event::{self, Event}; +use iced_native::layout; +use iced_native::mouse; +use iced_native::overlay; +use iced_native::renderer; +use iced_native::text; use iced_native::widget::container; -pub use iced_native::widget::Text; -use iced_native::{layout, mouse, overlay}; -use iced_native::{renderer, Size}; -use iced_native::{text, Vector}; +use iced_native::widget::Text; use iced_native::{ - Clipboard, Layout, Length, Padding, Point, Rectangle, Shell, + Clipboard, Layout, Length, Padding, Point, Rectangle, Shell, Size, Vector, }; +pub use iced_native::widget::tooltip::Position; pub use iced_style::container::{Style, StyleSheet}; /// An element to display a widget over another. @@ -85,21 +88,6 @@ where } } -/// The position of the tooltip. Defaults to following the cursor. -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum Position { - /// The tooltip will follow the cursor. - FollowCursor, - /// The tooltip will appear on the top of the widget. - Top, - /// The tooltip will appear on the bottom of the widget. - Bottom, - /// The tooltip will appear on the left of the widget. - Left, - /// The tooltip will appear on the right of the widget. - Right, -} - impl<'a, Message, Renderer> Widget<Message, Renderer> for Tooltip<'a, Message, Renderer> where |