pub struct DockingModel(/* private fields */);Expand description
The shared docking-layout model. Clone = share-by-handle.
Implementations§
Source§impl DockingModel
impl DockingModel
Sourcepub fn version(&self) -> Signal<u64>
pub fn version(&self) -> Signal<u64>
Structural version — bump on tab / pane / section / side add-remove.
The widget binds this at BindingLevel::Rebuild.
Sourcepub fn geometry_version(&self) -> Signal<u64>
pub fn geometry_version(&self) -> Signal<u64>
Geometry version — bump on side size / visibility / corner change.
The widget binds this at BindingLevel::Relayout.
Sourcepub fn consume_animate_flag(&self) -> bool
pub fn consume_animate_flag(&self) -> bool
Read-and-reset the “animate the next side show/hide” latch.
Sourcepub fn is_registered(&self, id: DockWidgetId) -> bool
pub fn is_registered(&self, id: DockWidgetId) -> bool
Whether a dock id is known (its content factory + meta are registered).
Sourcepub fn set_side_rail(&self, side: DockSide, thickness: f32)
pub fn set_side_rail(&self, side: DockSide, thickness: f32)
Set a side’s activity-rail thickness and presentation. A non-zero rail
switches the side to TabPresentation::Rail; the in-side strip is
then suppressed.
Sourcepub fn set_side_size(&self, side: DockSide, size: f32)
pub fn set_side_size(&self, side: DockSide, size: f32)
Set a side’s stored content size (px). Relayout only (no rebuild).
Sourcepub fn set_side_min_size(&self, side: DockSide, min: f32)
pub fn set_side_min_size(&self, side: DockSide, min: f32)
Set a side’s minimum content size (px).
Sourcepub fn set_policy(&self, policy: DockPolicy)
pub fn set_policy(&self, policy: DockPolicy)
Set the app’s DockPolicy — locks down end-user layout edits (the
programmatic API keeps working). Structural → rebuild.
Sourcepub fn policy(&self) -> DockPolicy
pub fn policy(&self) -> DockPolicy
The app’s current DockPolicy (cheap Copy; read by the widgets in
build() to gate their user affordances).
Sourcepub fn set_side_enabled(&self, side: DockSide, enabled: bool)
pub fn set_side_enabled(&self, side: DockSide, enabled: bool)
Enable / disable a whole side. A disabled side renders nothing, reserves no space, is not a drop target, and rejects placement / moves to it; its docks stay in the model and reappear when re-enabled. Structural → rebuild.
Sourcepub fn is_side_enabled(&self, side: DockSide) -> bool
pub fn is_side_enabled(&self, side: DockSide) -> bool
Whether a side is enabled (default true).
Sourcepub fn set_side_visible(&self, side: DockSide, visible: bool)
pub fn set_side_visible(&self, side: DockSide, visible: bool)
Show / hide a whole side (animated).
Sourcepub fn set_side_visible_immediate(&self, side: DockSide, visible: bool)
pub fn set_side_visible_immediate(&self, side: DockSide, visible: bool)
Show / hide a side immediately (no animation — drag-driven).
Sourcepub fn toggle_side_visible(&self, side: DockSide)
pub fn toggle_side_visible(&self, side: DockSide)
Toggle a side’s visibility (animated).
Sourcepub fn select_tab(&self, side: DockSide, tab_idx: usize)
pub fn select_tab(&self, side: DockSide, tab_idx: usize)
Select the active tab of a side. Repaint only (the Switcher swaps via
its bound selected_tab signal — no rebuild, no relayout).
Sourcepub fn select_tab_by_id(&self, side: DockSide, tab_id: DockTabId)
pub fn select_tab_by_id(&self, side: DockSide, tab_id: DockTabId)
Select a side’s active tab by id (position-independent — used by the rail / strip, whose visible order may skip hidden tabs).
Hide / show one activity (tab). A hidden activity stays registered (so it remains listable + restorable) but is dropped from the rail and tab strip. Hiding the selected tab moves the selection to the nearest still- visible tab. Structural → rebuild.
Whether an activity (tab) is currently hidden.
Sourcepub fn side_rail_size(&self, side: DockSide) -> DockRailItemSize
pub fn side_rail_size(&self, side: DockSide) -> DockRailItemSize
Current activity-bar item size for a side.
Sourcepub fn set_side_rail_size(&self, side: DockSide, size: DockRailItemSize)
pub fn set_side_rail_size(&self, side: DockSide, size: DockRailItemSize)
Set a side’s activity-bar item size (reactive → the rail rebuilds).
Sourcepub fn rail_size_mode_signal(&self, side: DockSide) -> Signal<DockRailItemSize>
pub fn rail_size_mode_signal(&self, side: DockSide) -> Signal<DockRailItemSize>
Reactive activity-bar size mode for a side — fires whenever the user
switches Default / Compact / Icon + Label (via the context menu or
set_side_rail_size). Bind it to adapt any
external widget — a rail’s slotted controls, an app toolbar — to the
rail’s current item size. (The rail rebuilds its slots on every change,
so a slot factory that reads this signal stays in step.)
Sourcepub fn side_tab_display(&self, side: DockSide) -> DockTabDisplay
pub fn side_tab_display(&self, side: DockSide) -> DockTabDisplay
Current dock-tab display mode for a side.
Sourcepub fn set_side_tab_display(&self, side: DockSide, display: DockTabDisplay)
pub fn set_side_tab_display(&self, side: DockSide, display: DockTabDisplay)
Set a side’s dock-tab display mode (reactive → the strip rebuilds).
Sourcepub fn set_corner(&self, corner: DockCorner, owner: DockSide)
pub fn set_corner(&self, corner: DockCorner, owner: DockSide)
Set the owner of a corner (must be one of its two adjacent sides).
Sourcepub fn open_dock(&self, id: DockWidgetId, loc: DockOpenLocation)
pub fn open_dock(&self, id: DockWidgetId, loc: DockOpenLocation)
Open (or move) a dock onto a side. Already-open docks are relocated (never duplicated).
Sourcepub fn promote_to_tab(&self, id: DockWidgetId, side: DockSide, at_tab: usize)
pub fn promote_to_tab(&self, id: DockWidgetId, side: DockSide, at_tab: usize)
Drag a dock out into its own new tab on side, inserted at at_tab.
Sourcepub fn split_into_tab(
&self,
id: DockWidgetId,
side: DockSide,
tab_idx: usize,
pane_idx: usize,
before: bool,
)
pub fn split_into_tab( &self, id: DockWidgetId, side: DockSide, tab_idx: usize, pane_idx: usize, before: bool, )
Drop a dock into an existing tab’s Splitter as a new Single pane,
before (before = true) or after the pane at pane_idx.
Sourcepub fn stack_into_tab(&self, id: DockWidgetId, side: DockSide, tab_idx: usize)
pub fn stack_into_tab(&self, id: DockWidgetId, side: DockSide, tab_idx: usize)
Drop a dock into a tab as a new Splitter pane appended after its existing panes (the “centre” drop — join this group without choosing a split direction). Each pane is its own single-item ToolBox.
Sourcepub fn move_dock(&self, id: DockWidgetId, loc: DockOpenLocation)
pub fn move_dock(&self, id: DockWidgetId, loc: DockOpenLocation)
Move a dock to another location (close + open in one notify).
Sourcepub fn move_tab(&self, tab_id: DockTabId, target_side: DockSide, at_tab: usize)
pub fn move_tab(&self, tab_id: DockTabId, target_side: DockSide, at_tab: usize)
Move a whole tab (its arrangement + every dock + selection) to another
side, re-deriving the Splitter orientation. Inserted at at_tab.
Sourcepub fn close_dock(&self, id: DockWidgetId)
pub fn close_dock(&self, id: DockWidgetId)
Close (remove) a dock from the layout.
Sourcepub fn toggle_dock(&self, id: DockWidgetId)
pub fn toggle_dock(&self, id: DockWidgetId)
Toggle a dock: close it if open, else open it on its default location.
Sourcepub fn reveal_dock(&self, id: DockWidgetId)
pub fn reveal_dock(&self, id: DockWidgetId)
Reveal a dock: ensure it is open, show + select its side / tab.
pub fn is_dock_open(&self, id: DockWidgetId) -> bool
pub fn dock_location(&self, id: DockWidgetId) -> Option<DockLoc>
Sourcepub fn dock_open_signal(&self, id: DockWidgetId) -> Signal<bool>
pub fn dock_open_signal(&self, id: DockWidgetId) -> Signal<bool>
A reactive true-while-open signal for an external rail / toolbar.
pub fn is_side_visible(&self, side: DockSide) -> bool
pub fn side_visible_signal(&self, side: DockSide) -> Signal<bool>
pub fn side_selected_tab_signal(&self, side: DockSide) -> Signal<usize>
pub fn side_selected_tab(&self, side: DockSide) -> usize
pub fn side_presentation(&self, side: DockSide) -> TabPresentation
pub fn side_size(&self, side: DockSide) -> f32
pub fn side_min_size(&self, side: DockSide) -> f32
pub fn side_rail_thickness(&self, side: DockSide) -> f32
pub fn side_has_rail(&self, side: DockSide) -> bool
pub fn corner_owner(&self, corner: DockCorner) -> DockSide
pub fn tab_count(&self, side: DockSide) -> usize
Sourcepub fn tab_id_at(&self, side: DockSide, idx: usize) -> Option<DockTabId>
pub fn tab_id_at(&self, side: DockSide, idx: usize) -> Option<DockTabId>
The id of the tab at idx in a side’s full tab list. The live inverse
of select_tab_by_id — the strip’s
index → id selection sync uses it so both directions resolve against the
current order and agree across a reorder (a build-time snapshot would
disagree and feed back unboundedly).
Sourcepub fn set_tab_title(&self, tab_id: DockTabId, title: Option<LocalizedString>)
pub fn set_tab_title(&self, tab_id: DockTabId, title: Option<LocalizedString>)
Give an activity (tab) a stable, explicit name, independent of which dock
occupies pane 0 (e.g. a grouped “Source Control” activity holding a file
tree and a git pane). Pass None to clear it (the label then derives from
the primary dock again). App-config — reconstructed each run, like dock
titles; not persisted. Structural → rebuild.
Sourcepub fn tab_title(&self, tab_id: DockTabId) -> Option<LocalizedString>
pub fn tab_title(&self, tab_id: DockTabId) -> Option<LocalizedString>
The explicit title set on an activity (None when it derives from its
primary dock).
Sourcepub fn activity_of(&self, dock_id: DockWidgetId) -> Option<DockTabId>
pub fn activity_of(&self, dock_id: DockWidgetId) -> Option<DockTabId>
The activity (tab) currently holding a dock — apps hold stable
DockWidgetIds, so this is the bridge to address the enclosing tab.
Sourcepub fn set_dock_activity_title(
&self,
dock_id: DockWidgetId,
title: impl Into<LocalizedString>,
)
pub fn set_dock_activity_title( &self, dock_id: DockWidgetId, title: impl Into<LocalizedString>, )
Sugar: name the activity that currently holds dock_id. The natural way
to title a grouped activity from app code that holds the dock id.
Sourcepub fn enabled_move_targets(&self, from: DockSide) -> Vec<DockSide>
pub fn enabled_move_targets(&self, from: DockSide) -> Vec<DockSide>
The enabled sides a tab / dock on from can be relocated to (every side
except from, keeping only is_side_enabled).
The “Move to” menus iterate this so a disabled side is never offered as a
silently-rejected target.
Sourcepub fn export_state(&self) -> DockLayoutState
pub fn export_state(&self) -> DockLayoutState
Serialize the user-controllable layout state (sizes / visibility / selections / arrangement structure / corners). App-config (rail thickness, mins, content factories) is reconstructed each run.
Sourcepub fn import_state(&self, state: &DockLayoutState)
pub fn import_state(&self, state: &DockLayoutState)
Restore a previously-exported state. Unknown dock ids are dropped,
emptied panes / tabs pruned, selections clamped. Bumps version.
Trait Implementations§
Source§impl Clone for DockingModel
impl Clone for DockingModel
Source§impl Debug for DockingModel
impl Debug for DockingModel
Auto Trait Implementations§
impl !RefUnwindSafe for DockingModel
impl !Send for DockingModel
impl !Sync for DockingModel
impl !UnwindSafe for DockingModel
impl Freeze for DockingModel
impl Unpin for DockingModel
impl UnsafeUnpin for DockingModel
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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