cosmic::widget::tooltip

Type Alias Tooltip

source
pub type Tooltip<'a, Message> = Tooltip<'a, Message, Theme, Renderer>;

Aliased Type§

struct Tooltip<'a, Message> { /* private fields */ }

Implementations

source§

impl<'a, Message, Theme, Renderer> Tooltip<'a, Message, Theme, Renderer>
where Theme: Catalog, Renderer: Renderer,

source

pub fn new( content: impl Into<Element<'a, Message, Theme, Renderer>>, tooltip: impl Into<Element<'a, Message, Theme, Renderer>>, position: Position, ) -> Tooltip<'a, Message, Theme, Renderer>

Creates a new Tooltip.

source

pub fn gap( self, gap: impl Into<Pixels>, ) -> Tooltip<'a, Message, Theme, Renderer>

Sets the gap between the content and its Tooltip.

source

pub fn padding( self, padding: impl Into<Pixels>, ) -> Tooltip<'a, Message, Theme, Renderer>

Sets the padding of the Tooltip.

source

pub fn snap_within_viewport( self, snap: bool, ) -> Tooltip<'a, Message, Theme, Renderer>

Sets whether the Tooltip is snapped within the viewport.

source

pub fn style( self, style: impl Fn(&Theme) -> Style + 'a, ) -> Tooltip<'a, Message, Theme, Renderer>
where <Theme as Catalog>::Class<'a>: From<Box<dyn Fn(&Theme) -> Style + 'a>>,

Sets the style of the Tooltip.

source

pub fn class( self, class: impl Into<<Theme as Catalog>::Class<'a>>, ) -> Tooltip<'a, Message, Theme, Renderer>

Sets the style class of the Tooltip.

Trait Implementations

source§

impl<'a, Message, Theme, Renderer> Widget<Message, Theme, Renderer> for Tooltip<'a, Message, Theme, Renderer>
where Theme: Catalog, Renderer: Renderer,

source§

fn children(&self) -> Vec<Tree>

Returns the state Tree of the children of the Widget.
source§

fn state(&self) -> State

Returns the State of the Widget.
source§

fn tag(&self) -> Tag

Returns the Tag of the Widget.
source§

fn size(&self) -> Size<Length>

Returns the Size of the Widget in lengths.
source§

fn size_hint(&self) -> Size<Length>

Returns a Size hint for laying out the Widget. Read more
source§

fn diff(&mut self, tree: &mut Tree)

Reconciliates the Widget with the provided Tree.
source§

fn layout(&self, tree: &mut Tree, renderer: &Renderer, limits: &Limits) -> Node

Returns the layout::Node of the Widget. Read more
source§

fn on_event( &mut self, tree: &mut Tree, event: Event, layout: Layout<'_>, cursor: Cursor, renderer: &Renderer, clipboard: &mut dyn Clipboard, shell: &mut Shell<'_, Message>, viewport: &Rectangle, ) -> Status

Processes a runtime Event. Read more
source§

fn mouse_interaction( &self, tree: &Tree, layout: Layout<'_>, cursor: Cursor, viewport: &Rectangle, renderer: &Renderer, ) -> Interaction

Returns the current mouse::Interaction of the Widget. Read more
source§

fn draw( &self, tree: &Tree, renderer: &mut Renderer, theme: &Theme, inherited_style: &Style, layout: Layout<'_>, cursor: Cursor, viewport: &Rectangle, )

Draws the Widget using the associated Renderer.
source§

fn overlay<'b>( &'b mut self, tree: &'b mut Tree, layout: Layout<'_>, renderer: &Renderer, translation: Vector, ) -> Option<Element<'b, Message, Theme, Renderer>>

Returns the overlay of the Widget, if there is any.
source§

fn operate( &self, _state: &mut Tree, _layout: Layout<'_>, _renderer: &Renderer, _operation: &mut dyn Operation, )

Applies an Operation to the Widget.
source§

fn a11y_nodes( &self, _layout: Layout<'_>, _state: &Tree, _cursor: Cursor, ) -> A11yTree

get the a11y nodes for the widget and its children
source§

fn id(&self) -> Option<Id>

Returns the id of the widget
source§

fn set_id(&mut self, _id: Id)

Sets the id of the widget This may be called while diffing the widget tree
source§

fn drag_destinations( &self, _state: &Tree, _layout: Layout<'_>, _renderer: &Renderer, _dnd_rectangles: &mut DndDestinationRectangles, )

Adds the drag destination rectangles of the widget. Runs after the layout phase for each widget in the tree.