Struct egui::containers::frame::Frame

source ·
pub struct Frame {
    pub inner_margin: Margin,
    pub outer_margin: Margin,
    pub rounding: Rounding,
    pub shadow: Shadow,
    pub fill: Color32,
    pub stroke: Stroke,
}
Expand description

Add a background, frame and/or margin to a rectangular background of a Ui.

egui::Frame::none()
    .fill(egui::Color32::RED)
    .show(ui, |ui| {
        ui.label("Label with red background");
    });

Fields§

§inner_margin: Margin

Margin within the painted frame.

§outer_margin: Margin

Margin outside the painted frame.

§rounding: Rounding§shadow: Shadow§fill: Color32§stroke: Stroke

Implementations§

source§

impl Frame

source

pub fn none() -> Self

source

pub fn group(style: &Style) -> Self

For when you want to group a few widgets together within a frame.

source

pub fn side_top_panel(style: &Style) -> Self

source

pub fn central_panel(style: &Style) -> Self

source

pub fn window(style: &Style) -> Self

source

pub fn menu(style: &Style) -> Self

source

pub fn popup(style: &Style) -> Self

source

pub fn canvas(style: &Style) -> Self

A canvas to draw on.

In bright mode this will be very bright, and in dark mode this will be very dark.

source

pub fn dark_canvas(style: &Style) -> Self

A dark canvas to draw on.

source§

impl Frame

source

pub fn fill(self, fill: Color32) -> Self

source

pub fn stroke(self, stroke: Stroke) -> Self

source

pub fn rounding(self, rounding: impl Into<Rounding>) -> Self

source

pub fn inner_margin(self, inner_margin: impl Into<Margin>) -> Self

Margin within the painted frame.

source

pub fn outer_margin(self, outer_margin: impl Into<Margin>) -> Self

Margin outside the painted frame.

source

pub fn margin(self, margin: impl Into<Margin>) -> Self

👎Deprecated: Renamed inner_margin in egui 0.18
source

pub fn shadow(self, shadow: Shadow) -> Self

source

pub fn multiply_with_opacity(self, opacity: f32) -> Self

source§

impl Frame

source

pub fn total_margin(&self) -> Margin

inner margin plus outer margin.

source§

impl Frame

source

pub fn begin(self, ui: &mut Ui) -> Prepared

source

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

source

fn show_dyn<'c, R>( self, ui: &mut Ui, add_contents: Box<dyn FnOnce(&mut Ui) -> R + 'c> ) -> InnerResponse<R>

source

pub fn paint(&self, outer_rect: Rect) -> Shape

Trait Implementations§

source§

impl Clone for Frame

source§

fn clone(&self) -> Frame

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Frame

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Frame

source§

fn default() -> Frame

Returns the “default value” for a type. Read more
source§

impl PartialEq<Frame> for Frame

source§

fn eq(&self, other: &Frame) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for Frame

source§

impl StructuralPartialEq for Frame

Auto Trait Implementations§

§

impl RefUnwindSafe for Frame

§

impl Send for Frame

§

impl Sync for Frame

§

impl Unpin for Frame

§

impl UnwindSafe for Frame

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere 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> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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 Twhere U: TryFrom<T>,

§

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.
source§

impl<T> SerializableAny for Twhere T: 'static + Any + Clone + Send + Sync,