pub struct TabsState {
pub active: usize,
pub offset: usize,
}Expand description
State for a Tabs widget.
Fields§
§active: usizeActive tab index.
offset: usizeLeft-most tab index when overflow scrolling is active.
Implementations§
Source§impl TabsState
impl TabsState
Sourcepub fn handle_key(&mut self, key: &KeyEvent, tab_count: usize) -> bool
pub fn handle_key(&mut self, key: &KeyEvent, tab_count: usize) -> bool
Handle keyboard tab switching.
Supported:
Left/Right- number keys
1..9
Sourcepub fn handle_mouse(
&mut self,
event: &MouseEvent,
hit: Option<(HitId, HitRegion, u64)>,
expected_id: HitId,
tab_count: usize,
) -> MouseResult
pub fn handle_mouse( &mut self, event: &MouseEvent, hit: Option<(HitId, HitRegion, u64)>, expected_id: HitId, tab_count: usize, ) -> MouseResult
Handle mouse selection for tabs.
Hit data convention: each tab row registers data = tab_index as u64.
Trait Implementations§
impl Eq for TabsState
impl StructuralPartialEq for TabsState
Auto Trait Implementations§
impl Freeze for TabsState
impl RefUnwindSafe for TabsState
impl Send for TabsState
impl Sync for TabsState
impl Unpin for TabsState
impl UnsafeUnpin for TabsState
impl UnwindSafe for TabsState
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
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.