Struct re_viewport::viewport::TabViewer
source · struct TabViewer<'a, 'b> {
view_states: &'a mut ViewStates,
ctx: &'a ViewerContext<'b>,
viewport_blueprint: &'a ViewportBlueprint,
maximized: &'a mut Option<SpaceViewId>,
root_container_id: ContainerId,
tree_action_sender: Sender<TreeAction>,
executed_systems_per_space_view: HashMap<SpaceViewId, (ViewQuery<'a>, SystemExecutionOutput)>,
contents_per_tile_id: HashMap<TileId, Contents>,
edited: bool,
}
Expand description
egui_tiles
has tiles which are either containers or panes.
In our case, each pane is a space view, while containers are just groups of things.
Fields§
§view_states: &'a mut ViewStates
§ctx: &'a ViewerContext<'b>
§viewport_blueprint: &'a ViewportBlueprint
§maximized: &'a mut Option<SpaceViewId>
§root_container_id: ContainerId
§tree_action_sender: Sender<TreeAction>
§executed_systems_per_space_view: HashMap<SpaceViewId, (ViewQuery<'a>, SystemExecutionOutput)>
List of query & system execution results for each space view.
contents_per_tile_id: HashMap<TileId, Contents>
List of contents for each tile id
edited: bool
The user edited the tree.
Trait Implementations§
source§impl<'a, 'b> Behavior<BlueprintId<SpaceViewIdRegistry>> for TabViewer<'a, 'b>
impl<'a, 'b> Behavior<BlueprintId<SpaceViewIdRegistry>> for TabViewer<'a, 'b>
source§fn drag_preview_stroke(&self, _visuals: &Visuals) -> Stroke
fn drag_preview_stroke(&self, _visuals: &Visuals) -> Stroke
When drag-and-dropping a tile, the candidate area is drawn with this stroke.
source§fn drag_preview_color(&self, _visuals: &Visuals) -> Color32
fn drag_preview_color(&self, _visuals: &Visuals) -> Color32
When drag-and-dropping a tile, the candidate area is drawn with this background color.
source§fn tab_bar_height(&self, _style: &Style) -> f32
fn tab_bar_height(&self, _style: &Style) -> f32
The height of the bar holding tab titles.
source§fn simplification_options(&self) -> SimplificationOptions
fn simplification_options(&self) -> SimplificationOptions
What are the rules for simplifying the tree?
These options are applied on every frame by egui_tiles
.
source§fn pane_ui(
&mut self,
ui: &mut Ui,
_tile_id: TileId,
view_id: &mut SpaceViewId
) -> UiResponse
fn pane_ui( &mut self, ui: &mut Ui, _tile_id: TileId, view_id: &mut SpaceViewId ) -> UiResponse
Show a pane tile in the given [
egui::Ui
]. Read moresource§fn tab_title_for_pane(&mut self, space_view_id: &SpaceViewId) -> WidgetText
fn tab_title_for_pane(&mut self, space_view_id: &SpaceViewId) -> WidgetText
The title of a pane tab.
source§fn tab_ui(
&mut self,
tiles: &mut Tiles<SpaceViewId>,
ui: &mut Ui,
id: Id,
tile_id: TileId,
tab_state: &TabState
) -> Response
fn tab_ui( &mut self, tiles: &mut Tiles<SpaceViewId>, ui: &mut Ui, id: Id, tile_id: TileId, tab_state: &TabState ) -> Response
Show the ui for the a tab of some tile. Read more
source§fn drag_ui(&mut self, tiles: &Tiles<SpaceViewId>, ui: &mut Ui, tile_id: TileId)
fn drag_ui(&mut self, tiles: &Tiles<SpaceViewId>, ui: &mut Ui, tile_id: TileId)
Show the ui for the tab being dragged.
source§fn retain_pane(&mut self, space_view_id: &SpaceViewId) -> bool
fn retain_pane(&mut self, space_view_id: &SpaceViewId) -> bool
Return
false
if a given pane should be removed from its parent.source§fn top_bar_right_ui(
&mut self,
tiles: &Tiles<SpaceViewId>,
ui: &mut Ui,
_tile_id: TileId,
tabs: &Tabs,
_scroll_offset: &mut f32
)
fn top_bar_right_ui( &mut self, tiles: &Tiles<SpaceViewId>, ui: &mut Ui, _tile_id: TileId, tabs: &Tabs, _scroll_offset: &mut f32 )
Adds some UI to the top right of each tab bar. Read more
source§fn tab_bar_color(&self, _visuals: &Visuals) -> Color32
fn tab_bar_color(&self, _visuals: &Visuals) -> Color32
The background color of the tab bar.
source§fn dragged_overlay_color(&self, visuals: &Visuals) -> Color32
fn dragged_overlay_color(&self, visuals: &Visuals) -> Color32
Cover the tile that is being dragged with this color.
source§fn on_edit(&mut self, edit_action: EditAction)
fn on_edit(&mut self, edit_action: EditAction)
Called if the user edits the tree somehow, e.g. changes the size of some container,
clicks a tab, or drags a tile.
§fn is_tab_closable(&self, _tiles: &Tiles<Pane>, _tile_id: TileId) -> bool
fn is_tab_closable(&self, _tiles: &Tiles<Pane>, _tile_id: TileId) -> bool
Should the tab have a close-button?
§fn on_tab_close(&mut self, _tiles: &mut Tiles<Pane>, _tile_id: TileId) -> bool
fn on_tab_close(&mut self, _tiles: &mut Tiles<Pane>, _tile_id: TileId) -> bool
Called when the close-button on a tab is pressed. Read more
The size of the close button in the tab.
How much smaller the visual part of the close-button will be
compared to [
Self::close_button_outer_size
].§fn tab_title_for_tile(
&mut self,
tiles: &Tiles<Pane>,
tile_id: TileId
) -> WidgetText
fn tab_title_for_tile( &mut self, tiles: &Tiles<Pane>, tile_id: TileId ) -> WidgetText
The title of a general tab. Read more
Called by the default implementation of [
Self::tab_ui
] for each added button§fn gap_width(&self, _style: &Style) -> f32
fn gap_width(&self, _style: &Style) -> f32
Width of the gap between tiles in a horizontal or vertical layout,
and between rows/columns in a grid layout.
§fn preview_dragged_panes(&self) -> bool
fn preview_dragged_panes(&self) -> bool
Show we preview panes that are being dragged,
i.e. show their ui in the region where they will end up?
§fn paint_on_top_of_tile(
&self,
_painter: &Painter,
_style: &Style,
_tile_id: TileId,
_rect: Rect
)
fn paint_on_top_of_tile( &self, _painter: &Painter, _style: &Style, _tile_id: TileId, _rect: Rect )
Add some custom painting on top of a tile (container or pane), e.g. draw an outline on top of it.
§fn resize_stroke(&self, style: &Style, resize_state: ResizeState) -> Stroke
fn resize_stroke(&self, style: &Style, resize_state: ResizeState) -> Stroke
The stroke used for the lines in horizontal, vertical, and grid layouts.
§fn tab_title_spacing(&self, _visuals: &Visuals) -> f32
fn tab_title_spacing(&self, _visuals: &Visuals) -> f32
Extra spacing to left and right of tab titles.
§fn tab_bg_color(
&self,
visuals: &Visuals,
_tiles: &Tiles<Pane>,
_tile_id: TileId,
state: &TabState
) -> Color32
fn tab_bg_color( &self, visuals: &Visuals, _tiles: &Tiles<Pane>, _tile_id: TileId, state: &TabState ) -> Color32
The background color of a tab.
§fn tab_outline_stroke(
&self,
visuals: &Visuals,
_tiles: &Tiles<Pane>,
_tile_id: TileId,
state: &TabState
) -> Stroke
fn tab_outline_stroke( &self, visuals: &Visuals, _tiles: &Tiles<Pane>, _tile_id: TileId, state: &TabState ) -> Stroke
Stroke of the outline around a tab title.
§fn tab_bar_hline_stroke(&self, visuals: &Visuals) -> Stroke
fn tab_bar_hline_stroke(&self, visuals: &Visuals) -> Stroke
Stroke of the line separating the tab title bar and the content of the active tab.
§fn tab_text_color(
&self,
visuals: &Visuals,
_tiles: &Tiles<Pane>,
_tile_id: TileId,
state: &TabState
) -> Color32
fn tab_text_color( &self, visuals: &Visuals, _tiles: &Tiles<Pane>, _tile_id: TileId, state: &TabState ) -> Color32
The color of the title text of the tab. Read more
§fn paint_drag_preview(
&self,
visuals: &Visuals,
painter: &Painter,
parent_rect: Option<Rect>,
preview_rect: Rect
)
fn paint_drag_preview( &self, visuals: &Visuals, painter: &Painter, parent_rect: Option<Rect>, preview_rect: Rect )
When drag-and-dropping a tile, how do we preview what is about to happen?
§fn grid_auto_column_count(
&self,
num_visible_children: usize,
rect: Rect,
gap: f32
) -> usize
fn grid_auto_column_count( &self, num_visible_children: usize, rect: Rect, gap: f32 ) -> usize
§fn ideal_tile_aspect_ratio(&self) -> f32
fn ideal_tile_aspect_ratio(&self) -> f32
When using [
crate::GridLayout::Auto
], what is the ideal aspect ratio of a tile?Auto Trait Implementations§
impl<'a, 'b> Freeze for TabViewer<'a, 'b>
impl<'a, 'b> !RefUnwindSafe for TabViewer<'a, 'b>
impl<'a, 'b> Send for TabViewer<'a, 'b>
impl<'a, 'b> Sync for TabViewer<'a, 'b>
impl<'a, 'b> Unpin for TabViewer<'a, 'b>
impl<'a, 'b> !UnwindSafe for TabViewer<'a, 'b>
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
source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Casts the value.
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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 moresource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request
source§impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
source§fn lossless_try_into(self) -> Option<Dst>
fn lossless_try_into(self) -> Option<Dst>
Performs the conversion.
source§impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
source§fn lossy_into(self) -> Dst
fn lossy_into(self) -> Dst
Performs the conversion.
source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Casts the value.
source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Casts the value.
source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
Casts the value.
source§impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
source§fn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
Casts the value.
source§impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
source§fn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.