Enum egui_dock::dock_state::surface::Surface
source · pub enum Surface<Tab> {
Empty,
Main(Tree<Tab>),
Window(Tree<Tab>, WindowState),
}
Expand description
A Surface
is the highest level component in a DockState
. Surface
s represent an area
in which nodes are placed. Typically, you’re only using one surface, which is the main surface. However, if you drag
a tab out in a way which creates a window, you also create a new surface in which nodes can appear.
Variants§
Empty
An empty surface, with nothing inside (practically, a null surface).
Main(Tree<Tab>)
The main surface of a DockState
, only one should exist at surface index 0 at any one time.
Window(Tree<Tab>, WindowState)
A windowed surface with a state.
Implementations§
source§impl<Tab> Surface<Tab>
impl<Tab> Surface<Tab>
sourcepub fn node_tree_mut(&mut self) -> Option<&mut Tree<Tab>>
pub fn node_tree_mut(&mut self) -> Option<&mut Tree<Tab>>
Get mutable access to the node tree of this surface.
sourcepub fn iter_nodes(&self) -> impl Iterator<Item = &Node<Tab>>
pub fn iter_nodes(&self) -> impl Iterator<Item = &Node<Tab>>
sourcepub fn iter_nodes_mut(&mut self) -> impl Iterator<Item = &mut Node<Tab>>
pub fn iter_nodes_mut(&mut self) -> impl Iterator<Item = &mut Node<Tab>>
sourcepub fn iter_all_tabs(&self) -> impl Iterator<Item = (NodeIndex, &Tab)>
pub fn iter_all_tabs(&self) -> impl Iterator<Item = (NodeIndex, &Tab)>
Returns an Iterator
of all tabs in this surface’s tree,
and indices of containing nodes.
sourcepub fn iter_all_tabs_mut(
&mut self
) -> impl Iterator<Item = (NodeIndex, &mut Tab)>
pub fn iter_all_tabs_mut( &mut self ) -> impl Iterator<Item = (NodeIndex, &mut Tab)>
Returns a mutable Iterator
of all tabs in this surface’s tree,
and indices of containing nodes.
sourcepub fn filter_map_tabs<F, NewTab>(&self, function: F) -> Surface<NewTab>
pub fn filter_map_tabs<F, NewTab>(&self, function: F) -> Surface<NewTab>
Returns a new Surface
while mapping and filtering the tab type.
Any remaining empty Node
s and are removed, and if this Surface
remains empty,
it’ll change to Surface::Empty
.
sourcepub fn map_tabs<F, NewTab>(&self, function: F) -> Surface<NewTab>
pub fn map_tabs<F, NewTab>(&self, function: F) -> Surface<NewTab>
Returns a new Surface
while mapping the tab type.
sourcepub fn filter_tabs<F>(&self, predicate: F) -> Surface<Tab>
pub fn filter_tabs<F>(&self, predicate: F) -> Surface<Tab>
Returns a new Surface
while filtering the tab type.
Any remaining empty Node
s and are removed, and if this Surface
remains empty,
it’ll change to Surface::Empty
.
sourcepub fn retain_tabs<F>(&mut self, predicate: F)
pub fn retain_tabs<F>(&mut self, predicate: F)
Removes all tabs for which predicate
returns false
.
Any remaining empty Node
s and are also removed, and if this Surface
remains empty,
it’ll change to Surface::Empty
.