Struct egui::containers::panel::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.
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 bottom(id_source: impl Hash) -> Self
pub fn bottom(id_source: impl Hash) -> Self
id_source
: Something unique, e.g. "my_bottom_panel"
.
sourcepub fn new(side: TopBottomSide, id_source: impl Hash) -> Self
pub fn new(side: TopBottomSide, id_source: impl Hash) -> Self
id_source
: Something unique, e.g. "my_panel"
.
sourcepub fn resizable(self, resizable: bool) -> Self
pub fn resizable(self, resizable: bool) -> Self
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) -> Self
pub fn default_height(self, default_height: f32) -> Self
The initial height of the SidePanel
.
Defaults to style::Spacing::interact_size
.y.
pub fn min_height(self, min_height: f32) -> Self
pub fn max_height(self, max_height: f32) -> Self
sourcepub fn height_range(self, height_range: RangeInclusive<f32>) -> Self
pub fn height_range(self, height_range: RangeInclusive<f32>) -> Self
The allowable height range for resizable panels.
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
.
Auto Trait Implementations
impl RefUnwindSafe for TopBottomPanel
impl Send for TopBottomPanel
impl Sync for TopBottomPanel
impl Unpin for TopBottomPanel
impl UnwindSafe for TopBottomPanel
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn 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>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more