Struct egui_tiles::Tiles
source · 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(root, tiles);
Implementations§
source§impl<Pane> Tiles<Pane>
impl<Pane> Tiles<Pane>
pub fn get(&self, tile_id: TileId) -> Option<&Tile<Pane>>
pub fn get_mut(&mut self, tile_id: TileId) -> Option<&mut Tile<Pane>>
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 Tile
s 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 insert(&mut self, id: TileId, tile: Tile<Pane>)
pub fn remove(&mut self, id: TileId) -> Option<Tile<Pane>>
sourcepub fn remove_recursively(&mut self, id: TileId) -> Vec<Tile<Pane>>
pub fn remove_recursively(&mut self, id: TileId) -> Vec<Tile<Pane>>
Remove the given tile and all child tiles, recursively.
All removed tiles are returned in unspecified order.
pub fn insert_new(&mut self, tile: Tile<Pane>) -> TileId
pub fn insert_pane(&mut self, pane: Pane) -> TileId
pub fn insert_container(&mut self, container: impl Into<Container>) -> TileId
pub fn insert_tab_tile(&mut self, children: Vec<TileId>) -> TileId
pub fn insert_horizontal_tile(&mut self, children: Vec<TileId>) -> TileId
pub fn insert_vertical_tile(&mut self, children: Vec<TileId>) -> TileId
pub fn insert_grid_tile(&mut self, children: Vec<TileId>) -> TileId
pub fn parent_of(&self, child_id: TileId) -> Option<TileId>
pub fn is_root(&self, tile_id: TileId) -> bool
Trait Implementations§
source§impl<'de, Pane> Deserialize<'de> for Tiles<Pane>where
Pane: Deserialize<'de>,
impl<'de, Pane> Deserialize<'de> for Tiles<Pane>where Pane: Deserialize<'de>,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl<Pane> RefUnwindSafe for Tiles<Pane>where Pane: RefUnwindSafe,
impl<Pane> Send for Tiles<Pane>where Pane: Send,
impl<Pane> Sync for Tiles<Pane>where Pane: Sync,
impl<Pane> Unpin for Tiles<Pane>where Pane: Unpin,
impl<Pane> UnwindSafe for Tiles<Pane>where Pane: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more