Trait composable::views::View
source · pub trait View: Sized {
Show 16 methods
// Required methods
fn size(&self) -> Size;
fn draw(&self, bounds: Bounds, onto: &mut impl Output);
// Provided methods
fn event(&self, event: Event, offset: Point, bounds: Bounds) { ... }
fn padding(
self,
top: f32,
right: f32,
bottom: f32,
left: f32,
) -> Padding<Self> { ... }
fn padding_top(self, pad: f32) -> Padding<Self> { ... }
fn padding_right(self, pad: f32) -> Padding<Self> { ... }
fn padding_bottom(self, pad: f32) -> Padding<Self> { ... }
fn padding_left(self, pad: f32) -> Padding<Self> { ... }
fn padding_horizontal(self, pad: f32) -> Padding<Self> { ... }
fn padding_vertical(self, pad: f32) -> Padding<Self> { ... }
fn padding_both(self, horizontal: f32, vertical: f32) -> Padding<Self> { ... }
fn padding_all(self, pad: f32) -> Padding<Self> { ... }
fn fixed(self, width: f32, height: f32) -> impl View { ... }
fn width(self, width: f32) -> impl View { ... }
fn height(self, height: f32) -> impl View { ... }
fn across(self) -> impl View { ... }
}
Available on crate features
unstable
and views
only.Expand description
User interface element and modifiers to re-configure it.
Required Methods§
Provided Methods§
sourcefn event(&self, event: Event, offset: Point, bounds: Bounds)
fn event(&self, event: Event, offset: Point, bounds: Bounds)
User-interface Event
handling of the View
sourcefn padding(self, top: f32, right: f32, bottom: f32, left: f32) -> Padding<Self>
fn padding(self, top: f32, right: f32, bottom: f32, left: f32) -> Padding<Self>
Add padding to all sides of the View
sourcefn padding_top(self, pad: f32) -> Padding<Self>
fn padding_top(self, pad: f32) -> Padding<Self>
Add padding to the top of the View
sourcefn padding_right(self, pad: f32) -> Padding<Self>
fn padding_right(self, pad: f32) -> Padding<Self>
Add padding to the right side of the View
sourcefn padding_bottom(self, pad: f32) -> Padding<Self>
fn padding_bottom(self, pad: f32) -> Padding<Self>
Add padding to the bottom of the View
sourcefn padding_left(self, pad: f32) -> Padding<Self>
fn padding_left(self, pad: f32) -> Padding<Self>
Add padding to the left side of the View
sourcefn padding_horizontal(self, pad: f32) -> Padding<Self>
fn padding_horizontal(self, pad: f32) -> Padding<Self>
Add padding to the horizontal sides of the View
sourcefn padding_vertical(self, pad: f32) -> Padding<Self>
fn padding_vertical(self, pad: f32) -> Padding<Self>
Add padding to the vertical sides of the View
sourcefn padding_both(self, horizontal: f32, vertical: f32) -> Padding<Self>
fn padding_both(self, horizontal: f32, vertical: f32) -> Padding<Self>
Add different padding to the horizontal and vertical sides of the View
sourcefn padding_all(self, pad: f32) -> Padding<Self>
fn padding_all(self, pad: f32) -> Padding<Self>
Add the same padding to all sides of the View
sourcefn fixed(self, width: f32, height: f32) -> impl View
fn fixed(self, width: f32, height: f32) -> impl View
Set the size of the View
to a fixed value.
fn width(self, width: f32) -> impl View
fn height(self, height: f32) -> impl View
Object Safety§
This trait is not object safe.