diff --git a/docs/contract-api.md b/docs/contract-api.md index d71ff8022..ab848193e 100644 --- a/docs/contract-api.md +++ b/docs/contract-api.md @@ -451,7 +451,7 @@ The dock model: the tree of splits over panel frames, the side of a group a drop - `craft_behavior::dock::DockSide`: `pub enum DockSide { Start, End, Top, Bottom, Center }`. The side of a group a dropped panel docks on, in reading order: `Start` is the left half in a left-to-right - `pub const fn axis(self) -> Option`. The axis the side splits along; `None` for `Center`. - `pub fn area(self, group: Rect) -> Rect`. The part of `group` a panel docked on this side takes: the half on that side, or the whole group. -- `craft_behavior::dock::Action`: `pub enum Action

{ Move { panel: P, anchor: P, placement: DockPlacement

}, Float { panel: P, rect: Rect }, Close { panel: P }, Activate { panel: P }, Open { panel: P, anchor: Option

}, OpenAt { panel: P, anchor: P, placement: DockPlacement

}, MoveFloating { panel: P, rect: Rect }, ResizeSplit { path: Vec, size: SplitSize }, ResizeWindowSplit { panel: P, path: Vec, size: SplitSize }, SetStackOpen { panel: P, open: bool }, ResizeStack { panel: P, height: Option }, MoveGroup { panel: P, to: Target

}, StepGroup { panel: P, up: bool }, MoveColumn { panel: P, to: Target

}, MoveWindow { panel: P, to: Target

}, CloseGroup { panel: P }, CloseWindow { panel: P }, CloseOthers { panel: P }, SetMinimized { panel: P, minimized: bool }, SetIconic { panel: P, iconic: bool }, ResizeColumn { panel: P, width: f32 }, ResizeGroup { panel: P, height: Option }, ResizeFlyoutWidth { panel: P, width: Option }, ResizeIconic { panel: P, width: Option }, SetNative { panel: P, placement: Option }, MovePanel { panel: P, to: Target

} }`. Groups, columns and floating windows are named by a panel they contain. +- `craft_behavior::dock::Action`: `pub enum Action

{ Move { panel: P, anchor: P, placement: DockPlacement

}, Float { panel: P, rect: Rect }, Close { panel: P }, Activate { panel: P }, Open { panel: P, anchor: Option

}, OpenAt { panel: P, anchor: P, placement: DockPlacement

}, MoveFloating { panel: P, rect: Rect }, ResizeSplit { path: Vec, size: SplitSize }, ResizeWindowSplit { panel: P, path: Vec, size: SplitSize }, SetStackOpen { panel: P, open: bool }, ResizeStack { panel: P, height: Option }, MoveGroup { panel: P, to: Target

}, StepGroup { panel: P, up: bool }, MoveColumn { panel: P, to: Target

}, MoveWindow { panel: P, to: Target

}, CloseGroup { panel: P }, CloseWindow { panel: P }, CloseOthers { panel: P }, SetMinimized { panel: P, minimized: bool }, SetIconic { panel: P, iconic: bool }, ResizeColumn { panel: P, width: f32 }, ResizeGroup { panel: P, height: Option }, ResizeFlyoutWidth { panel: P, width: Option }, MoveFlyoutTop { panel: P, offset: Option }, ResizeIconic { panel: P, width: Option }, SetNative { panel: P, placement: Option }, MovePanel { panel: P, to: Target

} }`. Groups, columns and floating windows are named by a panel they contain. - `pub fn move_beside(panel: P, anchor: P, placement: DockPlacement

) -> Self`. Builds [`Action::Move`]. - `pub fn float(panel: P, rect: Rect) -> Self`. Builds [`Action::Float`]. - `pub fn close(panel: P) -> Self`. Builds [`Action::Close`]. @@ -475,6 +475,7 @@ The dock model: the tree of splits over panel frames, the side of a group a drop - `pub fn resize_column(panel: P, width: f32) -> Self`. Builds [`Action::ResizeColumn`]. - `pub fn resize_group(panel: P, height: Option) -> Self`. Builds [`Action::ResizeGroup`]. - `pub fn resize_flyout_width(panel: P, width: Option) -> Self`. Builds [`Action::ResizeFlyoutWidth`]. + - `pub fn move_flyout_top(panel: P, offset: Option) -> Self`. Builds [`Action::MoveFlyoutTop`]. - `pub fn resize_iconic(panel: P, width: Option) -> Self`. Builds [`Action::ResizeIconic`]. - `pub fn set_native(panel: P, placement: Option) -> Self`. Builds [`Action::SetNative`]. - `pub fn move_panel(panel: P, to: Target

) -> Self`. Builds [`Action::MovePanel`]. @@ -510,12 +511,13 @@ The dock model: the tree of splits over panel frames, the side of a group a drop - `pub fn stack(groups: Vec>, rect: Rect) -> Option`. Groups stacked top to bottom, as a v1 layout stored them: each group over a vertical - `pub fn groups(&self) -> Vec> where P: Clone,`. The window's groups, first to last. - `pub fn contains(&self, panel: &Q) -> bool where P: std::borrow::Borrow,`. True when a group of this window holds `panel`. Takes any borrowed form of `P`, such -- `craft_behavior::dock::Group`: `pub struct Group

{ pub panels: Vec

, pub active: usize, pub minimized: bool, pub height: Option, pub flyout_width: Option }`. Tabs that move, minimize and size together in a dock column. - - `pub fn new(panels: Vec

, active: usize) -> Self`. A group of `panels` with tab `active` selected, expanded and with no preferred height or flyout width. +- `craft_behavior::dock::Group`: `pub struct Group

{ pub panels: Vec

, pub active: usize, pub minimized: bool, pub height: Option, pub flyout_width: Option, pub flyout_offset: Option }`. Tabs that move, minimize and size together in a dock column. + - `pub fn new(panels: Vec

, active: usize) -> Self`. A group of `panels` with tab `active` selected, expanded and with no preferred height or flyout geometry. - `pub fn active_panel(&self) -> Option<&P>`. The selected panel, or `None` when `active` is out of range. -- `craft_behavior::dock::GroupLocation`: `pub struct GroupLocation { pub minimized: bool, pub height: Option, pub flyout_width: Option, pub column: Option }`. The group a closed panel was in, when that group was in a dock. +- `craft_behavior::dock::GroupLocation`: `pub struct GroupLocation { pub minimized: bool, pub height: Option, pub flyout_width: Option, pub flyout_offset: Option, pub column: Option }`. The group a closed panel was in, when that group was in a dock. - `pub const fn new(minimized: bool, height: Option, column: Option) -> Self`. A group location with the given state and column. - `pub const fn with_flyout_width(mut self, width: Option) -> Self`. The location with the group's flyout `width` points wide. + - `pub const fn with_flyout_offset(mut self, offset: Option) -> Self`. The location with the group's flyout top `offset` points from its icons' top. - `craft_behavior::dock::Layout`: `pub struct Layout

{ pub root: Option>, pub floating: Vec> }`. The panels of a workspace: a docked tree plus floating windows. Every panel occurs once. - `pub fn new(root: Option>, floating: Vec>) -> Self`. A layout with the docked tree `root` and the floating windows `floating`. - `pub fn validate(&self) -> Result<(), DockError>`. Check depth, allocation bounds, geometry, selection, globally unique panel ownership and