pub struct Dock { /* private fields */ }Expand description
Panels docked left, right, bottom and as center tabs. Every panel holds a node, so grids and forms keep working wherever the user moves them.
Users resize the side areas with the pointer or, on the focused divider, with the arrow keys
(Home and End jump to the limits); move between the tabs of an area with Left and Right;
close the focused panel with Delete; and open the panel options (the area’s button,
Shift+F10 or the context menu key) to move a panel to another area, close it or show a
closed one. Tabs can also be dragged between areas. Add super::MenuList::panels to a menu
bar to show and hide panels from there. The layout is saved per user and screen in the
app’s view store (App::datagrid_views), or in the browser without one.
Dock::new("Workspace")
.left("files", "Files", tree)
.center("orders", "Orders", grid)
.center("chart", "Chart", chart)
.bottom("log", "Log", log_grid)
.right("props", "Properties", inspector)Implementations§
Source§impl Dock
impl Dock
Sourcepub fn new(label: impl Into<Text>) -> Self
pub fn new(label: impl Into<Text>) -> Self
A dock with an accessible name, such as “Workspace”.
Sourcepub fn panel(
self,
area: DockArea,
id: &'static str,
title: impl Into<Text>,
node: impl Into<Node>,
) -> Self
pub fn panel( self, area: DockArea, id: &'static str, title: impl Into<Text>, node: impl Into<Node>, ) -> Self
Adds a panel. id names it in saved layouts: keep it stable, lower case, unique in the
dock.
pub fn left( self, id: &'static str, title: impl Into<Text>, node: impl Into<Node>, ) -> Self
pub fn right( self, id: &'static str, title: impl Into<Text>, node: impl Into<Node>, ) -> Self
pub fn bottom( self, id: &'static str, title: impl Into<Text>, node: impl Into<Node>, ) -> Self
pub fn center( self, id: &'static str, title: impl Into<Text>, node: impl Into<Node>, ) -> Self
Trait Implementations§
Source§impl Component for Dock
impl Component for Dock
fn render(&self, out: &mut String, r: &Render<'_>)
Source§fn children(&self) -> &[Node]
fn children(&self) -> &[Node]
i of the node at path p has the path p.i.fn grid(&self) -> Option<&dyn GridSource>
fn form(&self) -> Option<&dyn FormSource>
Source§fn reveal(&self, _field: &str) -> Option<Revealed>
fn reveal(&self, _field: &str) -> Option<Revealed>
Source§fn import(&self) -> Option<&dyn ImportSource>
fn import(&self) -> Option<&dyn ImportSource>
crate::Import).