pub struct Image { /* private fields */ }Expand description
An image, fitted by fit into whatever box it ends up with.
Implementations§
Source§impl Image
impl Image
Sourcepub fn new(image: ImageHandle) -> Self
pub fn new(image: ImageHandle) -> Self
An image at its own size, fitted with BoxFit::Contain by default.
Sourcepub fn memory(bytes: &'static [u8]) -> Self
pub fn memory(bytes: &'static [u8]) -> Self
An image decoded from embedded bytes — what include_bytes! gives, and the
answer to “how do I just show my logo”.
Image::memory(include_bytes!("../assets/logo.png")).width(96.0)The bytes are decoded once per process, not once per frame. A view is rebuilt
every frame and decoding a PNG is not free, so the result is kept in a shared
store keyed by where the bytes live — see frus_core::cached for why an
address is the right key and why the 'static bound is what makes it sound.
Failure paints nothing. A file that is not an image does not become one on the
next frame, so the failure is remembered rather than retried, and the widget
occupies whatever box it was given without drawing into it. That is the
reference’s behaviour for an image with no error widget supplied, and
Image::error is how an application asks what went wrong.
Decoded at the size shown: see Image::cache_width.
A large picture is decoded on a background thread, so the frame that first
shows it does not stop for the tens of milliseconds a photograph takes: until it is
there the image is State::Loading and shows its
placeholder, as a network image does, and the frames keep
coming. One of at most QUICK_DECODE_PIXELS — an icon, a logo, an avatar — is
decoded at once, since it takes less time than the thread would to pick it up and
a blink as it came in would be the only difference. The Web, which has no threads,
decodes every picture at once.
Needs the images feature, which is on by default. Without it this reports a
missing decoder rather than panicking — the same rule the bundled fonts follow.
Sourcepub fn network(url: impl AsRef<str>) -> Self
pub fn network(url: impl AsRef<str>) -> Self
An image fetched over the network, decoded and shown when it arrives.
Image::network("https://example.com/ada.png").width(240.0)The first frame that asks starts the request and reports State::Loading;
every later frame is a lookup. That is what makes this safe to write in a view,
which runs sixty times a second — a fetch per frame would be sixty requests for
one picture. The interface keeps drawing while anything is in flight, so the
frame that shows the picture does happen without the application arranging it.
There is no loading or error slot here, and that is the framework’s model
rather than a gap. A view is a function of state, and this state is readable:
Image::state answers, and the application writes the match it would have
written anyway.
let photo = Image::network(&url).width(240.0);
match photo.state() {
State::Loading => CircularProgressIndicator::new().boxed(),
State::Failed(why) => text(why).boxed(),
State::Ready => photo.boxed(),
}Size it before asking: the size is what it is fetched and decoded at, and one set after the question is a second request at the new size.
A closure stored in the widget would say the same thing in a place the application cannot see it, and would need the widget to carry the message type for the sake of a branch the view can already take.
The request starts the first time the image is asked about — laid out,
painted, or asked its state — since that is when the size to
decode it at is known (see Image::cache_width). An image built and dropped
without any of those fetches nothing.
Needs a registered fetcher — frus_core::set_image_fetcher — which the shell
installs on the way up when built with the net feature. Without one this fails
with a message saying so, rather than waiting for ever.
Sourcepub fn state(&self) -> State<'_>
pub fn state(&self) -> State<'_>
Where this image has got to: here, on its way, or never coming.
An embedded image is State::Loading only while a large one decodes on its
thread; Image::network is loading until its bytes are here and decoded.
Sourcepub fn error(&self) -> Option<&str>
pub fn error(&self) -> Option<&str>
Why there are no pixels, if there are none.
An application that wants to put something else in the gap — a placeholder, a
message, a retry — asks here and builds it itself. That is a match in the view
rather than a closure the widget stores, which is the honest shape while the
pixels are something the application already holds.
An image still loading has no error: it has not failed, it has not arrived.
Image::state is the one that tells the three apart.
Sourcepub fn handle(&self) -> Option<ImageHandle>
pub fn handle(&self) -> Option<ImageHandle>
The decoded pixels, once they are here: None while they are on their way or when
they will never come. This is how a picture loaded by Image::memory or
Image::network is painted by something other than an Image — a decoration, an
avatar — with the same loading and the same cache (milestone 647).
Sourcepub fn width(self, width: f32) -> Self
pub fn width(self, width: f32) -> Self
Sets the width, in logical pixels. With no height, the height follows from the image’s own ratio.
Sourcepub fn height(self, height: f32) -> Self
pub fn height(self, height: f32) -> Self
Sets the height, in logical pixels. With no width, the width follows from the image’s own ratio.
Sourcepub fn cache_width(self, pixels: u32) -> Self
pub fn cache_width(self, pixels: u32) -> Self
Decodes the picture this many physical pixels wide, whatever the file’s own
width; the height follows from the image’s own ratio unless
cache_height is given too, in which case the picture is
decoded at the smallest size, at its own ratio, that covers both. Never larger
than the file.
A twelve-megapixel photograph shown as a thumbnail does not need 48 MB of pixels, and on a phone a grid of them is how an application is killed for memory.
Without it, an image given a width or a
height is already decoded at that size times the screen’s
pixel ratio, rounded up a little; this is for one that is not — sized by its parent
— or one that wants a different size. An image given neither, and none of these,
is decoded at the file’s own size, which is also its own size on screen: setting
this on one changes the size it takes.
Only an image this widget decodes — Image::memory, Image::network — is
affected. One made with Image::new is the pixels the application gave it.
Sourcepub fn cache_height(self, pixels: u32) -> Self
pub fn cache_height(self, pixels: u32) -> Self
cache_width, for the height.
Sourcepub fn full_resolution(self) -> Self
pub fn full_resolution(self) -> Self
Decodes the file at its own size, however small the box: for a picture that is shown larger than its box says — under a zoom, a scale transform, a hero flight to a full-screen view — and must stay sharp there.
Sourcepub fn alignment(self, alignment: impl Into<AlignmentGeometry>) -> Self
pub fn alignment(self, alignment: impl Into<AlignmentGeometry>) -> Self
Where the image sits in a box it does not fill, and which part of it survives a box it overflows. Centre by default, as in the reference.
It is the same anchor either way round: aligning to the top means the top of the box for a letterboxed image and the top of the image for a cropped one, which is the answer a photograph of a person wants in both cases.
Sourcepub fn tint(self, tint: Color) -> Self
pub fn tint(self, tint: Color) -> Self
A multiplied tint, white leaving it unchanged — for bitmap icons, say.
Sourcepub fn opacity(self, opacity: f32) -> Self
pub fn opacity(self, opacity: f32) -> Self
Draws the image at a fraction of its opacity, 1.0 being fully opaque.
Unlike a group opacity this needs no layer: an image is one primitive, so the fade goes into the tint it is already multiplied by.
Sourcepub fn semantic_label(self, label: impl Into<String>) -> Self
pub fn semantic_label(self, label: impl Into<String>) -> Self
What a screen reader says instead of the picture.
A picture with no label is a picture nobody reading by ear can see, and until
this existed every image in every application was one: the vocabulary had
frus_core::Role::Image in it and nothing ever emitted it.
Say what the picture is, not that it is a picture — a reader is already told
the role. If it carries no meaning of its own, do not label it: reach for
exclude_from_semantics instead.
Sourcepub fn exclude_from_semantics(self, exclude: bool) -> Self
pub fn exclude_from_semantics(self, exclude: bool) -> Self
Leaves the image out of the tree a screen reader walks.
The right answer for decoration — a divider, a texture, a shape behind a
heading. Announcing those interrupts a reader with something that was never
meant to be read, and an empty label would still announce the role. This is the
reference’s excludeFromSemantics, and like it, it wins over any label given.
Sourcepub fn match_text_direction(self, match_direction: bool) -> Self
pub fn match_text_direction(self, match_direction: bool) -> Self
Mirrors the image horizontally when the reading direction is right-to-left.
Off by default, which is the reference’s default and the right one: an image is a picture rather than a run of text, and a photograph of a person does not want to be flipped because the interface is in Arabic. It is a per-image decision, so it is a per-image switch.
Turn it on for a picture that points: an arrow meaning forward, a speech bubble with a tail, a hand indicating the next step. Those follow the direction the reader’s eye travels, and in RTL that is the other way round.
Sourcepub fn placeholder(self, placeholder: impl Into<ImagePlaceholder>) -> Self
pub fn placeholder(self, placeholder: impl Into<ImagePlaceholder>) -> Self
What stands in while the pixels are on their way, and what the picture crosses over when they arrive.
Takes a colour, a Skeleton, or another Image — see ImagePlaceholder. Without
one the box stays empty and the picture appears in a single frame, which is what an
image has always done here and what a list of thumbnails should not do.
Image::network(url).width(120.0).placeholder(Skeleton::new().height(90.0))Sourcepub fn fade_duration(self, seconds: f32) -> Self
pub fn fade_duration(self, seconds: f32) -> Self
How long the crossing takes, in seconds. IMAGE_FADE — the reference’s 700 ms —
unless a caller says otherwise. 0.0 is a hard cut with a placeholder before it.
Sourcepub fn fade_curve(self, curve: Curve) -> Self
pub fn fade_curve(self, curve: Curve) -> Self
The crossing’s curve; Curve::ease_out by
default, so the picture arrives quickly and settles.
Trait Implementations§
Source§impl From<Image> for ImagePlaceholder
impl From<Image> for ImagePlaceholder
Source§impl<Msg> Widget<Msg> for Image
impl<Msg> Widget<Msg> for Image
Source§fn anim_target(&self) -> Option<f32>
fn anim_target(&self) -> Option<f32>
Where the crossing is going: all the way over once the pixels are here, and nowhere at all until then.
Only claimed when there is a placeholder, so an image without one costs the runtime nothing and keeps the behaviour it has always had.
Source§fn anim_duration(&self) -> f32
fn anim_duration(&self) -> f32
The crossing has a duration in one direction only.
Coming in it takes its time: that is the whole point. Going back — a source replaced at the same place in the tree, so the widget is loading again — it is instant, because there is nothing left to cross from. The pixels of the picture that was there are already gone by the time this is asked; tweening down would fade the placeholder in over three quarters of a second while nothing else was drawn, which reads as a stall rather than as a change.
This is also what answers do not restart on a rebuild. The value lives against the widget’s place in the tree and survives every rebuild, so nothing restarts while the source stands still; and a source that changes passes through not ready, which resets it to nought in one frame and lets the next arrival cross properly. No record of which image this timeline is about is needed, because the journey through the middle is the record.
Source§fn paint(&self, bounds: Rect, status: Status, theme: &Theme, scene: &mut Scene)
fn paint(&self, bounds: Rect, status: Status, theme: &Theme, scene: &mut Scene)
Source§fn anim_curve(&self) -> Curve
fn anim_curve(&self) -> Curve
anim_target).
Default: linear.Source§fn semantics(&self) -> Option<SemanticsProperties>
fn semantics(&self) -> Option<SemanticsProperties>
None =
no semantics of its own (a layout container — its children, though,
may have some). See frus_core::SemanticsProperties.Source§fn opaque(&self) -> bool
fn opaque(&self) -> bool
Source§fn key(&self) -> Option<u64>
fn key(&self) -> Option<u64>
None = positional identity. See crate::Keyed.Source§fn debug_name(&self) -> &'static str
fn debug_name(&self) -> &'static str
Box, crate::Keyed…) delegate
to their content.Source§fn describes(&self) -> Option<Description>
fn describes(&self) -> Option<Description>
crate::Semantics wrapper, and nothing else
so far. Read moreSource§fn on_edit(&self, _edit: &mut Edit, _key: &Key) -> Option<Msg>
fn on_edit(&self, _edit: &mut Edit, _key: &Key) -> Option<Msg>
Source§fn positional_click(
&self,
_local_x: f32,
_local_y: f32,
_width: f32,
_height: f32,
) -> Option<Msg>
fn positional_click( &self, _local_x: f32, _local_y: f32, _width: f32, _height: f32, ) -> Option<Msg>
width × height box), taking
priority over on_click. For clickable sub-regions — e.g. the
suffix icon of a crate::TextField (clear / reveal) or a chart point
(milestone 221). None (the default) = no sub-region; the shell falls back to on_click.Source§fn cursor_icon(
&self,
_local_x: f32,
_local_y: f32,
_width: f32,
_height: f32,
) -> Option<Cursor>
fn cursor_icon( &self, _local_x: f32, _local_y: f32, _width: f32, _height: f32, ) -> Option<Cursor>
(local_x, local_y) inside
the widget’s width × height box (milestone 205): Some(Cursor::Pointer) over a clickable
sub-region (a suffix icon…), None (the default) = no opinion, the shell keeps the default
cursor. Does not affect clicking; this is purely the pointer’s appearance on hover.Source§fn cursor_at(
&self,
_local_x: f32,
_local_y: f32,
_width: f32,
_scroll_cursor: usize,
) -> Option<usize>
fn cursor_at( &self, _local_x: f32, _local_y: f32, _width: f32, _scroll_cursor: usize, ) -> Option<usize>
local_y picks the line in a
multi-line field (ignored on a single line). Read moreSource§fn text_metrics(
&self,
_width: f32,
_cursor: usize,
) -> Option<(f32, f32, f32, f32)>
fn text_metrics( &self, _width: f32, _cursor: usize, ) -> Option<(f32, f32, f32, f32)>
(content height, visible box height, caret top, caret height), in content
space (px). The shell uses them to register the scrollable region and to keep
the caret in view. None otherwise.Source§fn text_viewport(&self, _rect: Rect) -> Option<Rect>
fn text_viewport(&self, _rect: Rect) -> Option<Rect>
rect — the area where
the text scrolls, below the label. Used to place the scrollbar and the
scrollable region exactly on the box. None otherwise.Source§fn caret_vertical(
&self,
_width: f32,
_cursor: usize,
_down: bool,
_page: bool,
_goal_x: Option<f32>,
) -> Option<(usize, f32)>
fn caret_vertical( &self, _width: f32, _cursor: usize, _down: bool, _page: bool, _goal_x: Option<f32>, ) -> Option<(usize, f32)>
(new index, visual column used). Read moreSource§fn selected_text(&self, _edit: &Edit) -> Option<String>
fn selected_text(&self, _edit: &Edit) -> Option<String>
Source§fn text_value(&self) -> Option<&str>
fn text_value(&self) -> Option<&str>
None otherwise.Source§fn selection_text(&self) -> Option<&str>
fn selection_text(&self) -> Option<&str>
SelectionArea: a Text, and nothing that is
not made of words. The walk registers such a widget as a text stop when it is inside an
area, so that a selection can begin, end and pass through it.Source§fn selection_hit(
&self,
_local_x: f32,
_local_y: f32,
_width: f32,
) -> Option<usize>
fn selection_hit( &self, _local_x: f32, _local_y: f32, _width: f32, ) -> Option<usize>
selection_text nearest a local
position (px from the widget’s top-left corner) in a box width wide — the layout the
widget was drawn with, which is what a press is hit against.Source§fn selection_grip(
&self,
_width: f32,
_index: usize,
_start: bool,
) -> Option<SelectionHandle>
fn selection_grip( &self, _width: f32, _index: usize, _start: bool, ) -> Option<SelectionHandle>
index of this widget’s words — the
start handle when start, the end handle otherwise — in local coordinates, for a widget
width wide: where it is painted, and so where a finger takes it. None for anything
that is not a text.Source§fn area_toolbar(
&self,
_context: ToolbarContext,
) -> Option<Option<&dyn Widget<Msg>>>
fn area_toolbar( &self, _context: ToolbarContext, ) -> Option<Option<&dyn Widget<Msg>>>
SelectionArea offers over its selection, for
context, when the application has said what it holds
(SelectionArea::selection_toolbar): Some
of the bar, or Some(None) for no bar at all. None for anything else — and for an area
that was told nothing — whose texts then offer Copy and Select all.Source§fn region_toolbar(
&self,
_context: ToolbarContext,
_width: f32,
_range: (usize, usize),
) -> Option<(Rect, &dyn Widget<Msg>)>
fn region_toolbar( &self, _context: ToolbarContext, _width: f32, _range: (usize, usize), ) -> Option<(Rect, &dyn Widget<Msg>)>
range, in characters — for context, and the box it is placed against in local
coordinates, for a widget width wide. None for anything that is not a text, or when
the list for context is empty.Source§fn takes_typing(&self) -> bool
fn takes_typing(&self) -> bool
read_only one, a Text made
selectable — answers false: it has a caret and a
selection, and no use for a keyboard sliding up over the words being read. Read moreSource§fn replace_value(&self, _value: String) -> Option<Msg>
fn replace_value(&self, _value: String) -> Option<Msg>
value in this field: the one typing would have produced,
for a value the framework restores rather than the user typing it. Read moreSource§fn word_at(&self, _index: usize) -> Option<(usize, usize)>
fn word_at(&self, _index: usize) -> Option<(usize, usize)>
(start, end) of the word around the given index (for double-click).Source§fn selection_handles(
&self,
_width: f32,
_edit: &Edit,
_scroll_y: f32,
) -> Option<[SelectionHandle; 2]>
fn selection_handles( &self, _width: f32, _edit: &Edit, _scroll_y: f32, ) -> Option<[SelectionHandle; 2]>
edit, start then end, for a field width
wide whose content is scrolled down by scroll_y — where they are painted, and
so where a finger takes them. None when there is no selection, or this is not
a text field.Source§fn selection_toolbar(
&self,
_context: ToolbarContext,
) -> Option<&dyn Widget<Msg>>
fn selection_toolbar( &self, _context: ToolbarContext, ) -> Option<&dyn Widget<Msg>>
crate::ToolbarItem) for context, or None when there is none to show: this is
not a text field, or the application’s list for that context is empty. Read moreSource§fn selection_anchor(
&self,
_width: f32,
_edit: &Edit,
_scroll_y: f32,
) -> Option<Rect>
fn selection_anchor( &self, _width: f32, _edit: &Edit, _scroll_y: f32, ) -> Option<Rect>
selection_handles it is the paint’s own geometry.Source§fn edit_action(&self) -> Option<EditAction>
fn edit_action(&self) -> Option<EditAction>
crate::EditAction).Source§fn shortcut_bindings(&self) -> &[(KeyStroke, Intent)]
fn shortcut_bindings(&self) -> &[(KeyStroke, Intent)]
crate::Shortcuts.Source§fn shortcut_callbacks(&self) -> &[(KeyStroke, Msg)]
fn shortcut_callbacks(&self) -> &[(KeyStroke, Msg)]
crate::CallbackShortcuts.Source§fn action_bindings(&self) -> &[(Intent, Msg)]
fn action_bindings(&self) -> &[(Intent, Msg)]
crate::Actions.Source§fn action_listeners(&self) -> &[(Intent, Msg)]
fn action_listeners(&self) -> &[(Intent, Msg)]
crate::ActionListener.Source§fn on_keystroke(&self) -> Option<Rc<dyn Fn(KeyStroke) -> Option<Msg>>>
fn on_keystroke(&self) -> Option<Rc<dyn Fn(KeyStroke) -> Option<Msg>>>
crate::KeyboardListener. None (the default) is not a listener.Source§fn on_focus_change(&self, _focused: bool) -> Option<Msg>
fn on_focus_change(&self, _focused: bool) -> Option<Msg>
onFocusChange: true when the focused widget is now this
one or inside it and was not, false the other way. The shell asks once a frame,
after the focus has moved, every widget on the two paths from the root that the move
changed, the one that lost it first.Source§fn on_tap_outside(&self) -> Option<Msg>
fn on_tap_outside(&self) -> Option<Msg>
onTapOutside: sent before the press moves the focus.Source§fn autofocus(&self) -> bool
fn autofocus(&self) -> bool
true, a focusable widget takes the focus when it appears: a menu’s first
row when the menu opens, a field on a screen made to type into (milestone 605). Where
the focus came from is remembered, and it goes back there when this one goes.Source§fn descendants_focusable(&self) -> bool
fn descendants_focusable(&self) -> bool
false, nothing inside this subtree can take focus — the reference’s
ExcludeFocus. A dimmed panel behind a sheet is still drawn and still measured;
it simply stops being somewhere Tab can land.Source§fn focus_skip_traversal(&self) -> bool
fn focus_skip_traversal(&self) -> bool
true, this subtree’s focus stops are skipped by Tab while remaining
focusable by a click — the reference’s ExcludeFocusTraversal. The two are
separate questions: a toolbar button may be reachable with the pointer and still
not belong in the keyboard’s order.Source§fn focus_order(&self) -> Option<f32>
fn focus_order(&self) -> Option<f32>
NumericFocusOrder. None leaves them in tree order, which is where
everything sits until someone says otherwise.Source§fn focus_group(&self) -> bool
fn focus_group(&self) -> bool
true, this subtree is a traversal group: an order set inside it is
resolved among its own members and nowhere else, so a reordered dialog does not
reshuffle the page behind it.Source§fn autofill_hints(&self) -> &[AutofillHint]
fn autofill_hints(&self) -> &[AutofillHint]
AutofillHint. Empty (the default) is a field that takes
no part in autofill at all. Read moreSource§fn autofill_group(&self) -> bool
fn autofill_group(&self) -> bool
true, this subtree’s fields are one form — the reference’s
AutofillGroup. A service shown a password with no username beside it has
nothing to save the pair under.Source§fn draws_own_focus(&self) -> bool
fn draws_own_focus(&self) -> bool
true, the widget draws its focus indicator itself (the driver then
does not stroke the generic ring). E.g. TextField.Source§fn draggable(&self) -> bool
fn draggable(&self) -> bool
true, the widget responds to pointer dragging (sliders, handles).Source§fn drag_track(&self) -> DragTrack
fn drag_track(&self) -> DragTrack
draggable widget its drag lands (milestone
648): how far in from each end the travel starts, and whether it runs from the
right in a right-to-left reading direction. The fraction on_drag
and its edges are given is measured along that travel. The default is the whole
width, left to right.Source§fn on_thumb_drag(
&self,
_thumb: usize,
_moment: ThumbDrag,
_fraction: f32,
) -> Option<Msg>
fn on_thumb_drag( &self, _thumb: usize, _moment: ThumbDrag, _fraction: f32, ) -> Option<Msg>
DragMode::Thumbs track: thumb is the one the press picked, 0 for the start,
and fraction the pointer’s place along the travel. A press that has picked none
yet sends nothing.Source§fn on_drag(&self, _fraction: f32) -> Option<Msg>
fn on_drag(&self, _fraction: f32) -> Option<Msg>
fraction being the relative horizontal
position (0.0..=1.0) within the widget’s bounds.Source§fn on_drag_start(&self, _fraction: f32) -> Option<Msg>
fn on_drag_start(&self, _fraction: f32) -> Option<Msg>
Source§fn on_drag_end(&self, _fraction: f32) -> Option<Msg>
fn on_drag_end(&self, _fraction: f32) -> Option<Msg>
Source§fn on_drag_delta(&self, _dx: f32) -> Option<Msg>
fn on_drag_delta(&self, _dx: f32) -> Option<Msg>
dx is the
movement (logical px) since the last event. For handles that accumulate
(column resizing), unlike on_drag (an absolute fraction,
e.g. a slider). The shell tries it before on_drag; a widget implements
only one of the two.Source§fn hero_tag(&self) -> Option<u64>
fn hero_tag(&self) -> Option<u64>
crate::Hero.Source§fn drag_payload(&self) -> Option<u64>
fn drag_payload(&self) -> Option<u64>
crate::Draggable.Source§fn drag_needs_long_press(&self) -> bool
fn drag_needs_long_press(&self) -> bool
Source§fn drag_ghost_opacity(&self) -> f32
fn drag_ghost_opacity(&self) -> f32
Source§fn on_dropped(&self, _accepted: bool) -> Option<Msg>
fn on_dropped(&self, _accepted: bool) -> Option<Msg>
true if a target took it.Source§fn drop_zone(&self) -> bool
fn drop_zone(&self) -> bool
crate::DragTarget.Source§fn accepts_drag(&self, _payload: u64) -> bool
fn accepts_drag(&self, _payload: u64) -> bool
payload? Only asked of a drop target.Source§fn on_drop(&self, _payload: u64) -> Option<Msg>
fn on_drop(&self, _payload: u64) -> Option<Msg>
Source§fn accepts_files(&self, _paths: &[PathBuf]) -> bool
fn accepts_files(&self, _paths: &[PathBuf]) -> bool
crate::DragTarget::on_files.Source§fn on_files_dropped(&self, _paths: Vec<PathBuf>) -> Option<Msg>
fn on_files_dropped(&self, _paths: Vec<PathBuf>) -> Option<Msg>
Source§fn reorder_index(&self) -> Option<usize>
fn reorder_index(&self) -> Option<usize>
Source§fn on_reorder(&self, _to: usize) -> Option<Msg>
fn on_reorder(&self, _to: usize) -> Option<Msg>
to.
The widget knows its own index and the on_reorder(from, to) callback.Source§fn reorder_axis(&self) -> ReorderAxis
fn reorder_axis(&self) -> ReorderAxis
ReorderAxis::Horizontal): the shell
orients the drag preview (ghost + insertion indicator) accordingly. Kanban cards
return ReorderAxis::Vertical.Source§fn reorder_inserts(&self) -> bool
fn reorder_inserts(&self) -> bool
false by default, which is the table. Read moreSource§fn reorder_draggable(&self) -> bool
fn reorder_draggable(&self) -> bool
true by default for every
reorderable. A target-only slot — the drop zone at the end of a Kanban column —
returns false: a card can be dropped there, not lifted from it (otherwise the
drag would raise an empty ghost that moves nothing).Source§fn reorder_droppable(&self) -> bool
fn reorder_droppable(&self) -> bool
true by default, and the mirror image of
reorder_draggable: a source-only grip — a list row’s
drag handle — returns false. Read moreSource§fn reorder_announcement(&self, _to: usize) -> Option<String>
fn reorder_announcement(&self, _to: usize) -> Option<String>
to — the
spoken counterpart of the ghost, for someone who cannot see it land. Read moreSource§fn announce(&self) -> Option<String>
fn announce(&self) -> Option<String>
None = nothing to announce
(the default).Source§fn stack(&self) -> bool
fn stack(&self) -> bool
true, the widget is a stack: its children are superimposed layers
(the same box), rendered in order (the last one on top).Source§fn sticky_header(&self) -> bool
fn sticky_header(&self) -> bool
true, the widget is a section with a sticky header
(crate::StickyHeader): its first child is painted, and takes taps, at the top of
what is visible of the section, over the second (milestone 602).Source§fn custom_layout(&self) -> Option<CustomLayout<'_>>
fn custom_layout(&self) -> Option<CustomLayout<'_>>
crate::CustomMultiChildLayout — the function and one key per child. The children
are then laid out and placed in the walk, by the function, and not in this node’s
layout (milestone 601).Source§fn continuous(&self) -> bool
fn continuous(&self) -> bool
true, the widget animates continuously (driven by time, not by a
target): the framework keeps redrawing. E.g. CircularProgressIndicator.Source§fn repaint_boundary(&self) -> bool
fn repaint_boundary(&self) -> bool
true, this widget is a repaint boundary: its subtree is cached
(primitives + interaction maps) and reused as is as long as its geometry
and the interaction state of its descendants do not change — a widget
animating elsewhere no longer forces it to repaint.
See crate::Container::repaint_boundary and paintcache.rs.Source§fn scroll_content(&self) -> Option<&dyn Widget<Msg>>
fn scroll_content(&self) -> Option<&dyn Widget<Msg>>
Source§fn virtual_list(&self, _viewport: Size) -> Option<VirtualList<'_, Msg>>
fn virtual_list(&self, _viewport: Size) -> Option<VirtualList<'_, Msg>>
Source§fn page_view(&self) -> Option<PagedView<'_, Msg>>
fn page_view(&self) -> Option<PagedView<'_, Msg>>
Source§fn on_page_changed(&self, _page: usize) -> Option<Msg>
fn on_page_changed(&self, _page: usize) -> Option<Msg>
Source§fn on_scroll(&self, _position: ScrollPosition) -> Option<Msg>
fn on_scroll(&self, _position: ScrollPosition) -> Option<Msg>
crate::ScrollPosition. Read moreSource§fn scroll_grain(&self) -> f32
fn scroll_grain(&self) -> f32
0 — the
default — reports every change. Read moreSource§fn intrinsic(&self) -> Option<(IntrinsicAxis, Option<f32>)>
fn intrinsic(&self) -> Option<(IntrinsicAxis, Option<f32>)>
crate::Intrinsic.Source§fn overflow_box(&self) -> Option<Overflow>
fn overflow_box(&self) -> Option<Overflow>
crate::OverflowBox.Source§fn constraints_transform(&self) -> Option<ConstraintsTransform>
fn constraints_transform(&self) -> Option<ConstraintsTransform>
None — the default — means the child shares this node’s layout, as
everything ordinary does. See crate::ConstraintsTransformBox.Source§fn animated_size(&self) -> Option<SizeAnimation>
fn animated_size(&self) -> Option<SizeAnimation>
constraints_transform makes
follows its child’s size over time rather than at once, how (milestone 594). See
crate::AnimatedSize.Source§fn size_factor(&self) -> Option<(f32, f32)>
fn size_factor(&self) -> Option<(f32, f32)>
constraints_transform makes
is a multiple of its child’s size — (across, down), 1 for as big as the child
— the multiples (milestones 596 and 597). See crate::SizeTransition and
crate::Aligned::width_factor.Source§fn clips_to_box(&self) -> bool
fn clips_to_box(&self) -> bool
constraints_transform
makes cuts its child to itself. A reveal does; an anchor with a factor lets its
child spill (milestone 597).Source§fn layout_builder(&self) -> Option<&dyn Fn(Size) -> Box<dyn Widget<Msg>>>
fn layout_builder(&self) -> Option<&dyn Fn(Size) -> Box<dyn Widget<Msg>>>
size → widget factory. The content is built on the fly: no retained state
and no overlay (like a virtualised list item).Source§fn scroll_overlay(&self) -> Option<&OverlayBuilder<Msg>>
fn scroll_overlay(&self) -> Option<&OverlayBuilder<Msg>>
offset → overlay factory. See crate::ScrollOverlay. Read moreSource§fn scroll_axis(&self) -> Axis
fn scroll_axis(&self) -> Axis
Source§fn scroll_physics(&self) -> Option<ScrollPhysics>
fn scroll_physics(&self) -> Option<ScrollPhysics>
None — the usual answer — leaves the choice to
the application, which defaults to what the platform does.Source§fn scrollbars(&self) -> Option<Scrollbars>
fn scrollbars(&self) -> Option<Scrollbars>
None — the default — follows the application, which follows
the platform. See crate::Scrollbars.Source§fn thumb_visibility(&self) -> Option<bool>
fn thumb_visibility(&self) -> Option<bool>
scrollbar.dart:214). Read moreSource§fn ime(&self) -> Ime
fn ime(&self) -> Ime
Source§fn overlay(&self) -> Option<(&dyn Widget<Msg>, Placement)>
fn overlay(&self) -> Option<(&dyn Widget<Msg>, Placement)>
Source§fn overlay_dismiss(&self) -> Option<Msg>
fn overlay_dismiss(&self) -> Option<Msg>
Source§fn overlay_scrim(&self, _theme: &Theme) -> Option<Color>
fn overlay_scrim(&self, _theme: &Theme) -> Option<Color>
None — the usual answer — leaves it to the scheme’s scrim
role at the framework’s own opacity. Read moreSource§fn overlay_traps_focus(&self) -> bool
fn overlay_traps_focus(&self) -> bool
true, this widget’s anchored overlay (a menu…) traps focus: Tab and the
arrow keys cycle within its focusables while it is open (the keyboard pattern of menus).
Modal (scrimmed) overlays already trap by default; a tooltip or an autocomplete list
(focus stays on the field) do not. Default: false.Source§fn anim_transform(&self) -> Option<TransformValues>
fn anim_transform(&self) -> Option<TransformValues>
Transform::animated): the runtime
tweens the scales and the turn through anim_duration/anim_curve and hands the
interpolated value back through Runtime::anim_transform, which the paint walk
reads in place of the static transform_scale/transform_rotate. None = the
transform does not move. Read moreSource§fn anim_initial(&self) -> Option<f32>
fn anim_initial(&self) -> Option<f32>
None, the default: at
its target, with no transition, so a switch shown on is simply on. A widget that
plays something from its start when it appears — an animation — says Some(0.0),
and the value travels to its target in anim_duration from the first frame
(milestone 691).Source§fn opacity_group(&self) -> Option<f32>
fn opacity_group(&self) -> Option<f32>
[0,1]
applied to its whole subtree as one: the paint walk wraps its primitives
in a composited layer at that opacity — no double-blending where they
overlap. None = not a group. Combined with anim_target, the opacity
animates (a group fade).Source§fn anim_color(&self) -> Option<Color>
fn anim_color(&self) -> Option<Color>
Container::animated_color): the runtime tweens it (through
anim_duration/anim_curve) and hands the interpolated value back in
Status::anim_color. None = no animated colour.Source§fn anim_size(&self) -> Option<Size>
fn anim_size(&self) -> Option<Size>
Container::animated_size): the runtime
tweens it (through anim_duration/anim_curve) and the interpolated size is
injected at layout (see effective_style). None = fixed size.Source§fn anim_radius(&self) -> Option<BorderRadius>
fn anim_radius(&self) -> Option<BorderRadius>
Container::animated_radius):
the runtime tweens it and hands the interpolated value back in
Status::anim_radius. None = fixed radius.Source§fn anim_padding(&self) -> Option<Insets>
fn anim_padding(&self) -> Option<Insets>
Container::animated_padding):
the runtime tweens it and the interpolated padding is injected at layout
(see effective_style). None = fixed padding.Source§fn anim_offset(&self) -> Option<(f32, f32)>
fn anim_offset(&self) -> Option<(f32, f32)>
None — the default — leaves the rule
reading the widget’s own numbers. Read moreSource§fn anim_pins(&self) -> Option<Positioning>
fn anim_pins(&self) -> Option<Positioning>
crate::AnimatedPositioned): the
runtime tweens them and the interpolated pins are read where the stack lays its
layers out. None — the default — leaves Widget::positioned alone. Read moreSource§fn anim_fractions(&self) -> Option<(Option<f32>, Option<f32>)>
fn anim_fractions(&self) -> Option<(Option<f32>, Option<f32>)>
FractionallySizedBox::animated), as (width factor, height factor): the
runtime tweens them and the interpolated pair is injected at layout (see
effective_style), like the size and the padding. None = fixed factors. Read moreSource§fn anim_text_style(&self) -> Option<TextStyle>
fn anim_text_style(&self) -> Option<TextStyle>
AnimatedDefaultTextStyle). None = the subtree inherits whatever it inherits. Read moreSource§fn alignment_geometry(&self) -> Option<AlignmentGeometry>
fn alignment_geometry(&self) -> Option<AlignmentGeometry>
frus_core::AlignmentGeometry). Being continuous, a Tween<Alignment>
read in view() slides the child. None = default flex placement.Source§fn transform_translate(&self) -> Option<(f32, f32)>
fn transform_translate(&self) -> Option<(f32, f32)>
(dx, dy) applied to the widget’s whole subtree: the render
and the hit-test are offset without touching layout (siblings do not move,
the child may overflow its box). Continuous → a Tween read in view() slides
the subtree. None = no offset. See crate::Transform.Source§fn translate_fraction(&self) -> Option<(f32, f32)>
fn translate_fraction(&self) -> Option<(f32, f32)>
(fx, fy): (0.5, 0.0)
slides the subtree half its own width to the right. Added to
Widget::transform_translate, and offsetting the render and the hit-test the
same way, without touching layout. None = no offset. Read moreSource§fn transform_scale(&self) -> Option<(f32, f32, Alignment)>
fn transform_scale(&self) -> Option<(f32, f32, Alignment)>
(sx, sy, pivot) of the whole subtree: the render and the
hit-test are scaled — per axis — around the pivot (a
frus_core::Alignment within the box), without touching layout. Stays
axis-aligned (a scaled rect is still a rect). None = no scaling.
See crate::Transform.Source§fn transform_rotate(&self) -> Option<(f32, Alignment)>
fn transform_rotate(&self) -> Option<(f32, Alignment)>
(angle, pivot) of the whole subtree: the subtree is
painted rotated by angle radians (clockwise) around the pivot (a
frus_core::Alignment within the box), without touching layout. The
render goes through a rotated composited layer; the hit-test counter-rotates
the point. None = no rotation. See crate::Transform.Source§fn clip_shape(&self) -> Option<ClipShape>
fn clip_shape(&self) -> Option<ClipShape>
frus_core::ClipShape (rounded corners, ellipse)
modulates the alpha — whatever falls outside the shape is erased, edges
antialiased. None = no shape clip. See crate::ClipRRect,
crate::ClipOval.Source§fn style_themed(&self, _theme: &Theme) -> Style
fn style_themed(&self, _theme: &Theme) -> Style
caller ?? theme ?? framework chain. Read moreSource§fn theme_override(&self, _inherited: &Theme) -> Option<Box<Theme>>
fn theme_override(&self, _inherited: &Theme) -> Option<Box<Theme>>
None — the default — means “whatever came down from above”, which is
what every widget but crate::Themed answers. Read moreSource§fn media_override(&self, _inherited: MediaQuery) -> Option<MediaQuery>
fn media_override(&self, _inherited: MediaQuery) -> Option<MediaQuery>
None — the default — means “whatever came down from above”, which is
what every widget but MediaScope answers. Read moreSource§fn scaffold_override(&self) -> Option<ScaffoldInfo>
fn scaffold_override(&self) -> Option<ScaffoldInfo>
Source§fn scroll_behavior_override(&self) -> Option<ScrollBehavior>
fn scroll_behavior_override(&self) -> Option<ScrollBehavior>
ScrollBehavior this widget puts in force for its
subtree, or None — the default — for whatever came down from above. Only
ScrollConfiguration answers otherwise. Applied by
the same four walks as Self::scaffold_override: the scrollables under it record
what it decides when they are registered (milestone 616).Source§fn build_themed(&self, _theme: &Theme)
fn build_themed(&self, _theme: &Theme)
ThemeBuilder. Does nothing by
default, which is what all but a handful of widgets want. Read moreSource§fn build_in(&self, _id: WidgetId, _runtime: &Runtime, theme: &Theme)
fn build_in(&self, _id: WidgetId, _runtime: &Runtime, theme: &Theme)
Self::build_themed, for the few widgets that also need who they are and
what the frame remembers to compose their subtree. An
AnimatedSwitcher keeps what it is letting go of in the
runtime, under its own identity, and that is reachable nowhere else before its
children are read. Read moreSource§fn expand(&self, _id: WidgetId, _runtime: &Runtime, _theme: &Theme)
fn expand(&self, _id: WidgetId, _runtime: &Runtime, _theme: &Theme)
Source§fn switches(&self) -> bool
fn switches(&self) -> bool
AnimatedSwitcher. An identity
is a position, so a switcher and the widget that comes to stand where it stood have
the same one: this is how the runtime tells the switcher still being there from its
having gone, and forgets what it kept for it.Source§fn system_ui_style(&self) -> Option<SystemUiOverlayStyle>
fn system_ui_style(&self) -> Option<SystemUiOverlayStyle>
AnnotatedRegion. None for every widget but that one; a
transparent wrapper forwards it, or a keyed region would say nothing.Source§fn ink(&self, _theme: &Theme) -> Option<InkStyle>
fn ink(&self, _theme: &Theme) -> Option<InkStyle>
None = no ink, which is the default: a
widget has to ask. Read moreSource§fn foreground(&self, _theme: &Theme) -> Option<BoxDecoration>
fn foreground(&self, _theme: &Theme) -> Option<BoxDecoration>
foregroundDecoration. Read moreSource§fn paints_over(&self) -> bool
fn paints_over(&self) -> bool
paint_over (milestone 652). false by default, which spares
the walk the status it would compute for it.Source§fn paint_over(
&self,
_bounds: Rect,
_status: Status,
_theme: &Theme,
_scene: &mut Scene,
)
fn paint_over( &self, _bounds: Rect, _status: Status, _theme: &Theme, _scene: &mut Scene, )
Widget::paint is given — the reference’s foregroundPainter, for what a
widget draws that its children must not cover. A range slider’s thumbs are one:
each thumb’s focus stop is a child, and the halo it paints belongs under the thumb. Read moreSource§fn layer_filter(&self, _cx: FilterContext) -> Option<LayerFilter>
fn layer_filter(&self, _cx: FilterContext) -> Option<LayerFilter>
Source§fn backdrop_group(&self) -> bool
fn backdrop_group(&self) -> bool
true when this widget is a backdrop group: the backdrops below it that
ask to be shared are filtered once between them. See crate::BackdropGroup.Source§fn text_baseline(&self, _theme: &Theme) -> Option<f32>
fn text_baseline(&self, _theme: &Theme) -> Option<f32>
None — the default — means this widget has no
text of its own, and whatever is inside it answers instead. Read moreSource§fn ignores_baseline(&self) -> bool
fn ignores_baseline(&self) -> bool
true when this subtree should be left out of a parent’s baseline
alignment: it has a baseline, and the parent is to pretend it does not. An icon
beside a label, where the label is what the row should line up on. See
crate::IgnoreBaseline.Source§fn fill_axes(&self, _theme: &Theme) -> FillAxes
fn fill_axes(&self, _theme: &Theme) -> FillAxes
FillAxes::NONE means
shrink-wrap on both. Read moreSource§fn soft_extent(&self) -> FillAxes
fn soft_extent(&self) -> FillAxes
Source§fn main_axis_floor(&self, _theme: &Theme) -> Option<f32>
fn main_axis_floor(&self, _theme: &Theme) -> Option<f32>
None means squeeze freely. Read moreSource§fn tile_shape(&self) -> Option<f32>
fn tile_shape(&self) -> Option<f32>
width / height ratio to impose on each of them. None = each child keeps
its own shape. Read moreSource§fn positioned(&self) -> Option<Positioning>
fn positioned(&self) -> Option<Positioning>
crate::Stack’s edges
(crate::Positioned), what it pins. None = an ordinary layer, sized and
placed by the stack’s own fit and alignment. Read moreSource§fn stack_fit(&self) -> StackFit
fn stack_fit(&self) -> StackFit
crate::StackFit). Unset,
Passthrough: each is handed the stack’s box, and
one with a size of its own keeps it. Meaningless unless Widget::stack is true.Source§fn stack_measured(&self) -> bool
fn stack_measured(&self) -> bool
crate::Stack is, rather than the size its own style says. Meaningless unless
Widget::stack is true.Source§fn stack_clips(&self) -> bool
fn stack_clips(&self) -> bool
Source§fn stack_direction(&self) -> Option<TextDirection>
fn stack_direction(&self) -> Option<TextDirection>
Source§fn stack_visible(&self) -> Option<usize>
fn stack_visible(&self) -> Option<usize>
None, the default, shows all of them. Read moreSource§fn keep_visible(&self, _size: Size, _theme: &Theme) -> Option<KeepVisible>
fn keep_visible(&self, _size: Size, _theme: &Theme) -> Option<KeepVisible>
Source§fn scroll_reverse(&self) -> bool
fn scroll_reverse(&self) -> bool
crate::SingleChildScrollView::reverse):
the content is anchored to the end of the viewport and offsets are counted from
there. Meaningless unless Widget::scroll_content is Some.Source§fn scroll_padding(&self) -> Insets
fn scroll_padding(&self) -> Insets
Source§fn baseline_target(&self) -> Option<f32>
fn baseline_target(&self) -> Option<f32>
crate::Baseline),
the distance from the top of this box at which that baseline should land.
None = not a baseline box.Source§fn clip_path(&self) -> Option<&Path>
fn clip_path(&self) -> Option<&Path>
ClipPath), returns the
path in local coordinates (origin at the box’s top-left corner). The walk
offsets it to the screen and wraps it in a layer whose mask (the path) erases
the outside. Takes priority over Widget::clip_shape. None = no path clip.
See crate::ClipPath.Source§fn dismissible(&self) -> Option<DismissSpec>
fn dismissible(&self) -> Option<DismissSpec>
crate::Dismissible), its
configuration for this frame. The shell gives a mostly-sideways drag on it to
the dismissal and a mostly-up-and-down one to the enclosing scrollable. None =
not dismissible.Source§fn on_dismissed(&self, _direction: DismissDirection) -> Option<Msg>
fn on_dismissed(&self, _direction: DismissDirection) -> Option<Msg>
None = the swipe is shown but removes nothing.Source§fn sheet(&self) -> Option<&SheetSpec>
fn sheet(&self) -> Option<&SheetSpec>
crate::DraggableScrollableSheet, its
configuration for this frame. The layout makes it as tall as the retained height,
and the shell shares a finger on it between the sheet and the scroll areas inside.
None = not a sheet.Source§fn on_sheet_dismissed(&self) -> Option<Msg>
fn on_sheet_dismissed(&self) -> Option<Msg>
None = it
cannot be dismissed, or says nothing when it is.Source§fn refresh(&self) -> Option<RefreshSpec>
fn refresh(&self) -> Option<RefreshSpec>
crate::RefreshIndicator), its configuration for
this frame. Any scrollable inside it routes the movement its physics refuses at
the top edge into the pull, instead of into the overscroll glow. None = not a
refresh area.Source§fn on_refresh(&self) -> Option<Msg>
fn on_refresh(&self) -> Option<Msg>
None =
the pull is shown but asks for nothing, which is what an area still waiting for
its on_refresh looks like.Source§fn barrier(&self) -> Option<ModalBarrier>
fn barrier(&self) -> Option<ModalBarrier>
None = nothing withheld (the default). See crate::ModalBarrier,
crate::IgnorePointer, crate::AbsorbPointer, crate::Visibility,
crate::ExcludeSemantics.Source§fn interactive(&self) -> Option<(f32, f32)>
fn interactive(&self) -> Option<(f32, f32)>
InteractiveViewer), returns its
scale bounds (min, max). The paint walk renders its child in a transformed
layer (retained scale + translation, clipped to the viewport); the shell routes
drag → pan and wheel/pinch → zoom. None = not an interactive viewport.
See crate::InteractiveViewer.Source§fn fitted(&self) -> Option<BoxFit>
fn fitted(&self) -> Option<BoxFit>
FittedBox), returns the
frus_core::BoxFit: the walk measures the child at its natural size, scales
it according to the fit and centres it (composited layer, hit-test through
M⁻¹). None = not a fitter. See crate::FittedBox.Source§fn rotated_quarter_turns(&self) -> Option<i32>
fn rotated_quarter_turns(&self) -> Option<i32>
RotatedBox), returns
the number of quarters. Unlike Transform, this affects layout: the box
swaps its dimensions for an odd number. None = not a RotatedBox.
See crate::RotatedBox.(progress, push?). Its children
([screen] or [outgoing, incoming]) are rendered full-window with a sliding
transition.navigator’s transition — a back
gesture — so that it follows the finger linearly (milestone 620).0, the default, is a navigator that shows every
page it holds.Source§fn on_long_press(&self) -> Option<Msg>
fn on_long_press(&self) -> Option<Msg>
on_click.Source§fn on_double_tap(&self) -> Option<Msg>
fn on_double_tap(&self) -> Option<Msg>
on_click waits out those 300 ms, so that
the second tap of a double tap is not also a tap.Source§fn on_secondary_tap(&self) -> Option<Msg>
fn on_secondary_tap(&self) -> Option<Msg>
Source§fn pointer_listener(&self) -> bool
fn pointer_listener(&self) -> bool
Source§fn on_pointer_event(&self, _event: ListenerEvent) -> Vec<Msg>
fn on_pointer_event(&self, _event: ListenerEvent) -> Vec<Msg>
pointer_listener. Several, when listeners wrap each other at
the same place.Source§fn hover_region(&self) -> Option<HoverRegion>
fn hover_region(&self) -> Option<HoverRegion>
None for anything that is not one.Source§fn on_hover_event(&self, _event: HoverEvent) -> Option<Msg>
fn on_hover_event(&self, _event: HoverEvent) -> Option<Msg>
hover_region is set.Source§fn pan_axis(&self) -> Option<PanAxis>
fn pan_axis(&self) -> Option<PanAxis>
on_pan. Inside a scroll, a drag along
the scroll’s axis stays the scroll’s unless this axis claims it.Source§fn on_pan(&self, _event: PanEvent) -> Option<Msg>
fn on_pan(&self, _event: PanEvent) -> Option<Msg>
pan_axis is set.Source§fn wants_title_bar(&self) -> bool
fn wants_title_bar(&self) -> bool
WindowMenuBar’s row. The shell gives it the line where the
system allows it.Source§fn title_bar_role(&self) -> Option<TitleBarRole>
fn title_bar_role(&self) -> Option<TitleBarRole>
Source§fn pan_value(&self, _event: PanEvent, _value: f32, _rtl: bool) -> Option<f32>
fn pan_value(&self, _event: PanEvent, _value: f32, _rtl: bool) -> Option<f32>
anim_target) — a
switch’s thumb following the finger (milestone 638). Given a moment of the drag, the
value now and whether the text runs right to left, the value to hold it at; None
leaves it alone. The shell holds the value there while the finger is down, and when
it lifts lets it settle from there, asking on_value_release what that means.Source§fn on_value_release(&self, _value: f32) -> Option<Msg>
fn on_value_release(&self, _value: f32) -> Option<Msg>
value — a switch
flips when its thumb was let go past half way (milestone 638).Source§fn on_key(&self, _key: &Key) -> KeyResponse<Msg>
fn on_key(&self, _key: &Key) -> KeyResponse<Msg>
Ignored. (E.g. an OverlayPortal
consumes Escape to close itself.)Source§fn measure(&self, _theme: &Theme) -> Option<MeasureFn<'_>>
fn measure(&self, _theme: &Theme) -> Option<MeasureFn<'_>>
None = size fixed by style(). Contract: must be Some if and only if
Widget::measure_key is. Read moreSource§fn measure_key(&self, _theme: &Theme) -> Option<u64>
fn measure_key(&self, _theme: &Theme) -> Option<u64>
Widget::measure depends on (text, style…),
mixed into the relayout fingerprint: without it, two different contents with
the same style would be conflated by the cache and would keep a stale
geometry. Contract: Some if and only if measure() is. Read more