Skip to main content

LocalScope

Trait LocalScope 

Source
pub trait LocalScope {
    // Required methods
    fn info(&self) -> ScopeInfo;
    fn line(&self, app: &AppHandle) -> Line;
    fn undo(
        &self,
        app: &AppHandle,
        origin: &Origin,
    ) -> Result<Option<StepInfo>, Refusal>;
    fn redo(
        &self,
        app: &AppHandle,
        origin: &Origin,
    ) -> Result<Option<StepInfo>, Refusal>;

    // Provided method
    fn in_progress(&self, _app: &AppHandle) -> Option<Label> { ... }
}
Expand description

A component’s own history, kept in the interface (ADR 0014): the theme editor’s draft, the settings window’s values. Registered for a focus surface with Ctx::local_scope: while the focus is in that surface, Ctrl+Z undoes here.

Required Methods§

Source

fn info(&self) -> ScopeInfo

The scope (its local set).

Source

fn line(&self, app: &AppHandle) -> Line

Its steps.

Source

fn undo( &self, app: &AppHandle, origin: &Origin, ) -> Result<Option<StepInfo>, Refusal>

Undoes its head: the step undone, None when there was none.

Source

fn redo( &self, app: &AppHandle, origin: &Origin, ) -> Result<Option<StepInfo>, Refusal>

Redoes its next step.

Provided Methods§

Source

fn in_progress(&self, _app: &AppHandle) -> Option<Label>

A gesture still going: undo and redo wait for it.

Implementors§