pub struct Tiles<Pane> { /* private fields */ }Expand description
Contains all tile state, but no root.
use egui_tiles::{Tiles, TileId, Tree};
struct Pane { } // put some state here
let mut tiles = Tiles::default();
let tabs: Vec<TileId> = vec![tiles.insert_pane(Pane { }), tiles.insert_pane(Pane { })];
let root: TileId = tiles.insert_tab_tile(tabs);
let tree = Tree::new("my_tree", root, tiles);Implementations§
Source§impl<Pane> Tiles<Pane>
impl<Pane> Tiles<Pane>
pub fn is_empty(&self) -> bool
pub fn get(&self, tile_id: TileId) -> Option<&Tile<Pane>>
Sourcepub fn get_pane(&self, tile_id: &TileId) -> Option<&Pane>
pub fn get_pane(&self, tile_id: &TileId) -> Option<&Pane>
Get the pane instance for a given TileId
Sourcepub fn get_container(&self, tile_id: TileId) -> Option<&Container>
pub fn get_container(&self, tile_id: TileId) -> Option<&Container>
Get the container instance for a given TileId
pub fn get_mut(&mut self, tile_id: TileId) -> Option<&mut Tile<Pane>>
Sourcepub fn rect(&self, tile_id: TileId) -> Option<Rect>
pub fn rect(&self, tile_id: TileId) -> Option<Rect>
Get the screen-space rectangle of where a tile is shown.
This is updated by crate::Tree::ui, so you need to call that first.
If the tile isn’t visible, or is in an inactive tab, this return None.
Sourcepub fn iter(&self) -> impl Iterator<Item = (&TileId, &Tile<Pane>)> + '_
pub fn iter(&self) -> impl Iterator<Item = (&TileId, &Tile<Pane>)> + '_
All tiles, in arbitrary order
Sourcepub fn iter_mut(
&mut self,
) -> impl Iterator<Item = (&TileId, &mut Tile<Pane>)> + '_
pub fn iter_mut( &mut self, ) -> impl Iterator<Item = (&TileId, &mut Tile<Pane>)> + '_
All tiles, in arbitrary order
Sourcepub fn tiles_mut(&mut self) -> impl Iterator<Item = &mut Tile<Pane>> + '_
pub fn tiles_mut(&mut self) -> impl Iterator<Item = &mut Tile<Pane>> + '_
All Tiles in arbitrary order
Sourcepub fn is_visible(&self, tile_id: TileId) -> bool
pub fn is_visible(&self, tile_id: TileId) -> bool
Tiles are visible by default.
Invisible tiles still retain their place in the tile hierarchy.
Sourcepub fn set_visible(&mut self, tile_id: TileId, visible: bool)
pub fn set_visible(&mut self, tile_id: TileId, visible: bool)
Tiles are visible by default.
Invisible tiles still retain their place in the tile hierarchy.
pub fn toggle_visibility(&mut self, tile_id: TileId)
pub fn insert(&mut self, id: TileId, tile: Tile<Pane>)
Sourcepub fn remove(&mut self, id: TileId) -> Option<Tile<Pane>>
pub fn remove(&mut self, id: TileId) -> Option<Tile<Pane>>
Remove the tile with the given id from the tiles container.
Note that this does not actually remove the tile from the tree and may
leave dangling references. If you want to permanently remove the tile
consider calling crate::Tree::remove_recursively.