summary refs log tree commit diff
path: root/src/widgets.rs
blob: eb5766bb1154da7a89c4040e49ccd52065014bae (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
use gtk::prelude::*;
use relm4::{
    gtk, RelmWidgetExt, WidgetTemplate,
};


#[relm4::widget_template(pub)]
impl WidgetTemplate for FieldWithLabel {
    view! {
        #[name = "layout"]
        gtk::Box {
            set_orientation: gtk::Orientation::Horizontal,

            #[name = "label"]
            gtk::Label {
                set_width_request: 150,
                set_height_request: 36,
            },

            #[name = "input_wrapper"]
            gtk::Box {
                set_orientation: gtk::Orientation::Horizontal,
                set_css_classes: &["linked"],

                #[name = "input"]
                gtk::Entry { set_hexpand: true },
            },
        }
    }
}