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.
pub fn next_free_id(&mut self) -> TileId
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>,
Auto Trait Implementations§
impl<Pane> Freeze for Tiles<Pane>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more