summary refs log tree commit diff
path: root/src/widgets.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets.rs')
-rw-r--r--src/widgets.rs30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/widgets.rs b/src/widgets.rs
new file mode 100644
index 0000000..eb5766b
--- /dev/null
+++ b/src/widgets.rs
@@ -0,0 +1,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 },
+            },
+        }
+    }
+}