pub trait WidgetPlus {
    // Required methods
    fn set_margin_all(&self, margin: i32);
    fn set_class_active(&self, class: &str, active: bool);
    fn inline_css(&self, style_data: &[u8]);
    fn try_remove(&self, widget: &impl IsA<Widget>) -> bool;
}
Expand description

Trait that extends gtk::prelude::WidgetExt.

This trait’s main goal is to reduce redundant code and to provide helpful methods for the widgets macro of relm4-macros.

Required Methods§

source

fn set_margin_all(&self, margin: i32)

Set margin at start, end, top and bottom all at once.

source

fn set_class_active(&self, class: &str, active: bool)

Add class name if active is true and remove class name if active is false

source

fn inline_css(&self, style_data: &[u8])

Add inline CSS instructions to a widget.

widget.inline_css(b"border: 1px solid red");
source

fn try_remove(&self, widget: &impl IsA<Widget>) -> bool

Try to remove a widget from a widget.

Returns true if the removal is supported on the type of widget. This doesn’t mean that the widget was actually removed.

Implementors§