Trait UndoControl
pub trait UndoControl {
// Provided methods
fn set_undo_status(&mut self, _status: &mut dyn FnMut() -> UndoStatus) { ... }
fn take_undo_request(&mut self) -> Option<UndoRequest> { ... }
}Expand description
A control that shows or drives the document’s undo history (an Undo
button). The host reaches every laid-out widget through its node_map, so
a control works at any depth with no container forwarding.
Provided Methods§
fn set_undo_status(&mut self, _status: &mut dyn FnMut() -> UndoStatus)
fn set_undo_status(&mut self, _status: &mut dyn FnMut() -> UndoStatus)
Host → widget: the live undo state, published once per frame. Call the provider only when the status is shown; a historical summary can need a document diff.
fn take_undo_request(&mut self) -> Option<UndoRequest>
fn take_undo_request(&mut self) -> Option<UndoRequest>
Widget → host: an undo or redo the user asked for, performed through the same path as Ctrl+Z. Rising-edge: reading clears it.