summaryrefslogtreecommitdiff
path: root/schist_gtk4_gui/src/category_transfers_view.rs
blob: 286a20cfcdfaddb16a789b105e3f093340f558a2 (plain)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
use gtk::{
    glib::{
        self,
        subclass::{
            object::{ObjectImpl, ObjectImplExt},
            types::ObjectSubclass,
            InitializingObject,
        },
        Object,
    },
    subclass::{
        box_::BoxImpl,
        widget::{CompositeTemplateClass, CompositeTemplateInitializingExt, WidgetImpl},
    },
};

glib::wrapper! {
    pub struct SchistCategoryTransfersView(ObjectSubclass<SchistCategoryTransfersViewImpl>)
        @extends gtk::Box, gtk::Widget,
        @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget, gtk::Orientable;
}

impl SchistCategoryTransfersView {
    pub fn new() -> Self {
        Object::builder().build()
    }
}

#[derive(gtk::CompositeTemplate, Default)]
#[template(resource = "/net/joeac/schist/ui/category_transfers_view.ui")]
pub struct SchistCategoryTransfersViewImpl {}

#[glib::object_subclass]
impl ObjectSubclass for SchistCategoryTransfersViewImpl {
    const NAME: &'static str = "SchistCategoryTransfersView";
    type Type = SchistCategoryTransfersView;
    type ParentType = gtk::Box;

    fn class_init(klass: &mut Self::Class) {
        klass.bind_template();
    }

    fn instance_init(obj: &InitializingObject<Self>) {
        obj.init_template();
    }
}

impl ObjectImpl for SchistCategoryTransfersViewImpl {
    fn constructed(&self) {
        self.parent_constructed();
    }
}

impl WidgetImpl for SchistCategoryTransfersViewImpl {}

impl BoxImpl for SchistCategoryTransfersViewImpl {}