pub struct TabGroupContext { /* private fields */ }Expand description
Everything gpui_base::dock exports, so a consumer never has to depend
on the foundation crate directly to write a skin or read a container’s
state. Kept in step with base’s own list by
every_base_dock_export_is_reachable_from_here.
Two names are handled elsewhere and one is deliberately absent:
base’s Panel and PanelView arrive as BasePanel and BasePanelView
because this module’s Panel/PanelView are the presentation halves that
extend them, and base’s Dock — a plain state struct holding one dock’s
open, collapsible, size and resizing flags — is not re-exported at all,
because the name meant a panel container in every released version of this
crate and handing it back with a different meaning is worse than dropping
it. A skin reads a dock through DockContext.
What a skin needs to draw a tab group, and the callbacks it invokes rather
than reimplementing behavior.
Implementations§
Source§impl TabGroupContext
impl TabGroupContext
Sourcepub fn node(&self) -> NodeId
pub fn node(&self) -> NodeId
The Tabs node this group mirrors, for a skin that needs to name the
group in a drag payload or a drop target.
Sourcepub fn panels(&self) -> &[Arc<dyn PanelView>]
pub fn panels(&self) -> &[Arc<dyn PanelView>]
Every panel in the group, in tab order — visible or not. A skin filters
with PanelView::visible when it draws.
pub fn active_ix(&self) -> usize
Sourcepub fn active_panel(&self) -> Option<&Arc<dyn PanelView>>
pub fn active_panel(&self) -> Option<&Arc<dyn PanelView>>
The panel on screen, which is the displayed tab unless that panel has gone invisible.
pub fn drop_indicator(&self) -> Option<DropIndicator>
pub fn is_zoomed(&self) -> bool
pub fn is_collapsed(&self) -> bool
Sourcepub fn is_closable(&self) -> bool
pub fn is_closable(&self) -> bool
Whether closing the displayed panel is allowed at all, so a skin knows whether to offer a Close control.
pub fn is_locked(&self) -> bool
pub fn is_draggable(&self) -> bool
pub fn is_droppable(&self) -> bool
pub fn select_tab(&self, ix: usize, window: &mut Window, cx: &mut App)
pub fn close(&self, panel: PanelId, window: &mut Window, cx: &mut App)
pub fn toggle_zoom(&self, window: &mut Window, cx: &mut App)
Sourcepub fn drag_panel(&self, ix: usize, cx: &App) -> Option<DragPanel>
pub fn drag_panel(&self, ix: usize, cx: &App) -> Option<DragPanel>
The drag payload for the tab at ix, for a skin wiring on_drag onto
its tabs. None when ix names no panel.
Trait Implementations§
Source§impl Clone for TabGroupContext
impl Clone for TabGroupContext
Source§fn clone(&self) -> TabGroupContext
fn clone(&self) -> TabGroupContext
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for TabGroupContext
impl !Send for TabGroupContext
impl !Sync for TabGroupContext
impl !UnwindSafe for TabGroupContext
impl Freeze for TabGroupContext
impl Unpin for TabGroupContext
impl UnsafeUnpin for TabGroupContext
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> 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> ⓘ
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