pub struct Cursor { /* private fields */ }Expand description
Where an open menu is being worked: open is the chain of submenu rows
currently down, outermost first, and row is the live row in the menu that
chain ends at.
One cursor for both input devices. A menu that tracked hover separately from the keyboard could have two rows lit and a submenu hanging off neither.
Implementations§
Source§impl Cursor
impl Cursor
Sourcepub fn nested(&self) -> bool
pub fn nested(&self) -> bool
Whether a submenu is down — where a menubar’s left closes a level
instead of crossing to the previous menu.
Sourcepub fn lit(&self, depth: usize) -> Option<usize>
pub fn lit(&self, depth: usize) -> Option<usize>
The row lit in the panel at depth: the row holding the submenu open
above the innermost panel, the live row in it, nothing below.
Sourcepub fn descend(&mut self, root: &[Item]) -> bool
pub fn descend(&mut self, root: &[Item]) -> bool
Open the submenu under the live row and land on its first row. false
when the live row is not one — which is a menubar’s cue that right
meant the next menu instead.
Sourcepub fn ascend(&mut self) -> bool
pub fn ascend(&mut self) -> bool
Close the innermost submenu, landing back on the row that opened it.
false at the top level, where closing is the whole menu’s to do.
Sourcepub fn point_at(&mut self, root: &[Item], path: &[usize]) -> bool
pub fn point_at(&mut self, root: &[Item], path: &[usize]) -> bool
Put the cursor on the row path names, opening the chain above it and,
if it is a submenu row, itself — pointing at a submenu row is what opens
it. Nothing is lit inside the fresh panel until something moves into it.
Answers whether that changed anything, because the pointer reports every move and only a change is worth a repaint.
Trait Implementations§
impl Eq for Cursor
impl StructuralPartialEq for Cursor
Auto Trait Implementations§
impl Freeze for Cursor
impl RefUnwindSafe for Cursor
impl Send for Cursor
impl Sync for Cursor
impl Unpin for Cursor
impl UnsafeUnpin for Cursor
impl UnwindSafe for Cursor
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
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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> ⓘ
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().