WidgetBuilderExt

Trait WidgetBuilderExt 

Source
pub trait WidgetBuilderExt {
Show 15 methods // Required methods fn with_color(self, color: Color) -> Self; fn with_frame(self, frame: FrameType) -> Self; fn with_label_size(self, size: i32) -> Self; fn with_label_color(self, color: Color) -> Self; fn with_label_type(self, typ: LabelType) -> Self; fn with_selection_color(self, color: Color) -> Self; fn with_label_font(self, font: Font) -> Self; fn with_callback<F>(self, cb: F) -> Self where F: FnMut(&mut Self) + 'static; fn with_trigger(self, trigger: CallbackTrigger) -> Self; fn with_emit<T: 'static + Clone + Send + Sync>( self, sender: Sender<T>, msg: T, ) -> Self; fn with_image<I: ImageExt>(self, image: Option<I>) -> Self; fn with_image_scaled<I: ImageExt>(self, image: Option<I>) -> Self where Self: Sized; fn with_deimage<I: ImageExt>(self, image: Option<I>) -> Self where Self: Sized; fn with_deimage_scaled<I: ImageExt>(self, image: Option<I>) -> Self where Self: Sized; fn with_tooltip(self, txt: &str) -> Self;
}
Expand description

Adds builder pattern friendly versions of several setter functions

Required Methods§

Source

fn with_color(self, color: Color) -> Self

Sets the widget’s color

Source

fn with_frame(self, frame: FrameType) -> Self

Sets the widget’s frame type

Source

fn with_label_size(self, size: i32) -> Self

Sets the widget label’s size

Source

fn with_label_color(self, color: Color) -> Self

Sets the widget label’s color

Source

fn with_label_type(self, typ: LabelType) -> Self

Sets the widget label’s type

Source

fn with_selection_color(self, color: Color) -> Self

Sets the selection color of the widget

Source

fn with_label_font(self, font: Font) -> Self

Sets the widget label’s font

Source

fn with_callback<F>(self, cb: F) -> Self
where F: FnMut(&mut Self) + 'static,

Sets the callback when the widget is triggered (clicks for example) takes the widget as a closure argument

Source

fn with_trigger(self, trigger: CallbackTrigger) -> Self

Sets the default callback trigger for a widget, equivalent to when()

Source

fn with_emit<T: 'static + Clone + Send + Sync>( self, sender: Sender<T>, msg: T, ) -> Self

Emits a message on callback using a sender

Source

fn with_image<I: ImageExt>(self, image: Option<I>) -> Self

Sets the image of the widget

Source

fn with_image_scaled<I: ImageExt>(self, image: Option<I>) -> Self
where Self: Sized,

Sets the image of the widget scaled to the widget’s size

Source

fn with_deimage<I: ImageExt>(self, image: Option<I>) -> Self
where Self: Sized,

Sets the deactivated image of the widget

Source

fn with_deimage_scaled<I: ImageExt>(self, image: Option<I>) -> Self
where Self: Sized,

Sets the deactivated image of the widget scaled to the widget’s size

Source

fn with_tooltip(self, txt: &str) -> Self

Sets the tooltip text

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§

Source§

impl<W> WidgetBuilderExt for W
where W: WidgetExt,