Struct PaintedEmptyStates
pub struct PaintedEmptyStates { /* private fields */ }Expand description
The empty states a host’s content painted itself with
EmptyState::paint, described for it: each becomes a group named by
its title with its action as a button where it was drawn, unless the
content describes that button already. Activating the button clicks
where it is drawn, exactly as a pointer would, so the content’s own
hit test runs it.
A host keeps one per content it draws: Self::draw around the
content’s paint, Self::describe over its accessibility and
Self::action_rect for where an activation lands.
Implementations§
§impl PaintedEmptyStates
impl PaintedEmptyStates
pub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Whether the last draw painted no empty state: Self::describe
then returns the content’s node as it is.
pub fn draw(&mut self, transform: Affine, draw: impl FnOnce())
pub fn draw(&mut self, transform: Affine, draw: impl FnOnce())
Run draw, keeping the empty-state actions it paints in the space
transform maps from: the content’s own coordinates.
pub fn describe(
&self,
node: Option<AccessNode>,
content: &dyn Widget,
) -> Option<AccessNode>
pub fn describe( &self, node: Option<AccessNode>, content: &dyn Widget, ) -> Option<AccessNode>
node, the content’s own accessibility, with each painted state
whose action neither it nor a widget inside content describes.
pub fn action_rect(
&self,
described: &AccessNode,
path: &[usize],
) -> Option<Rect>
pub fn action_rect( &self, described: &AccessNode, path: &[usize], ) -> Option<Rect>
Where the painted action at path beneath described (what
Self::describe returned) is drawn; None for any other node.
Trait Implementations§
§impl Debug for PaintedEmptyStates
impl Debug for PaintedEmptyStates
§impl Default for PaintedEmptyStates
impl Default for PaintedEmptyStates
§fn default() -> PaintedEmptyStates
fn default() -> PaintedEmptyStates
Auto Trait Implementations§
impl Freeze for PaintedEmptyStates
impl RefUnwindSafe for PaintedEmptyStates
impl Send for PaintedEmptyStates
impl Sync for PaintedEmptyStates
impl Unpin for PaintedEmptyStates
impl UnsafeUnpin for PaintedEmptyStates
impl UnwindSafe for PaintedEmptyStates
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> 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>, which can then be
downcast into Box<dyn 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>, which 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> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§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> 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