pub struct StyledPanelFrame { /* private fields */ }Expand description
Styled panel frame builder
Creates consistent outer (gap) and inner (content) frames for panels. Handles selective corner rounding patterns where panels meet.
§Example
// Method 1: Show both frames with content
egui::CentralPanel::default().show(ui, |ui| {
StyledPanelFrame::left(ui).show(ui, |ui| {
ui.label("Panel content");
});
});
// Method 2: Get frames separately (for a side panel)
let frame = StyledPanelFrame::left(ui);
egui::Panel::left("left")
.frame(frame.outer_frame())
.show(ui, |ui| {
frame.inner_frame().show(ui, |ui| {
ui.label("Panel content");
});
});Implementations§
Source§impl StyledPanelFrame
impl StyledPanelFrame
Sourcepub fn left(ui: &Ui) -> Self
pub fn left(ui: &Ui) -> Self
Create a left panel frame (drawing toolbar)
Rounded: top-right corner only
Sourcepub fn right_widget_bar(ui: &Ui) -> Self
pub fn right_widget_bar(ui: &Ui) -> Self
Create a right widget bar frame (icon tabs)
Rounded: top-left corner only
Sourcepub fn right_content(ui: &Ui) -> Self
pub fn right_content(ui: &Ui) -> Self
Create a right content panel frame (alerts, object tree, etc.)
Rounded: top-left corner only
Sourcepub fn chart(ui: &Ui, chart_bg: Color32) -> Self
pub fn chart(ui: &Ui, chart_bg: Color32) -> Self
Create a central chart area frame
Rounded: top-left and top-right corners
Sourcepub fn outer_frame(&self) -> Frame
pub fn outer_frame(&self) -> Frame
Get the outer frame (gap color with margins)
Panel layout: gaps are created by panel margins
- Top toolbar: bottom margin (gap below toolbar)
- Side panels: horizontal margins only (NO top margin)
- Chart: no margins (gaps from surrounding panels)
Sourcepub fn inner_frame(&self) -> Frame
pub fn inner_frame(&self) -> Frame
Get the inner frame (panel bg with selective rounding)
Auto Trait Implementations§
impl Freeze for StyledPanelFrame
impl RefUnwindSafe for StyledPanelFrame
impl Send for StyledPanelFrame
impl Sync for StyledPanelFrame
impl Unpin for StyledPanelFrame
impl UnsafeUnpin for StyledPanelFrame
impl UnwindSafe for StyledPanelFrame
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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 more