#[non_exhaustive]pub enum ControlVisual {
Rect {
brush: Brush,
radius: [Px; 4],
},
Image {
handle: ImageHandle,
source_rect: Option<ImageSourceRect>,
tint: Color,
fit: ImageFit,
filter: ImageFilter,
alignment: ImageAlignment,
},
Custom(ControlPainter),
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Rect
Image
Fields
§
handle: ImageHandle§
source_rect: Option<ImageSourceRect>§
filter: ImageFilter§
alignment: ImageAlignmentCustom(ControlPainter)
Implementations§
Source§impl ControlVisual
impl ControlVisual
pub fn rect(brush: Brush, radius: [Px; 4]) -> Self
pub fn image( handle: ImageHandle, source_rect: Option<ImageSourceRect>, tint: Color, ) -> Self
pub fn custom( painter: impl Fn(&mut Scene, Rect, ControlVisualState) + 'static, ) -> Self
pub fn image_fit(self, fit: ImageFit) -> Self
pub fn image_filter(self, filter: ImageFilter) -> Self
pub fn image_alignment(self, alignment: ImageAlignment) -> Self
pub fn paint(&self, scene: &mut Scene, rect: Rect, state: ControlVisualState)
pub fn custom_identity(&self) -> Option<usize>
Trait Implementations§
Source§impl Clone for ControlVisual
impl Clone for ControlVisual
Source§impl Debug for ControlVisual
impl Debug for ControlVisual
Auto Trait Implementations§
impl !RefUnwindSafe for ControlVisual
impl !Send for ControlVisual
impl !Sync for ControlVisual
impl !UnwindSafe for ControlVisual
impl Freeze for ControlVisual
impl Unpin for ControlVisual
impl UnsafeUnpin for ControlVisual
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
Mutably borrows from an owned value. Read more