pub struct TabGroup { /* private fields */ }Expand description
A tab group’s behavior, with no appearance of its own.
It owns the panel list mirrored from the layout tree, the displayed index,
the focus handle, drag and drop hit state, and the zoom flag. Everything
visible is produced by the TabGroupRenderer the host installs.
The group holds no handle on its container. What the container knows — the
facts in TabGroupConstraints — is pushed in, and what the group needs
done is emitted as a TabGroupEvent. That keeps a group constructible,
and testable, on its own.
Implementations§
Source§impl TabGroup
impl TabGroup
pub fn with_renderer(self, renderer: Rc<dyn TabGroupRenderer>) -> Self
pub fn panels(&self) -> &[Arc<dyn PanelView>]
pub fn active_ix(&self) -> usize
Sourcepub fn active_panel(&self, cx: &App) -> Option<Arc<dyn PanelView>>
pub fn active_panel(&self, cx: &App) -> Option<Arc<dyn PanelView>>
The panel currently on screen, which is the displayed tab unless it has gone invisible, in which case rendering falls back to the first visible panel.
pub fn is_zoomed(&self) -> bool
pub fn is_collapsed(&self) -> bool
Sourcepub fn is_closable(&self, cx: &App) -> bool
pub fn is_closable(&self, cx: &App) -> bool
Whether closing this group’s displayed panel is allowed at all.
Mirrors the old TabPanel::closable: the container must permit it, the
group must have somewhere to go, and the displayed panel must itself be
closable.
Sourcepub fn select_tab(
&mut self,
ix: usize,
window: &mut Window,
cx: &mut Context<'_, Self>,
)
pub fn select_tab( &mut self, ix: usize, window: &mut Window, cx: &mut Context<'_, Self>, )
Display ix, if it names a tab that is not already displayed.
Sourcepub fn close_panel(&mut self, panel: PanelId, cx: &mut Context<'_, Self>)
pub fn close_panel(&mut self, panel: PanelId, cx: &mut Context<'_, Self>)
Ask the container to close panel. Nothing happens for a panel that is
not in this group, or when either the group or the panel refuses.
pub fn toggle_zoom(&mut self, window: &mut Window, cx: &mut Context<'_, Self>)
Sourcepub fn context(&self, cx: &App) -> TabGroupContext
pub fn context(&self, cx: &App) -> TabGroupContext
A snapshot of everything a skin needs to draw this group.
Trait Implementations§
impl EventEmitter<TabGroupEvent> for TabGroup
Source§impl Focusable for TabGroup
impl Focusable for TabGroup
Source§fn focus_handle(&self, cx: &App) -> FocusHandle
fn focus_handle(&self, cx: &App) -> FocusHandle
Auto Trait Implementations§
impl !RefUnwindSafe for TabGroup
impl !Send for TabGroup
impl !Sync for TabGroup
impl !UnwindSafe for TabGroup
impl Freeze for TabGroup
impl Unpin for TabGroup
impl UnsafeUnpin for TabGroup
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
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 more