pub trait ViewExt: View + Sized {
// Provided methods
fn padding(self, padding: impl Into<Insets>) -> Styled<Self> { ... }
fn background(self, fill: impl Into<Fill>) -> Styled<Self> { ... }
fn frame(self, width: Option<f32>, height: Option<f32>) -> Styled<Self> { ... }
fn width(self, width: f32) -> Styled<Self> { ... }
fn height(self, height: f32) -> Styled<Self> { ... }
fn grow(self, grow: f32) -> Styled<Self> { ... }
fn stretch(self) -> Styled<Self> { ... }
fn centered(self) -> Styled<Self> { ... }
fn tooltip(self, text: impl Into<String>) -> Tooltip<Self> { ... }
fn opacity(self, opacity: f32) -> Faded<Self> { ... }
}Expand description
SwiftUI-style modifiers available on every view.
use ravenrs_style::Semantic;
use ravenrs_widgets::{Text, ViewExt};
let chip = Text::new("New").padding((4.0, 10.0)).background(Semantic::Control).corner_radius(999.0);Provided Methods§
Sourcefn padding(self, padding: impl Into<Insets>) -> Styled<Self>
fn padding(self, padding: impl Into<Insets>) -> Styled<Self>
Adds padding inside the box, in logical pixels.
Sourcefn background(self, fill: impl Into<Fill>) -> Styled<Self>
fn background(self, fill: impl Into<Fill>) -> Styled<Self>
Paints a background behind the content.
Sourcefn frame(self, width: Option<f32>, height: Option<f32>) -> Styled<Self>
fn frame(self, width: Option<f32>, height: Option<f32>) -> Styled<Self>
Fixes the width and/or height in logical pixels; None keeps the content size.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".