vizia::modifiers

Trait StyleModifiers

pub trait StyleModifiers: Modifiable {
Show 51 methods // Provided methods fn id(self, id: impl Into<String>) -> Self { ... } fn class(self, name: &str) -> Self { ... } fn toggle_class(self, name: &str, applied: impl Res<bool>) -> Self { ... } fn checked<U>(self, state: impl Res<U>) -> Self where U: Into<bool> { ... } fn focused<U>(self, state: impl Res<U>) -> Self where U: Into<bool> { ... } fn focused_with_visibility<U>( self, focus: impl Res<U> + Copy + 'static, visibility: impl Res<U> + Copy + 'static, ) -> Self where U: Into<bool> { ... } fn read_only<U>(self, state: impl Res<U>) -> Self where U: Into<bool> { ... } fn read_write<U>(self, state: impl Res<U>) -> Self where U: Into<bool> { ... } fn disabled<U>(self, value: impl Res<U>) -> Self where U: Into<bool> { ... } fn display<U>(self, value: impl Res<U>) -> Self where U: Into<Display> { ... } fn visibility<U>(self, value: impl Res<U>) -> Self where U: Into<Visibility> { ... } fn opacity<U>(self, value: impl Res<U>) -> Self where U: Into<Opacity> { ... } fn z_index<U>(self, value: impl Res<U>) -> Self where U: Into<i32> { ... } fn clip_path<U>(self, value: impl Res<U>) -> Self where U: Into<ClipPath> { ... } fn overflow<U>(self, value: impl Res<U>) -> Self where U: Into<Overflow> { ... } fn overflowx<U>(self, value: impl Res<U>) -> Self where U: Into<Overflow> { ... } fn overflowy<U>(self, value: impl Res<U>) -> Self where U: Into<Overflow> { ... } fn backdrop_filter<U>(self, value: impl Res<U>) -> Self where U: Into<Filter> { ... } fn shadow<U>(self, value: impl Res<U>) -> Self where U: Into<Shadow> { ... } fn shadows<U>(self, value: impl Res<U>) -> Self where U: Into<Vec<Shadow>> { ... } fn background_gradient<U>(self, value: impl Res<U>) -> Self where U: Into<Gradient> { ... } fn background_color<U>(self, value: impl Res<U>) -> Self where U: Into<Color> { ... } fn background_image<'i, U>(self, value: impl Res<U>) -> Self where U: Into<BackgroundImage<'i>> { ... } fn border_width<U>(self, value: impl Res<U>) -> Self where U: Into<LengthOrPercentage> { ... } fn border_color<U>(self, value: impl Res<U>) -> Self where U: Into<Color> { ... } fn border_style<U>(self, value: impl Res<U>) -> Self where U: Into<BorderStyleKeyword> { ... } fn corner_top_left_radius<U>(self, value: impl Res<U>) -> Self where U: Into<LengthOrPercentage> { ... } fn corner_top_right_radius<U>(self, value: impl Res<U>) -> Self where U: Into<LengthOrPercentage> { ... } fn corner_bottom_left_radius<U>(self, value: impl Res<U>) -> Self where U: Into<LengthOrPercentage> { ... } fn corner_bottom_right_radius<U>(self, value: impl Res<U>) -> Self where U: Into<LengthOrPercentage> { ... } fn corner_radius<U>(self, value: impl Res<U>) -> Self where U: Debug + Into<CornerRadius> { ... } fn corner_top_left_shape<U>(self, value: impl Res<U>) -> Self where U: Into<CornerShape> { ... } fn corner_top_right_shape<U>(self, value: impl Res<U>) -> Self where U: Into<CornerShape> { ... } fn corner_bottom_left_shape<U>(self, value: impl Res<U>) -> Self where U: Into<CornerShape> { ... } fn corner_bottom_right_shape<U>(self, value: impl Res<U>) -> Self where U: Into<CornerShape> { ... } fn corner_shape<U>(self, value: impl Res<U>) -> Self where U: Debug + Into<Rect<CornerShape>> { ... } fn corner_top_left_smoothing<U>(self, value: impl Res<U>) -> Self where U: Into<f32> { ... } fn corner_top_right_smoothing<U>(self, value: impl Res<U>) -> Self where U: Into<f32> { ... } fn corner_bottom_left_smoothing<U>(self, value: impl Res<U>) -> Self where U: Into<f32> { ... } fn corner_bottom_right_smoothing<U>(self, value: impl Res<U>) -> Self where U: Into<f32> { ... } fn corner_smoothing<U>(self, value: impl Res<U>) -> Self where U: Debug + Into<Rect<f32>> { ... } fn outline_width<U>(self, value: impl Res<U>) -> Self where U: Into<LengthOrPercentage> { ... } fn outline_color<U>(self, value: impl Res<U>) -> Self where U: Into<Color> { ... } fn outline_offset<U>(self, value: impl Res<U>) -> Self where U: Into<LengthOrPercentage> { ... } fn cursor<U>(self, value: impl Res<U>) -> Self where U: Into<CursorIcon> { ... } fn pointer_events<U>(self, value: impl Res<U>) -> Self where U: Into<PointerEvents> { ... } fn transform<U>(self, value: impl Res<U>) -> Self where U: Into<Vec<Transform>> { ... } fn transform_origin<U>(self, value: impl Res<U>) -> Self where U: Into<Position> { ... } fn translate<U>(self, value: impl Res<U>) -> Self where U: Into<Translate> { ... } fn rotate<U>(self, value: impl Res<U>) -> Self where U: Into<Angle> { ... } fn scale<U>(self, value: impl Res<U>) -> Self where U: Into<Scale> { ... }
}
Expand description

Modifiers for changing the style properties of a view.

Provided Methods§

fn id(self, id: impl Into<String>) -> Self

Sets the ID name of the view.

A view can have only one ID name and it must be unique. The ID name can be referenced by a CSS selector.

§Example
Element::new(cx).id("foo");

css

#foo {
    background-color: red;
}

fn class(self, name: &str) -> Self

Adds a class name to the view.

A view can have multiple classes. The class name can be referenced by a CSS selector.

§Example
Element::new(cx).class("foo");

css

.foo {
    background-color: red;
}

fn toggle_class(self, name: &str, applied: impl Res<bool>) -> Self

Sets whether a view should have the given class name.

fn checked<U>(self, state: impl Res<U>) -> Self
where U: Into<bool>,

Sets the checked state of the view.

fn focused<U>(self, state: impl Res<U>) -> Self
where U: Into<bool>,

Sets the focused state of the view.

Since only one view can have keyboard focus at a time, subsequent calls to this function on other views will cause those views to gain focus and this view to lose it.

fn focused_with_visibility<U>( self, focus: impl Res<U> + Copy + 'static, visibility: impl Res<U> + Copy + 'static, ) -> Self
where U: Into<bool>,

Sets the focused state of the view as well as the focus visibility.

fn read_only<U>(self, state: impl Res<U>) -> Self
where U: Into<bool>,

Sets whether the view should be in a read-only state.

fn read_write<U>(self, state: impl Res<U>) -> Self
where U: Into<bool>,

Sets whether the view should be in a read-write state.

fn disabled<U>(self, value: impl Res<U>) -> Self
where U: Into<bool>,

Sets the view to be disabled.

This property is inherited by the descendants of the view.

fn display<U>(self, value: impl Res<U>) -> Self
where U: Into<Display>,

Sets whether the view should be positioned and rendered.

A display value of Display::None causes the view to be ignored by both layout and rendering.

fn visibility<U>(self, value: impl Res<U>) -> Self
where U: Into<Visibility>,

Sets whether the view should be rendered.

The layout system will still compute the size and position of an invisible (hidden) view.

fn opacity<U>(self, value: impl Res<U>) -> Self
where U: Into<Opacity>,

Sets the opacity of the view.

Exects a value between 0.0 (transparent) and 1.0 (opaque).

fn z_index<U>(self, value: impl Res<U>) -> Self
where U: Into<i32>,

Sets the z-index of the view.

Views with a higher z-index will be rendered on top of those with a lower z-order. Views with the same z-index are rendered in tree order.

fn clip_path<U>(self, value: impl Res<U>) -> Self
where U: Into<ClipPath>,

Sets the clip path for the the view.

fn overflow<U>(self, value: impl Res<U>) -> Self
where U: Into<Overflow>,

Sets the overflow behavior of the view in the horizontal and vertical directions simultaneously.

fn overflowx<U>(self, value: impl Res<U>) -> Self
where U: Into<Overflow>,

Sets the overflow behavior of the view in the horizontal direction.

The overflow behavior determines whether child views can render outside the bounds of their parent.

fn overflowy<U>(self, value: impl Res<U>) -> Self
where U: Into<Overflow>,

Sets the overflow behavior of the view in the vertical direction.

The overflow behavior determines whether child views can render outside the bounds of their parent.

fn backdrop_filter<U>(self, value: impl Res<U>) -> Self
where U: Into<Filter>,

Sets the backdrop filter for the view.

fn shadow<U>(self, value: impl Res<U>) -> Self
where U: Into<Shadow>,

Add a shadow to the view.

fn shadows<U>(self, value: impl Res<U>) -> Self
where U: Into<Vec<Shadow>>,

Set the shadows of the view.

fn background_gradient<U>(self, value: impl Res<U>) -> Self
where U: Into<Gradient>,

Set the background gradient of the view.

fn background_color<U>(self, value: impl Res<U>) -> Self
where U: Into<Color>,

Sets the background color of the view.

fn background_image<'i, U>(self, value: impl Res<U>) -> Self
where U: Into<BackgroundImage<'i>>,

Set the background image of the view.

fn border_width<U>(self, value: impl Res<U>) -> Self

fn border_color<U>(self, value: impl Res<U>) -> Self
where U: Into<Color>,

Sets the border color of the view.

fn border_style<U>(self, value: impl Res<U>) -> Self

Sets the border color of the view.

fn corner_top_left_radius<U>(self, value: impl Res<U>) -> Self

Sets the corner radius for the top-left corner of the view.

fn corner_top_right_radius<U>(self, value: impl Res<U>) -> Self

Sets the corner radius for the top-right corner of the view.

fn corner_bottom_left_radius<U>(self, value: impl Res<U>) -> Self

Sets the corner radius for the bottom-left corner of the view.

fn corner_bottom_right_radius<U>(self, value: impl Res<U>) -> Self

Sets the corner radius for the bottom-right corner of the view.

fn corner_radius<U>(self, value: impl Res<U>) -> Self
where U: Debug + Into<CornerRadius>,

Sets the corner radius for all four corners of the view.

fn corner_top_left_shape<U>(self, value: impl Res<U>) -> Self
where U: Into<CornerShape>,

Sets the corner corner shape for the top-left corner of the view.

fn corner_top_right_shape<U>(self, value: impl Res<U>) -> Self
where U: Into<CornerShape>,

Sets the corner corner shape for the top-right corner of the view.

fn corner_bottom_left_shape<U>(self, value: impl Res<U>) -> Self
where U: Into<CornerShape>,

Sets the corner corner shape for the bottom-left corner of the view.

fn corner_bottom_right_shape<U>(self, value: impl Res<U>) -> Self
where U: Into<CornerShape>,

Sets the corner corner shape for the bottom-right corner of the view.

fn corner_shape<U>(self, value: impl Res<U>) -> Self
where U: Debug + Into<Rect<CornerShape>>,

Sets the corner shape for all four corners of the view.

fn corner_top_left_smoothing<U>(self, value: impl Res<U>) -> Self
where U: Into<f32>,

Sets the corner smoothing for the top-left corner of the view.

fn corner_top_right_smoothing<U>(self, value: impl Res<U>) -> Self
where U: Into<f32>,

Sets the corner smoothing for the top-right corner of the view.

fn corner_bottom_left_smoothing<U>(self, value: impl Res<U>) -> Self
where U: Into<f32>,

Sets the corner smoothing for the bottom-left corner of the view.

fn corner_bottom_right_smoothing<U>(self, value: impl Res<U>) -> Self
where U: Into<f32>,

Sets the corner smoothing for the bottom-right corner of the view.

fn corner_smoothing<U>(self, value: impl Res<U>) -> Self
where U: Debug + Into<Rect<f32>>,

Sets the corner smoothing for all four corners of the view.

fn outline_width<U>(self, value: impl Res<U>) -> Self

Sets the outline width of the view.

fn outline_color<U>(self, value: impl Res<U>) -> Self
where U: Into<Color>,

Sets the outline color of the view.

fn outline_offset<U>(self, value: impl Res<U>) -> Self

Sets the outline offset of the view.

fn cursor<U>(self, value: impl Res<U>) -> Self
where U: Into<CursorIcon>,

Sets the mouse cursor used when the view is hovered.

fn pointer_events<U>(self, value: impl Res<U>) -> Self
where U: Into<PointerEvents>,

Sets whether the view can be become the target of pointer events.

fn transform<U>(self, value: impl Res<U>) -> Self
where U: Into<Vec<Transform>>,

Sets the transform of the view with a list of transform functions.

fn transform_origin<U>(self, value: impl Res<U>) -> Self
where U: Into<Position>,

Sets the transform origin of the the view.

fn translate<U>(self, value: impl Res<U>) -> Self
where U: Into<Translate>,

Sets the translation offset of the view.

Translation applies to the rendered view and does not affect layout.

fn rotate<U>(self, value: impl Res<U>) -> Self
where U: Into<Angle>,

Sets the angle of rotation for the view.

Rotation applies to the rendered view and does not affect layout.

fn scale<U>(self, value: impl Res<U>) -> Self
where U: Into<Scale>,

Sets the scale of the view.

Scale applies to the rendered view and does not affect layout.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

§

impl<V> StyleModifiers for Handle<'_, V>
where V: View,