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§
source§impl 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 side_top_panel(style: &Style) -> Self
pub fn central_panel(style: &Style) -> Self
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.
source§impl 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