Struct me3_framework::overlay::containers::TopBottomPanel
source · [−]pub struct TopBottomPanel { /* private fields */ }
Expand description
A panel that covers the entire top or bottom 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::TopBottomPanel::top("my_panel").show(ctx, |ui| {
ui.label("Hello World!");
});
See also SidePanel
.
Implementations
sourceimpl TopBottomPanel
impl TopBottomPanel
sourcepub fn top(id_source: impl Hash) -> TopBottomPanel
pub fn top(id_source: impl Hash) -> TopBottomPanel
id_source
: Something unique, e.g. "my_top_panel"
.
sourcepub fn bottom(id_source: impl Hash) -> TopBottomPanel
pub fn bottom(id_source: impl Hash) -> TopBottomPanel
id_source
: Something unique, e.g. "my_bottom_panel"
.
sourcepub fn new(side: TopBottomSide, id_source: impl Hash) -> TopBottomPanel
pub fn new(side: TopBottomSide, id_source: impl Hash) -> TopBottomPanel
id_source
: Something unique, e.g. "my_panel"
.
sourcepub fn resizable(self, resizable: bool) -> TopBottomPanel
pub fn resizable(self, resizable: bool) -> TopBottomPanel
Can panel be resized by dragging the edge of it?
Default is false
.
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_height(self, default_height: f32) -> TopBottomPanel
pub fn default_height(self, default_height: f32) -> TopBottomPanel
The initial height of the SidePanel
.
Defaults to style::Spacing::interact_size
.y.
pub fn min_height(self, min_height: f32) -> TopBottomPanel
pub fn max_height(self, max_height: f32) -> TopBottomPanel
sourcepub fn height_range(self, height_range: RangeInclusive<f32>) -> TopBottomPanel
pub fn height_range(self, height_range: RangeInclusive<f32>) -> TopBottomPanel
The allowable height range for resizable panels.
sourcepub fn frame(self, frame: Frame) -> TopBottomPanel
pub fn frame(self, frame: Frame) -> TopBottomPanel
Change the background color, margins, etc.
sourceimpl TopBottomPanel
impl TopBottomPanel
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
.