diff options
| author | Joe Carstairs <me@joeac.net> | 2024-12-14 10:47:52 +0000 |
|---|---|---|
| committer | Joe Carstairs <me@joeac.net> | 2024-12-14 10:47:52 +0000 |
| commit | 96d68fc72cc74fd0858846b9c0df0424faa46adb (patch) | |
| tree | 42ba59b51cef93ec29a45866a697225984a734fa /schist_gtk4_gui/src/window/imp.rs | |
| parent | be9313986c9a32d134433d47c866b1f25a7847ab (diff) | |
Moves UI definition to XML
Diffstat (limited to 'schist_gtk4_gui/src/window/imp.rs')
| -rw-r--r-- | schist_gtk4_gui/src/window/imp.rs | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/schist_gtk4_gui/src/window/imp.rs b/schist_gtk4_gui/src/window/imp.rs new file mode 100644 index 0000000..82e14b0 --- /dev/null +++ b/schist_gtk4_gui/src/window/imp.rs @@ -0,0 +1,50 @@ +use gtk::{ + glib::{ + self, + subclass::{ + object::{ + ObjectImpl, + ObjectImplExt, + }, + types::ObjectSubclass, InitializingObject, + }, + }, + subclass::{application_window::ApplicationWindowImpl, widget::{ + CompositeTemplateClass, CompositeTemplateInitializingExt, WidgetImpl + }, window::WindowImpl}, +}; + +#[derive(gtk::CompositeTemplate, Default)] +#[template(resource = "/net/joeac/schist/window.ui")] +pub struct Window { +} + +#[glib::object_subclass] +impl ObjectSubclass for Window { + const NAME: &'static str = "SchistWindow"; + type Type = super::Window; + type ParentType = gtk::ApplicationWindow; + + fn class_init(klass: &mut Self::Class) { + klass.bind_template(); + } + + fn instance_init(obj: &InitializingObject<Self>) { + obj.init_template(); + } +} + +impl ObjectImpl for Window { + fn constructed(&self) { + self.parent_constructed(); + } +} + +impl WidgetImpl for Window { +} + +impl WindowImpl for Window { +} + +impl ApplicationWindowImpl for Window { +} |
