pub enum ItemChange {
Show 13 variants
LocalPosChanged {
id: ItemId,
old: Point,
new: Point,
},
LocalBoundsChanged {
id: ItemId,
old: Rect,
new: Rect,
},
TransformChanged {
id: ItemId,
},
VisibilityChanged {
id: ItemId,
visible: bool,
},
FlagsChanged {
id: ItemId,
old: ItemFlags,
new: ItemFlags,
},
OpacityChanged {
id: ItemId,
old: f32,
new: f32,
},
ZChanged {
id: ItemId,
old: f32,
new: f32,
},
LayerChanged {
id: ItemId,
old: SceneLayer,
new: SceneLayer,
},
ParentChanged {
id: ItemId,
old: Option<ItemId>,
new: Option<ItemId>,
},
Removed {
id: ItemId,
},
Added {
id: ItemId,
},
PayloadChanged {
id: ItemId,
},
AppearanceChanged {
id: ItemId,
},
}Expand description
A change to an item’s state, fired through
Scene::item_change_signal for every mutation. Apps observe
to wire snap-to-grid, validation, side effects, etc. The model
is “fire after the change has been applied” — by the time the
observer sees the event, the Scene already reflects it.
Variants§
LocalPosChanged
set_local_pos: position in parent coords moved.
LocalBoundsChanged
set_local_bounds: AABB in local coords changed.
TransformChanged
set_transform: local→parent transform changed.
VisibilityChanged
set_visible flipped IS_VISIBLE.
FlagsChanged
set_flags / set_flag changed the bitset.
OpacityChanged
set_opacity: local opacity multiplier changed.
ZChanged
set_z: paint z-order changed.
LayerChanged
set_layer: the Under/Over paint band changed.
ParentChanged
set_item_parent: logical parent changed.
Removed
remove: item is gone.
Added
add_item / add_widget: item was inserted.
PayloadChanged
set_payload: the type-erased payload of a Delegated heavyweight
entry was replaced. A SceneView rebuilds that entry’s widget
(re-invokes its delegate) on the next build. Routed through
emit_item_change, so mutation_seq advances and the AT-walk gate
notices.
AppearanceChanged
set_item_fill / set_item_stroke / clear_item_*: a lightweight
item’s paint-only appearance (fill / stroke colour or style) changed.
Never moves geometry, so the observing SceneView evicts the item’s
cached frame and repaints without relayout or rebuild.
Trait Implementations§
Source§impl Clone for ItemChange
impl Clone for ItemChange
Source§fn clone(&self) -> ItemChange
fn clone(&self) -> ItemChange
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ItemChange
Source§impl Debug for ItemChange
impl Debug for ItemChange
Source§impl PartialEq for ItemChange
impl PartialEq for ItemChange
Source§fn eq(&self, other: &ItemChange) -> bool
fn eq(&self, other: &ItemChange) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ItemChange
Auto Trait Implementations§
impl Freeze for ItemChange
impl RefUnwindSafe for ItemChange
impl Send for ItemChange
impl Sync for ItemChange
impl Unpin for ItemChange
impl UnsafeUnpin for ItemChange
impl UnwindSafe for ItemChange
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
§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