Skip to main content

StyledPanelFrame

Struct StyledPanelFrame 

Source
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

Source

pub fn left(ui: &Ui) -> Self

Create a left panel frame (drawing toolbar)

Rounded: top-right corner only

Source

pub fn right_widget_bar(ui: &Ui) -> Self

Create a right widget bar frame (icon tabs)

Rounded: top-left corner only

Source

pub fn right_content(ui: &Ui) -> Self

Create a right content panel frame (alerts, object tree, etc.)

Rounded: top-left corner only

Source

pub fn top(ui: &Ui) -> Self

Create a top panel frame (toolbar)

No rounding - spans full width

Source

pub fn bottom(ui: &Ui) -> Self

Create a bottom panel frame (timeline)

No rounding

Source

pub fn chart(ui: &Ui, chart_bg: Color32) -> Self

Create a central chart area frame

Rounded: top-left and top-right corners

Source

pub fn gap_color(self, color: Color32) -> Self

Override the gap color

Source

pub fn panel_bg(self, color: Color32) -> Self

Override the panel background color

Source

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)
Source

pub fn inner_frame(&self) -> Frame

Get the inner frame (panel bg with selective rounding)

Source

pub fn show<R>( self, ui: &mut Ui, content: impl FnOnce(&mut Ui) -> R, ) -> InnerResponse<R>

Show both outer and inner frames with content

This is a convenience method that nests the frames correctly.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> MaybeSend for T
where T: Send + Sync + ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

§

fn simd_from(_simd: S, value: T) -> T

§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

§

fn simd_into(self, simd: S) -> T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.