Skip to main content

DockGraph

Struct DockGraph 

Source
pub struct DockGraph { /* private fields */ }

Implementations§

Source§

impl DockGraph

Source

pub fn apply_op_checked( &mut self, op: &DockOp, ) -> Result<bool, DockOpApplyError>

Source

pub fn apply_op(&mut self, op: &DockOp) -> bool

Source§

impl DockGraph

Source

pub fn move_panel( &mut self, window: AppWindowId, panel: PanelKey, target_tabs: DockNodeId, zone: DropZone, ) -> bool

Source

pub fn move_panel_with_insert_index( &mut self, window: AppWindowId, panel: PanelKey, target_tabs: DockNodeId, zone: DropZone, insert_index: Option<usize>, ) -> bool

Source

pub fn move_panel_between_windows( &mut self, source_window: AppWindowId, panel: PanelKey, target_window: AppWindowId, target_tabs: DockNodeId, zone: DropZone, insert_index: Option<usize>, ) -> bool

Source

pub fn move_tabs_between_windows( &mut self, source_window: AppWindowId, source_tabs: DockNodeId, target_window: AppWindowId, target_tabs: DockNodeId, zone: DropZone, insert_index: Option<usize>, ) -> bool

Source

pub fn close_panel(&mut self, window: AppWindowId, panel: PanelKey) -> bool

Source

pub fn float_panel_to_window( &mut self, source_window: AppWindowId, panel: PanelKey, new_window: AppWindowId, ) -> bool

Source

pub fn float_tabs_to_window( &mut self, source_window: AppWindowId, source_tabs: DockNodeId, new_window: AppWindowId, ) -> bool

Source

pub fn float_panel_in_window( &mut self, source_window: AppWindowId, panel: PanelKey, target_window: AppWindowId, rect: Rect, ) -> bool

Source

pub fn float_tabs_in_window( &mut self, source_window: AppWindowId, source_tabs: DockNodeId, target_window: AppWindowId, rect: Rect, ) -> bool

Source

pub fn set_floating_rect( &mut self, window: AppWindowId, floating: DockNodeId, rect: Rect, ) -> bool

Source

pub fn raise_floating( &mut self, window: AppWindowId, floating: DockNodeId, ) -> bool

Source

pub fn merge_floating_into( &mut self, window: AppWindowId, floating: DockNodeId, target_tabs: DockNodeId, ) -> bool

Source

pub fn set_active_tab(&mut self, tabs: DockNodeId, active: usize) -> bool

Source

pub fn update_split_two( &mut self, split: DockNodeId, first_fraction: f32, ) -> bool

Source

pub fn update_split_fractions( &mut self, split: DockNodeId, next: Vec<f32>, ) -> bool

Source§

impl DockGraph

Source

pub fn export_layout(&self, windows: &[(AppWindowId, String)]) -> DockLayout

Source

pub fn export_layout_with_placement( &self, windows: &[(AppWindowId, String)], placement: impl FnMut(AppWindowId) -> Option<DockWindowPlacement>, ) -> DockLayout

Source

pub fn import_subtree_from_layout( &mut self, layout: &DockLayout, root: u32, ) -> Option<DockNodeId>

Source

pub fn import_subtree_from_layout_checked( &mut self, layout: &DockLayout, root: u32, ) -> Result<DockNodeId, DockLayoutValidationError>

Source

pub fn import_layout_for_windows( &mut self, layout: &DockLayout, windows: &[(AppWindowId, String)], ) -> bool

Source

pub fn import_layout_for_windows_checked( &mut self, layout: &DockLayout, windows: &[(AppWindowId, String)], ) -> Result<bool, DockLayoutValidationError>

Source

pub fn import_layout_for_windows_with_fallback_floatings( &mut self, layout: &DockLayout, windows: &[(AppWindowId, String)], fallback_window: AppWindowId, ) -> bool

Import a dock layout for a set of known windows, degrading any unmapped logical windows into in-window floating containers inside fallback_window.

This enables loading multi-window layouts on platforms that do not support multiple OS windows (wasm/mobile). The extra logical windows become floating dock containers rendered by the dock host in fallback_window.

Source

pub fn import_layout_for_windows_with_fallback_floatings_checked( &mut self, layout: &DockLayout, windows: &[(AppWindowId, String)], fallback_window: AppWindowId, ) -> Result<bool, DockLayoutValidationError>

Source§

impl DockGraph

Source

pub fn edge_dock_decision( &self, window: AppWindowId, target: DockNodeId, zone: DropZone, ) -> Option<EdgeDockDecision>

Decide whether an edge-dock into target will insert into an existing same-axis split, or wrap the target in a new split.

Returns None for DropZone::Center (not an edge dock) or if the target is not present in the window’s dock forest.

Source

pub fn compute_layout( &self, root: DockNodeId, bounds: Rect, out: &mut HashMap<DockNodeId, Rect>, )

Source

pub fn find_panel_in_window( &self, window: AppWindowId, panel: &PanelKey, ) -> Option<(DockNodeId, usize)>

Source

pub fn windows(&self) -> Vec<AppWindowId>

Source

pub fn collect_panels_in_window(&self, window: AppWindowId) -> Vec<PanelKey>

Source

pub fn first_tabs_in_window(&self, window: AppWindowId) -> Option<DockNodeId>

Source§

impl DockGraph

Source

pub fn new() -> Self

Source

pub fn insert_node(&mut self, node: DockNode) -> DockNodeId

Source

pub fn node(&self, id: DockNodeId) -> Option<&DockNode>

Source

pub fn node_mut(&mut self, id: DockNodeId) -> Option<&mut DockNode>

Source

pub fn set_window_root(&mut self, window: AppWindowId, root: DockNodeId)

Source

pub fn window_root(&self, window: AppWindowId) -> Option<DockNodeId>

Source

pub fn remove_window_root(&mut self, window: AppWindowId) -> Option<DockNodeId>

Source

pub fn floating_windows(&self, window: AppWindowId) -> &[DockFloatingWindow]

Source

pub fn floating_windows_mut( &mut self, window: AppWindowId, ) -> &mut Vec<DockFloatingWindow>

Trait Implementations§

Source§

impl Debug for DockGraph

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for DockGraph

Source§

fn default() -> DockGraph

Returns the “default value” for a type. 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, 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.