From d0353dbc6ac624f63240ec64b83d238499cb0c7c Mon Sep 17 00:00:00 2001 From: Vika Date: Mon, 19 Aug 2024 21:42:04 +0300 Subject: Post composer UI prototype MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently the UI does precisely nothing, but the ✨ Smart Summary button prints a message stating what it's supposed to do. The Post button currently just logs to the console, although ultimately it should send a message to a parent component or something. Perhaps even the composer UI itself should be a separate part that can provide an MF2-JSON document on a command. --- src/widgets.rs | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/widgets.rs (limited to 'src/widgets.rs') 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 }, + }, + } + } +} -- cgit 1.4.1