Skip to main content

DockSkin

Struct DockSkin 

Source
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

Source

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.

Source

pub fn new(cx: &mut Context<'_, DockArea>) -> Rc<Self>

Source

pub fn panel_style(&self) -> PanelStyle

Whether a single-panel tab group draws a plain title or a full tab bar.

Source

pub fn set_panel_style(&self, style: PanelStyle, cx: &mut App)

Source

pub fn is_toggle_button_visible(&self) -> bool

Whether tab bars offer the affordance that collapses a neighbouring dock.

Source

pub fn set_toggle_button_visible(&self, visible: bool, cx: &mut App)

Source

pub fn tiles_scrollbar_mode(&self) -> Option<ScrollbarMode>

When a tiles canvas shows its scrollbar. None follows the theme.

Source

pub fn set_tiles_scrollbar_mode( &self, mode: Option<ScrollbarMode>, cx: &mut App, )

Trait Implementations§

Source§

impl DockAreaRenderer for DockSkin

Source§

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>

The area’s outer frame, which base records its bounds on. Appearance only. The area is laid out as a row around whatever this returns, because that is what makes a dock a column beside the centre rather than a block above it, and a renderer cannot be expected to know it had a row to declare.
Source§

fn center_frame(&self, _: &mut Window, _: &mut App) -> Stateful<Div>

The column holding the center region and the bottom dock. Appearance only; see 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>

One split container’s frame, around base’s resizable group. Read more
Source§

fn render_dock( &self, dock: &DockContext, content: AnyElement, window: &mut Window, cx: &mut App, ) -> AnyElement

One dock’s chrome around its content: the title strip, the collapse affordance, and the resize handle. Read more
Source§

fn tab_group_renderer(&self) -> Rc<dyn TabGroupRenderer>

Source§

fn tiles_renderer(&self) -> Rc<dyn TilesRenderer>

Source§

fn render_split_handle( &self, handle: &ResizeHandleContext, window: &mut Window, cx: &mut App, ) -> Option<AnyElement>

The painted part of the divider between two slots of a split. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more