Browse Source

Add Frame setters for rounding, margin and shadow

pull/563/head
Emil Ernerfeldt 3 years ago
parent
commit
06fc9afb1d
  1. 16
      egui/src/containers/frame.rs

16
egui/src/containers/frame.rs

@ -103,6 +103,22 @@ impl Frame {
self
}
pub fn corner_radius(mut self, corner_radius: f32) -> Self {
self.corner_radius = corner_radius;
self
}
/// Margin on each side of the frame.
pub fn margin(mut self, margin: impl Into<Vec2>) -> Self {
self.margin = margin.into();
self
}
pub fn shadow(mut self, shadow: Shadow) -> Self {
self.shadow = shadow;
self
}
pub fn multiply_with_opacity(mut self, opacity: f32) -> Self {
self.fill = self.fill.linear_multiply(opacity);
self.stroke.color = self.stroke.color.linear_multiply(opacity);

Loading…
Cancel
Save