pub enum InsetsGeometry {
Physical(Insets),
Directional(InsetsDirectional),
}Expand description
Insets that are either physical (Insets) or directional
(InsetsDirectional). A widget accepts either one — or one number for all four sides —
through Into, and resolves it against the reading direction at layout time.
Variants§
Physical(Insets)
Physical insets, with absolute left and right.
Directional(InsetsDirectional)
Directional insets (start/end, mirrored in a right-to-left script).
Implementations§
Source§impl InsetsGeometry
impl InsetsGeometry
Sourcepub fn resolve(self, direction: TextDirection) -> Insets
pub fn resolve(self, direction: TextDirection) -> Insets
Resolves to physical insets for a reading direction; physical ones are returned unchanged.
Sourcepub fn laid_out(self, direction: TextDirection) -> Insets
pub fn laid_out(self, direction: TextDirection) -> Insets
The insets to lay a box out with, in a frame laid out left to right and then mirrored as a whole for a right-to-left script — which is how frus lays out.
A directional inset is resolved as if left to right: the mirror puts its start on the right. A physical one is swapped beforehand in a right-to-left script, so that the mirror puts it back on the side it names: a left inset is on the left in Arabic too.
Trait Implementations§
Source§impl Clone for InsetsGeometry
impl Clone for InsetsGeometry
impl Copy for InsetsGeometry
Source§impl Debug for InsetsGeometry
impl Debug for InsetsGeometry
Source§impl From<Insets> for InsetsGeometry
impl From<Insets> for InsetsGeometry
Source§impl From<InsetsDirectional> for InsetsGeometry
impl From<InsetsDirectional> for InsetsGeometry
Source§fn from(insets: InsetsDirectional) -> Self
fn from(insets: InsetsDirectional) -> Self
Source§impl From<f32> for InsetsGeometry
One number: the same inset on all four sides.
impl From<f32> for InsetsGeometry
One number: the same inset on all four sides.