From 011b7d11126404eaeff1562e49d81693d4d852b2 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sun, 24 Apr 2022 20:25:49 +0700 Subject: Reuse `tooltip::Position` from `iced_native` in `iced_pure` --- pure/src/widget/tooltip.rs | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) (limited to 'pure') 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 for Tooltip<'a, Message, Renderer> where -- cgit