pub struct TabStrip {
pub tabs: Vec<TabView>,
pub active: Option<usize>,
pub palette: Palette,
}Expand description
Whole-strip render input. Re-create per frame — the widget owns no
state. palette is set once on startup from config.theme and
drives every colour the widget paints.
Fields§
§tabs: Vec<TabView>§active: Option<usize>§palette: PaletteImplementations§
Source§impl TabStrip
impl TabStrip
Sourcepub fn paint(
&self,
buffer: &mut [u32],
width: usize,
height: usize,
start_y: u32,
)
pub fn paint( &self, buffer: &mut [u32], width: usize, height: usize, start_y: u32, )
Paint the tab strip into rows [start_y, start_y + TAB_STRIP_HEIGHT)
of the window buffer. width and height are the full window’s
pixel dimensions; the caller passes start_y so the tab strip
can sit anywhere vertically.
The widget is a no-op when the strip would not fit (e.g. window
shorter than start_y + TAB_STRIP_HEIGHT). When tabs is empty
the strip is filled with TAB_STRIP_BG only — useful while a
tab is being created on startup.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TabStrip
impl RefUnwindSafe for TabStrip
impl Send for TabStrip
impl Sync for TabStrip
impl Unpin for TabStrip
impl UnsafeUnpin for TabStrip
impl UnwindSafe for TabStrip
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<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