pub struct WindowEdgeInsets {
pub left: f64,
pub top: f64,
pub right: f64,
pub bottom: f64,
}Expand description
The inset vocabulary LayoutCtx::window_insets/PaintCtx::window_insets
return — lifted because a widget that lays itself out around the status
bar, notch, or on-screen keyboard cannot otherwise name the value those
accessors hand it. A bar laying out around the iPadOS window control
names the corner value, CornerInsets.
Per-edge inset amounts, in logical pixels.
The framework-core counterpart of frust-widgets’ layout EdgeInsets
(that one is a Padding container’s spacing; this one is the platform
occlusion model — a different layer, so it is not reused). Every value is a
non-negative logical-px distance from the corresponding window edge.
Fields§
§left: f64Inset from the left edge.
top: f64Inset from the top edge.
right: f64Inset from the right edge.
bottom: f64Inset from the bottom edge.
Implementations§
Source§impl EdgeInsets
impl EdgeInsets
Sourcepub const ZERO: EdgeInsets
pub const ZERO: EdgeInsets
The zero inset — no occlusion on any edge (the default, and the value a
WindowInsets carries until a shell pushes a real one).
Sourcepub fn new(left: f64, top: f64, right: f64, bottom: f64) -> EdgeInsets
pub fn new(left: f64, top: f64, right: f64, bottom: f64) -> EdgeInsets
Construct per-edge insets directly.
Sourcepub fn max(self, other: EdgeInsets) -> EdgeInsets
pub fn max(self, other: EdgeInsets) -> EdgeInsets
Per-edge maximum of self and other.
Mirrors Flutter’s engine-side merge of Type.systemBars() with the
display cutout (FlutterView.java:751-793): a shell that assembles its
view_padding from several platform inset sources combines them per edge
with this rather than summing.
Sourcepub fn saturating_sub(self, other: EdgeInsets) -> EdgeInsets
pub fn saturating_sub(self, other: EdgeInsets) -> EdgeInsets
Per-edge saturating subtraction: max(0.0, self.edge - other.edge) for
each edge, clamping a would-be-negative result to zero.
This is the building block of WindowInsets::padding (Flutter’s
padding = max(0.0, viewPadding - viewInsets),
media_query.dart:152-170): where the IME (view_insets) fully covers a
system-bar edge (view_padding), the derived safe-area padding for that
edge collapses to zero rather than going negative.
Trait Implementations§
Source§impl Clone for EdgeInsets
impl Clone for EdgeInsets
Source§fn clone(&self) -> EdgeInsets
fn clone(&self) -> EdgeInsets
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for EdgeInsets
Source§impl Debug for EdgeInsets
impl Debug for EdgeInsets
Source§impl Default for EdgeInsets
impl Default for EdgeInsets
Source§fn default() -> EdgeInsets
fn default() -> EdgeInsets
Source§impl PartialEq for EdgeInsets
impl PartialEq for EdgeInsets
impl StructuralPartialEq for EdgeInsets
Auto Trait Implementations§
impl Freeze for EdgeInsets
impl RefUnwindSafe for EdgeInsets
impl Send for EdgeInsets
impl Sync for EdgeInsets
impl Unpin for EdgeInsets
impl UnsafeUnpin for EdgeInsets
impl UnwindSafe for EdgeInsets
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<T> Brush for T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.