pub struct DockSkin { /* private fields */ }Expand description
The gpui-component appearance for a DockArea, and the handle its
settings are changed through.
Install it at construction, where the area’s own weak handle is available:
let skin = DockSkin::new(cx);
DockArea::new("main", None, window, cx).with_renderer(skin)Keep the returned handle to change a setting later; it is an Rc, so a
clone and the installed renderer are the same skin.
Implementations§
Source§impl DockSkin
impl DockSkin
Sourcepub fn dock_area(
id: impl Into<SharedString>,
version: Option<usize>,
window: &mut Window,
cx: &mut App,
) -> (Entity<DockArea>, Rc<Self>)
pub fn dock_area( id: impl Into<SharedString>, version: Option<usize>, window: &mut Window, cx: &mut App, ) -> (Entity<DockArea>, Rc<Self>)
Build a DockArea wearing this appearance, together with the handle
its settings are changed through.
The skin needs the area’s own weak handle, so it can only be built while the area is being constructed; this is that dance done once.
pub fn new(cx: &mut Context<'_, DockArea>) -> Rc<Self>
Sourcepub fn panel_style(&self) -> PanelStyle
pub fn panel_style(&self) -> PanelStyle
Whether a single-panel tab group draws a plain title or a full tab bar.
pub fn set_panel_style(&self, style: PanelStyle, cx: &mut App)
Whether tab bars offer the affordance that collapses a neighbouring dock.
Sourcepub fn tiles_scrollbar_mode(&self) -> Option<ScrollbarMode>
pub fn tiles_scrollbar_mode(&self) -> Option<ScrollbarMode>
When a tiles canvas shows its scrollbar. None follows the theme.
pub fn set_tiles_scrollbar_mode( &self, mode: Option<ScrollbarMode>, cx: &mut App, )
Trait Implementations§
Source§impl DockAreaRenderer for DockSkin
impl DockAreaRenderer for DockSkin
Source§fn build_placeholder(
&self,
state: &PanelState,
_: &mut Window,
cx: &mut App,
) -> Option<Arc<dyn PanelView>>
fn build_placeholder( &self, state: &PanelState, _: &mut Window, cx: &mut App, ) -> Option<Arc<dyn PanelView>>
The “unknown panel” message the old InvalidPanel drew.
It answers dump with the state it was handed, so a layout written by
a build that knows the panel survives a load and save here.
Source§fn frame(&self, _: &mut Window, _: &mut App) -> Stateful<Div>
fn frame(&self, _: &mut Window, _: &mut App) -> Stateful<Div>
Source§fn center_frame(&self, _: &mut Window, _: &mut App) -> Stateful<Div>
fn center_frame(&self, _: &mut Window, _: &mut App) -> Stateful<Div>
DockAreaRenderer::frame. The centre fills what
the side docks leave and stacks with the bottom dock either way.Source§fn split_frame(
&self,
node: NodeId,
_: Axis,
_: &mut Window,
cx: &mut App,
) -> Stateful<Div>
fn split_frame( &self, node: NodeId, _: Axis, _: &mut Window, cx: &mut App, ) -> Stateful<Div>
Source§fn render_dock(
&self,
dock: &DockContext,
content: AnyElement,
window: &mut Window,
cx: &mut App,
) -> AnyElement
fn render_dock( &self, dock: &DockContext, content: AnyElement, window: &mut Window, cx: &mut App, ) -> AnyElement
fn tab_group_renderer(&self) -> Rc<dyn TabGroupRenderer>
fn tiles_renderer(&self) -> Rc<dyn TilesRenderer>
Source§fn render_split_handle(
&self,
handle: &ResizeHandleContext,
window: &mut Window,
cx: &mut App,
) -> Option<AnyElement>
fn render_split_handle( &self, handle: &ResizeHandleContext, window: &mut Window, cx: &mut App, ) -> Option<AnyElement>
Auto Trait Implementations§
impl !RefUnwindSafe for DockSkin
impl !Send for DockSkin
impl !Sync for DockSkin
impl !UnwindSafe for DockSkin
impl Freeze for DockSkin
impl Unpin for DockSkin
impl UnsafeUnpin for DockSkin
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