diff --git a/crates/ui-canvas/src/canvas/mod.rs b/crates/ui-canvas/src/canvas/mod.rs index 1777123e8..2439b191d 100644 --- a/crates/ui-canvas/src/canvas/mod.rs +++ b/crates/ui-canvas/src/canvas/mod.rs @@ -177,7 +177,12 @@ pub struct Canvas<'a> { /// disabled for this canvas. #[prop] layer_bounds: Option>, - /// The view commands the app asks of this canvas ([`queued`](Self::queued)). + /// View commands the app asks of this canvas's view (a menu row or an action step it runs, a new document's fit): + /// the canvas runs them in this pass, in order and before the ones fired to it, as it runs those. A + /// [`ViewRequest::Command`] eases as a fired command does; a [`ViewRequest::Place`] that moves the view makes the + /// pass's view jump. A measuring run runs none. The app asks for them until a pass that is not a measuring run + /// showed the canvas, then drops them. + #[prop] queued: &'a [ViewRequest], /// The user's navigation options: how the wheel and a pinch move the view ([`WheelNavigation`]), whether a zoom /// eases (Animated Zoom) and whether the view may leave the document (Overscroll). @@ -327,17 +332,6 @@ impl<'a> Canvas<'a> { self } - /// View commands the app asks of this canvas's view (a menu row or an action step it runs, a new document's fit): - /// the canvas runs them in this pass, in order and before the ones fired to it, as it runs those. A - /// [`ViewRequest::Command`] eases as a fired command does; a [`ViewRequest::Place`] that moves the view makes the - /// pass's view jump. A measuring run runs none. The app asks for them until a pass that is not a measuring run - /// showed the canvas, then drops them. - #[must_use] - pub fn queued(mut self, commands: &'a [ViewRequest]) -> Self { - self.queued = commands; - self - } - /// Leaves the view commands to the instance around the canvas that owns its view (a full-window dialog's): the /// canvas is no instance of them, so the chords reach that instance while the canvas has the focus. #[must_use] diff --git a/crates/ui-canvas/src/canvas/tools.rs b/crates/ui-canvas/src/canvas/tools.rs index 87ddf1ac5..ee74d92aa 100644 --- a/crates/ui-canvas/src/canvas/tools.rs +++ b/crates/ui-canvas/src/canvas/tools.rs @@ -242,6 +242,7 @@ impl ViewCommands { /// A view command an app asks of its canvas ([`Canvas::queued`](super::Canvas::queued)). #[derive(Clone, Copy, Debug, PartialEq, Eq)] +#[non_exhaustive] pub enum ViewRequest { /// A command the user gave (a menu row, an action step): it eases under Animated Zoom, as its chord does. Command(ViewCommands),