Struct me3_framework::overlay::containers::SidePanel
source · [−]pub struct SidePanel { /* private fields */ }
Expand description
A panel that covers the entire left or right side of a Ui
or screen.
The order in which you add panels matter! The first panel you add will always be the outermost, and the last you add will always be the innermost.
⚠ Always add any CentralPanel
last.
See the module level docs for more details.
egui::SidePanel::left("my_left_panel").show(ctx, |ui| {
ui.label("Hello World!");
});
See also TopBottomPanel
.
Implementations
sourceimpl SidePanel
impl SidePanel
sourcepub fn left(id_source: impl Hash) -> SidePanel
pub fn left(id_source: impl Hash) -> SidePanel
id_source
: Something unique, e.g. "my_left_panel"
.
sourcepub fn right(id_source: impl Hash) -> SidePanel
pub fn right(id_source: impl Hash) -> SidePanel
id_source
: Something unique, e.g. "my_right_panel"
.
sourcepub fn new(side: Side, id_source: impl Hash) -> SidePanel
pub fn new(side: Side, id_source: impl Hash) -> SidePanel
id_source
: Something unique, e.g. "my_panel"
.
sourcepub fn resizable(self, resizable: bool) -> SidePanel
pub fn resizable(self, resizable: bool) -> SidePanel
Can panel be resized by dragging the edge of it?
Default is true
.
If you want your panel to be resizable you also need a widget in it that takes up more space as you resize it, such as:
- Wrapping text (
Ui::horizontal_wrapped
). - A
ScrollArea
. - A
Separator
. - A
TextEdit
. - …
sourcepub fn default_width(self, default_width: f32) -> SidePanel
pub fn default_width(self, default_width: f32) -> SidePanel
The initial wrapping width of the SidePanel
.
pub fn min_width(self, min_width: f32) -> SidePanel
pub fn max_width(self, max_width: f32) -> SidePanel
sourcepub fn width_range(self, width_range: RangeInclusive<f32>) -> SidePanel
pub fn width_range(self, width_range: RangeInclusive<f32>) -> SidePanel
The allowable width range for resizable panels.
sourceimpl SidePanel
impl SidePanel
sourcepub fn show_inside<R>(
self,
ui: &mut Ui,
add_contents: impl FnOnce(&mut Ui) -> R
) -> InnerResponse<R>
pub fn show_inside<R>(
self,
ui: &mut Ui,
add_contents: impl FnOnce(&mut Ui) -> R
) -> InnerResponse<R>
Show the panel inside a Ui
.