pub struct Tip(/* private fields */);
Expand description
W
A tooltip popup.
Can be set on the tooltip
property.
Properties§
Sourcepub hit_test_mode(mode: impl IntoVar<HitTestMode>);
pub hit_test_mode(mode: impl IntoVar<HitTestMode>);
If the tooltip can be interacted with the mouse.
This is disabled by default.
Properties from Popup§
Sourcepub focus_click_behavior(behavior: impl IntoVar<FocusClickBehavior>);
pub focus_click_behavior(behavior: impl IntoVar<FocusClickBehavior>);
Popup focus behavior when it or a descendant receives a click.
Is FocusClickBehavior::ExitEnabled
by default.
Sourcepub close_delay(delay: impl IntoVar<Duration>);
pub close_delay(delay: impl IntoVar<Duration>);
Delay awaited before actually closing when popup close is requested.
You can use this delay to await a closing animation for example. This property sets is_close_delaying
while awaiting the delay
.
Sourcepub is_close_delaying(state: impl IntoVar<bool>);
pub is_close_delaying(state: impl IntoVar<bool>);
If close was requested for this layered widget and it is just awaiting for the close_delay
.
Properties from Container§
Sourcepub clip_to_bounds(clip: impl IntoVar<bool>);
pub clip_to_bounds(clip: impl IntoVar<bool>);
Content overflow clipping.
Sourcepub child(child: impl UiNode);
pub child(child: impl UiNode);
The widget’s child.
Can be any type that implements UiNode
, any widget.
In Container!
derived widgets or similar this property is captured and used as the actual child, in other widgets
this property is an alias for child_under
.
Sourcepub padding(padding: impl IntoVar<SideOffsets>);
pub padding(padding: impl IntoVar<SideOffsets>);
Margin space around the content of a widget.
This property is margin
with nest group CHILD_LAYOUT
.
Sourcepub child_align(alignment: impl IntoVar<Align>);
pub child_align(alignment: impl IntoVar<Align>);
Aligns the widget content within the available space.
This property is align
with nest group CHILD_LAYOUT
.
Sourcepub child_insert(
&self,
placement: impl IntoVar<ChildInsert>,
node: impl UiNode,
spacing: impl IntoVar<Length>,
);
pub child_insert( &self, placement: impl IntoVar<ChildInsert>, node: impl UiNode, spacing: impl IntoVar<Length>, );
Insert node
in the placement
relative to the widget’s child.
This property disables inline layout for the widget.
Sourcepub child_out_insert(
&self,
placement: impl IntoVar<ChildInsert>,
node: impl UiNode,
spacing: impl IntoVar<Length>,
);
pub child_out_insert( &self, placement: impl IntoVar<ChildInsert>, node: impl UiNode, spacing: impl IntoVar<Length>, );
Insert node
in the placement
relative to the widget’s child, outside of the child layout.
This is still inside the parent widget, but outside of properties like padding.
This property disables inline layout for the widget.
Sourcepub child_left(node: impl UiNode, spacing: impl IntoVar<Length>);
pub child_left(node: impl UiNode, spacing: impl IntoVar<Length>);
Insert node
to the left of the widget’s child.
This property disables inline layout for the widget. See child_insert
for more details.
Sourcepub child_right(node: impl UiNode, spacing: impl IntoVar<Length>);
pub child_right(node: impl UiNode, spacing: impl IntoVar<Length>);
Insert node
to the right of the widget’s child.
This property disables inline layout for the widget. See child_insert
for more details.
Sourcepub child_top(node: impl UiNode, spacing: impl IntoVar<Length>);
pub child_top(node: impl UiNode, spacing: impl IntoVar<Length>);
Insert node
above the widget’s child.
This property disables inline layout for the widget. See child_insert
for more details.
Sourcepub child_bottom(node: impl UiNode, spacing: impl IntoVar<Length>);
pub child_bottom(node: impl UiNode, spacing: impl IntoVar<Length>);
Insert node
below the widget’s child.
This property disables inline layout for the widget. See child_insert
for more details.
Sourcepub child_start(node: impl UiNode, spacing: impl IntoVar<Length>);
pub child_start(node: impl UiNode, spacing: impl IntoVar<Length>);
Insert node
to the left of the widget’s child in LTR contexts or to the right in RTL contexts.
This property disables inline layout for the widget. See child_insert
for more details.
Sourcepub child_end(node: impl UiNode, spacing: impl IntoVar<Length>);
pub child_end(node: impl UiNode, spacing: impl IntoVar<Length>);
Insert node
to the right of the widget’s child in LTR contexts or to the right of the widget’s child in RTL contexts.
This property disables inline layout for the widget. See child_insert
for more details.
Sourcepub child_over(node: impl UiNode);
pub child_over(node: impl UiNode);
Insert node
over the widget’s child.
This property disables inline layout for the widget. See child_insert
for more details.
Sourcepub child_under(node: impl UiNode);
pub child_under(node: impl UiNode);
Insert node
under the widget’s child.
This property disables inline layout for the widget. See child_insert
for more details.
Sourcepub child_out_left(node: impl UiNode, spacing: impl IntoVar<Length>);
pub child_out_left(node: impl UiNode, spacing: impl IntoVar<Length>);
Insert node
to the left of the widget’s child, outside of the child layout.
This property disables inline layout for the widget. See child_out_insert
for more details.
Sourcepub child_out_right(node: impl UiNode, spacing: impl IntoVar<Length>);
pub child_out_right(node: impl UiNode, spacing: impl IntoVar<Length>);
Insert node
to the right of the widget’s child, outside of the child layout.
This property disables inline layout for the widget. See child_out_insert
for more details.
Sourcepub child_out_top(node: impl UiNode, spacing: impl IntoVar<Length>);
pub child_out_top(node: impl UiNode, spacing: impl IntoVar<Length>);
Insert node
above the widget’s child, outside of the child layout.
This property disables inline layout for the widget. See child_out_insert
for more details.
Sourcepub child_out_bottom(node: impl UiNode, spacing: impl IntoVar<Length>);
pub child_out_bottom(node: impl UiNode, spacing: impl IntoVar<Length>);
Insert node
below the widget’s child, outside of the child layout.
This property disables inline layout for the widget. See child_out_insert
for more details.
Sourcepub child_out_start(node: impl UiNode, spacing: impl IntoVar<Length>);
pub child_out_start(node: impl UiNode, spacing: impl IntoVar<Length>);
Insert node
to the left of the widget’s child in LTR contexts or to the right in RTL contexts, outside of the child layout.
This property disables inline layout for the widget. See child_out_insert
for more details.
Sourcepub child_out_end(node: impl UiNode, spacing: impl IntoVar<Length>);
pub child_out_end(node: impl UiNode, spacing: impl IntoVar<Length>);
Insert node
to the right of the widget’s child in LTR contexts or to the right of the widget’s child in RTL contexts, outside of the child layout.
This property disables inline layout for the widget. See child_out_insert
for more details.
Sourcepub child_out_over(node: impl UiNode);
pub child_out_over(node: impl UiNode);
Insert node
over the widget’s child, not affected by child layout.
This property disables inline layout for the widget. See child_out_insert
for more details.
Sourcepub child_out_under(node: impl UiNode);
pub child_out_under(node: impl UiNode);
Insert node
under the widget’s child, not affected by child layout.
This property disables inline layout for the widget. See child_out_insert
for more details.
Properties from WidgetBase§
Implementations§
Source§impl Tip
impl Tip
Sourcepub fn widget_new() -> Tip
pub fn widget_new() -> Tip
Start building a new instance.
Sourcepub fn widget_type() -> WidgetType
pub fn widget_type() -> WidgetType
Gets the widget type info.
Sourcepub fn focusable(&self, focusable: impl IntoVar<bool>)
pub fn focusable(&self, focusable: impl IntoVar<bool>)
P
Makes the widget focusable when set to true
.
Sourcepub fn is_focused(&self, state: impl IntoVar<bool>)
pub fn is_focused(&self, state: impl IntoVar<bool>)
P
If the widget has keyboard focus.
This is only true
if the widget itself is focused.
Use is_focus_within
to include focused widgets inside this one.
§Highlighting
This property is always true
when the widget has focus, independent of what device moved the focus,
usually when the keyboard is used a special visual indicator is rendered, a dotted line border is common,
this state is called highlighting and is tracked by the focus manager. To implement such a visual you can use the
is_focused_hgl
property.
§Return Focus
Usually widgets that have a visual state for this property also have one for is_return_focus
, a common example is the
text-input widget that shows an emphasized border and blinking cursor when focused and still shows the
emphasized border without cursor when a menu is open and it is only the return focus.
Sourcepub fn is_focus_within(&self, state: impl IntoVar<bool>)
pub fn is_focus_within(&self, state: impl IntoVar<bool>)
P
If the widget or one of its descendants has keyboard focus.
To check if only the widget has keyboard focus use is_focused
.
To track highlighted focus within use is_focus_within_hgl
property.
Sourcepub fn is_focused_hgl(&self, state: impl IntoVar<bool>)
pub fn is_focused_hgl(&self, state: impl IntoVar<bool>)
P
If the widget has keyboard focus and the user is using the keyboard to navigate.
This is only true
if the widget itself is focused and the focus was acquired by keyboard navigation.
You can use is_focus_within_hgl
to include widgets inside this one.
§Highlighting
Usually when the keyboard is used to move the focus a special visual indicator is rendered, a dotted line border is common,
this state is called highlighting and is tracked by the focus manager, this property is only true
.
Sourcepub fn is_focus_within_hgl(&self, state: impl IntoVar<bool>)
pub fn is_focus_within_hgl(&self, state: impl IntoVar<bool>)
P
If the widget or one of its descendants has keyboard focus and the user is using the keyboard to navigate.
To check if only the widget has keyboard focus use is_focused_hgl
.
Also see is_focus_within
to check if the widget has focus within regardless of highlighting.
Sourcepub fn is_return_focus(&self, state: impl IntoVar<bool>)
pub fn is_return_focus(&self, state: impl IntoVar<bool>)
P
If the widget will be focused when a parent scope is focused.
Focus scopes can remember the last focused widget inside, the focus returns to this widget when the scope receives focus. Alt scopes also remember the widget from which the alt focus happened and can also return focus back to that widget.
Usually input widgets that have a visual state for is_focused
also have a visual for this, a common example is the
text-input widget that shows an emphasized border and blinking cursor when focused and still shows the
emphasized border without cursor when a menu is open and it is only the return focus.
Note that a widget can be is_focused
and is_return_focus
, this property is true
if any focus scope considers the
widget its return focus, you probably want to declare the widget visual states in such a order that is_focused
overrides
the state of this property.
Sourcepub fn is_return_focus_within(&self, state: impl IntoVar<bool>)
pub fn is_return_focus_within(&self, state: impl IntoVar<bool>)
P
If the widget or one of its descendants will be focused when a focus scope is focused.
To check if only the widget is the return focus use is_return_focus
.
Sourcepub fn focus_on_init(&self, enabled: impl IntoVar<bool>)
pub fn focus_on_init(&self, enabled: impl IntoVar<bool>)
P
If the widget is focused on info init.
When the widget is inited and present in the info tree a FOCUS.focus_widget_or_related
request is made for the widget.
Sourcepub fn return_focus_on_deinit(&self, enabled: impl IntoVar<bool>)
pub fn return_focus_on_deinit(&self, enabled: impl IntoVar<bool>)
P
If the widget return focus to the previous focus when it inited.
This can be used with the modal
property to declare modal dialogs that return the focus
to the widget that opens the dialog.
Consider using focus_click_behavior
if the widget is also an ALT focus scope.
Sourcepub fn focus_highlight(
&self,
offsets: impl IntoVar<SideOffsets>,
widths: impl IntoVar<SideOffsets>,
sides: impl IntoVar<BorderSides>,
)
pub fn focus_highlight( &self, offsets: impl IntoVar<SideOffsets>, widths: impl IntoVar<SideOffsets>, sides: impl IntoVar<BorderSides>, )
P
Sets the foreground highlight values used when the widget is focused and highlighted.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Tip
impl !RefUnwindSafe for Tip
impl Send for Tip
impl !Sync for Tip
impl Unpin for Tip
impl !UnwindSafe for Tip
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more