pub enum Toggle {
Handled(OnToggle),
HitTested,
}Expand description
Who answers a press on a task block’s checkbox.
Either variant paints the box as a control — the pointer over it is a hand.
Editing::toggle left unset paints it as a mark, and the press goes
wherever it would on any other glyph.
Variants§
Handled(OnToggle)
The box takes the press, stops it, and calls this with the block it
belongs to. For a caller holding the Doc it renders itself.
HitTested
The box takes no press. The caller hit-tests
BlockLayouts::checkbox_bounds in its own handler, which is what an
editor does: the press it swallows is the one that also takes focus and
closes an open menu, and the toggle belongs in the undo history beside
the rest of its edits.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Toggle
impl !Send for Toggle
impl !Sync for Toggle
impl !UnwindSafe for Toggle
impl Freeze for Toggle
impl Unpin for Toggle
impl UnsafeUnpin for Toggle
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
Mutably borrows from an owned value. Read more
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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> ⓘ
Converts
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> ⓘ
Converts
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