antoyo / relm

Idiomatic, GTK+-based, GUI library, inspired by Elm, written in Rust
MIT License
2.43k stars 78 forks source link

allow to set widget class through the DSL #192

Closed emmanueltouzery closed 4 years ago

emmanueltouzery commented 4 years ago

as far as I know currently to give a CSS style to a widget in relm, we must do:

    fn init_view(&mut self) {
        self.event_time_label
            .get_style_context()
            .add_class("event_time");
    }

// ...

                    #[name="event_time_label"]
                    gtk::Label {

It would be great if we could just do:

                    gtk::Label {
                          css_class: "event_time"

Or something of the sort.

antoyo commented 4 years ago

Duplicate of #25.