pub struct DockState { /* private fields */ }Expand description
the layout of a dock area: kept by the app and passed to dock_begin / dock_next /
dock_end. save() / load() turn it into a few lines of text: dock 1, then side S SIZE COLLAPSED, group S TAG SIZE ACTIVE PANEL..., float SLOT X Y W H HOME HOMETAG ACTIVE PANEL..., hidden PANEL S TAG POS X Y W H HOME HOMETAG (unknown lines are skipped).
Implementations§
Source§impl DockState
impl DockState
Sourcepub fn new() -> DockState
pub fn new() -> DockState
the empty layout: every panel goes to its DockPanel place in the first frame
Sourcepub fn reset(&mut self)
pub fn reset(&mut self)
forget the layout: every panel goes to its DockPanel place in the next frame
Sourcepub fn show(&mut self, id: u32)
pub fn show(&mut self, id: u32)
show a hidden panel where it was, as the shown tab of its group
Sourcepub fn focus(&mut self, id: u32)
pub fn focus(&mut self, id: u32)
show the panel as the shown tab (a collapsed side expands) and give its tab strip the keyboard focus in the next pass (a floating window comes to the front)
Sourcepub fn activate(&mut self, id: u32)
pub fn activate(&mut self, id: u32)
make the panel the shown tab of its group (a collapsed side expands)
Sourcepub fn float(&mut self, id: u32, rect: Option<[i32; 4]>) -> bool
pub fn float(&mut self, id: u32, rect: Option<[i32; 4]>) -> bool
float the panel in a tool window: rect = x, y (DIP from the main window’s client origin), client width, height; None: cascaded from the top left -> false when every floating window of the area is in use
Sourcepub fn dock_to(&mut self, id: u32, side: u8)
pub fn dock_to(&mut self, id: u32, side: u8)
dock the panel to a side, as a new group at its end
Sourcepub fn collapse(&mut self, side: u8, on: bool)
pub fn collapse(&mut self, side: u8, on: bool)
collapse a side to a rail of icon buttons, or expand it
Sourcepub fn size(&self, side: u8) -> i32
pub fn size(&self, side: u8) -> i32
the width (left / right) or the height (bottom) of a side in DIP
Sourcepub fn groups(&self, side: u8) -> Vec<Vec<u32>>
pub fn groups(&self, side: u8) -> Vec<Vec<u32>>
the tab groups of a side from start to end, each with its panels in tab order
the hidden panels
Sourcepub fn side(&self, id: u32) -> Option<u8>
pub fn side(&self, id: u32) -> Option<u8>
where the panel is: DOCK_LEFT / DOCK_RIGHT / DOCK_BOTTOM / DOCK_FLOAT (None: hidden or unknown)