updating cards

This commit is contained in:
2024-04-14 12:12:18 +03:00
parent 4ec6e32357
commit 47fd5b3b9d
14 changed files with 87 additions and 32 deletions

View File

@@ -14,7 +14,7 @@ pub struct CardEntry {
#[template_child]
pub hieroglyph_label: TemplateChild<Label>,
#[template_child]
pub reading_label: TemplateChild<Label>,
pub translation_label: TemplateChild<Label>,
#[template_child]
pub delete_button: TemplateChild<Button>,
#[property(get, set)]
@@ -22,7 +22,7 @@ pub struct CardEntry {
#[property(get, set)]
hieroglyph: RefCell<String>,
#[property(get, set)]
reading: RefCell<String>,
translation: RefCell<String>,
}
#[glib::object_subclass]
@@ -51,9 +51,9 @@ impl ObjectImpl for CardEntry {
.sync_create()
.build();
let reading_label_binding: &Label = self.reading_label.as_ref();
let translation_label_binding: &Label = self.translation_label.as_ref();
self.obj()
.bind_property("reading", reading_label_binding, "label")
.bind_property("translation", translation_label_binding, "label")
.sync_create()
.build();
}