Struct egui::containers::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
sourceimpl Frame
impl Frame
pub fn none() -> Self
sourcepub fn group(style: &Style) -> Self
pub fn group(style: &Style) -> Self
For when you want to group a few widgets together within a frame.
pub fn window(style: &Style) -> Self
pub fn popup(style: &Style) -> Self
sourcepub fn canvas(style: &Style) -> Self
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.
sourcepub fn dark_canvas(style: &Style) -> Self
pub fn dark_canvas(style: &Style) -> Self
A dark canvas to draw on.
sourceimpl Frame
impl Frame
pub fn fill(self, fill: Color32) -> Self
pub fn stroke(self, stroke: Stroke) -> Self
pub fn rounding(self, rounding: impl Into<Rounding>) -> Self
sourcepub fn inner_margin(self, inner_margin: impl Into<Margin>) -> Self
pub fn inner_margin(self, inner_margin: impl Into<Margin>) -> Self
Margin within the painted frame.
sourcepub fn outer_margin(self, outer_margin: impl Into<Margin>) -> Self
pub fn outer_margin(self, outer_margin: impl Into<Margin>) -> Self
Margin outside the painted frame.
pub fn margin(self, margin: impl Into<Margin>) -> Self
👎Deprecated: Renamed inner_margin in egui 0.18
pub fn shadow(self, shadow: Shadow) -> Self
pub fn multiply_with_opacity(self, opacity: f32) -> Self
Trait Implementations
impl Copy for Frame
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more