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 the active panel can be closed.
Sourcepub fn is_panel_closable(&self, panel: PanelId, cx: &App) -> bool
pub fn is_panel_closable(&self, panel: PanelId, cx: &App) -> bool
Whether panel can be closed from this group. Uses the same constraints
as TabGroup::close_panel, including the panel’s own closable flag.
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 Forget for TabGroupContext
impl Freeze for TabGroupContextwhere
*const u8 is !null: Freeze,
PhantomData<Arc<dyn PanelView>>: Freeze,
*const ArcInner<dyn PanelView> is !null: Freeze,
PhantomData<ArcInner<dyn PanelView>>: Freeze,
*const RcInner<dyn Fn(usize, &mut Window, &mut App)> is !null: Freeze,
PhantomData<RcInner<dyn Fn(usize, &mut Window, &mut App)>>: Freeze,
*const RcInner<dyn Fn(PanelId, &mut Window, &mut App)> is !null: Freeze,
PhantomData<RcInner<dyn Fn(PanelId, &mut Window, &mut App)>>: Freeze,
*const RcInner<dyn Fn(&mut Window, &mut App)> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut Window, &mut App)>>: Freeze,
*const RcInner<dyn Fn(DragPanel, Option<usize>, bool, &mut Window, &mut App)> is !null: Freeze,
PhantomData<RcInner<dyn Fn(DragPanel, Option<usize>, bool, &mut Window, &mut App)>>: Freeze,
*const RcInner<dyn Fn(AnyDrag, Option<Placement>, &mut Window, &mut App)> is !null: Freeze,
PhantomData<RcInner<dyn Fn(AnyDrag, Option<Placement>, &mut Window, &mut App)>>: Freeze,
impl Move for TabGroupContext
impl Unpin for TabGroupContextwhere
*const u8 is !null: Unpin,
Arc<dyn PanelView>: Unpin,
Rc<dyn Fn(usize, &mut Window, &mut App)>: Unpin,
Rc<dyn Fn(PanelId, &mut Window, &mut App)>: Unpin,
Rc<dyn Fn(&mut Window, &mut App)>: Unpin,
Rc<dyn Fn(DragPanel, Option<usize>, bool, &mut Window, &mut App)>: Unpin,
Rc<dyn Fn(AnyDrag, Option<Placement>, &mut Window, &mut App)>: Unpin,
impl UnsafeUnpin for TabGroupContextwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<Arc<dyn PanelView>>: UnsafeUnpin,
*const ArcInner<dyn PanelView> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn PanelView>>: UnsafeUnpin,
*const RcInner<dyn Fn(usize, &mut Window, &mut App)> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(usize, &mut Window, &mut App)>>: UnsafeUnpin,
*const RcInner<dyn Fn(PanelId, &mut Window, &mut App)> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(PanelId, &mut Window, &mut App)>>: UnsafeUnpin,
*const RcInner<dyn Fn(&mut Window, &mut App)> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut Window, &mut App)>>: UnsafeUnpin,
*const RcInner<dyn Fn(DragPanel, Option<usize>, bool, &mut Window, &mut App)> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(DragPanel, Option<usize>, bool, &mut Window, &mut App)>>: UnsafeUnpin,
*const RcInner<dyn Fn(AnyDrag, Option<Placement>, &mut Window, &mut App)> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(AnyDrag, Option<Placement>, &mut Window, &mut App)>>: UnsafeUnpin,
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,
impl<T> ErasedDestructor for Twhere
T: 'static,
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