pub struct Semantic<'a, Message, Theme, Renderer, R: RoleKind = AnyRole> { /* private fields */ }Expand description
An element with an annotation. Convert it into an Element to use it.
With the semantics feature on it is a widget that forwards everything to its content and
reports the annotation to the recorder. With the feature off, converting it gives back the
content itself.
Implementations§
Source§impl<'a, Message, Theme, Renderer, R: RoleKind> Semantic<'a, Message, Theme, Renderer, R>
impl<'a, Message, Theme, Renderer, R: RoleKind> Semantic<'a, Message, Theme, Renderer, R>
Sourcepub fn name(self, name: impl IntoFragment<'a>) -> Self
pub fn name(self, name: impl IntoFragment<'a>) -> Self
The accessible name.
Sourcepub fn description(self, text: impl IntoFragment<'a>) -> Self
pub fn description(self, text: impl IntoFragment<'a>) -> Self
A longer description.
Sourcepub fn tooltip(self, text: impl IntoFragment<'a>) -> Self
pub fn tooltip(self, text: impl IntoFragment<'a>) -> Self
The tooltip text, which names an otherwise unnamed node.
Sourcepub fn test_id(self, id: impl IntoTestId<'a>) -> Self
pub fn test_id(self, id: impl IntoTestId<'a>) -> Self
A test id, typed through TestId or a string built at run time.
Sourcepub fn kind(self, kind: &'static str) -> Self
pub fn kind(self, kind: &'static str) -> Self
What reported the node, for of_type and the inspector. "app" when unset.
Sourcepub fn component(self, kind: &'static str) -> Self
pub fn component(self, kind: &'static str) -> Self
Marks the annotation as a component library’s, such as "iced_cube::tree". App
annotations at the same bounds take precedence over it.
Sourcepub fn prop(self, key: &'static str, value: impl IntoFragment<'a>) -> Self
pub fn prop(self, key: &'static str, value: impl IntoFragment<'a>) -> Self
A free-form property, such as a tab’s unsaved.
Sourcepub fn click_clock(self, clock: ClickClock) -> Self
pub fn click_clock(self, clock: ClickClock) -> Self
Which clock counts multiple clicks.
Sourcepub fn caret_clock(self, clock: CaretClock) -> Self
pub fn caret_clock(self, clock: CaretClock) -> Self
Which clock blinks the caret.
Sourcepub fn current(self, on: bool) -> Self
pub fn current(self, on: bool) -> Self
The current item in a set, such as the open page in a sidebar.
The node is not shown, such as a hover-only control while the pointer is elsewhere.
Sourcepub fn position(self, index: u32, of: u32) -> Self
pub fn position(self, index: u32, of: u32) -> Self
The position in its set, counted from 1, and the size of the set.
Sourcepub fn labelled_by(self, key: impl Into<Key>) -> Self
pub fn labelled_by(self, key: impl Into<Key>) -> Self
The node whose name labels this one.
Sourcepub fn described_by(self, key: impl Into<Key>) -> Self
pub fn described_by(self, key: impl Into<Key>) -> Self
The node whose text describes this one.
Sourcepub fn controls(self, key: impl Into<Key>) -> Self
pub fn controls(self, key: impl Into<Key>) -> Self
The node this one controls, such as the panel a disclosure button opens.
Sourcepub fn owns(self, key: impl Into<Key>) -> Self
pub fn owns(self, key: impl Into<Key>) -> Self
A node that is this one’s logical child although it lives elsewhere, such as an overlay panel.
Sourcepub fn checked(self, state: impl Into<Checked>) -> Selfwhere
R: Checkable,
pub fn checked(self, state: impl Into<Checked>) -> Selfwhere
R: Checkable,
Checked, unchecked or mixed.
Sourcepub fn expanded(self, on: bool) -> Selfwhere
R: Expandable,
pub fn expanded(self, on: bool) -> Selfwhere
R: Expandable,
Whether the node’s content or popup is shown.
Sourcepub fn selected(self, on: bool) -> Selfwhere
R: SelectableItem,
pub fn selected(self, on: bool) -> Selfwhere
R: SelectableItem,
Whether the item is selected in its container.
Sourcepub fn level(self, level: u16) -> Selfwhere
R: Leveled,
pub fn level(self, level: u16) -> Selfwhere
R: Leveled,
The nesting level, from 1. A 0 is reported as a tree warning.
Sourcepub fn value(self, text: impl IntoFragment<'a>) -> Selfwhere
R: HasValue,
pub fn value(self, text: impl IntoFragment<'a>) -> Selfwhere
R: HasValue,
The value as text.
Sourcepub fn range(self, now: f64, range: RangeInclusive<f64>) -> Selfwhere
R: RangeValue,
pub fn range(self, now: f64, range: RangeInclusive<f64>) -> Selfwhere
R: RangeValue,
A numeric value within a range.
Sourcepub fn step(self, step: f64) -> Selfwhere
R: RangeValue,
pub fn step(self, step: f64) -> Selfwhere
R: RangeValue,
The distance between neighbouring values of the range, such as 1 for a slider over
whole steps. With it, set_value moves a focusable slider with the keyboard and lands
exactly on the value however its steps are placed along the track.
Sourcepub fn placeholder(self, text: impl IntoFragment<'a>) -> Selfwhere
R: Editable,
pub fn placeholder(self, text: impl IntoFragment<'a>) -> Selfwhere
R: Editable,
The placeholder shown while the value is empty.