updating cards
This commit is contained in:
		@@ -25,7 +25,7 @@ impl CardDisplay {
 | 
			
		||||
        Object::builder()
 | 
			
		||||
            .property("imagepath", image_path)
 | 
			
		||||
            .property("hieroglyph", hieroglyph)
 | 
			
		||||
            // .property("reading", reading)
 | 
			
		||||
            // .property("translation", translation)
 | 
			
		||||
            .build()
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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();
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -15,11 +15,11 @@ glib::wrapper! {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
impl CardEntry {
 | 
			
		||||
    pub fn new(image_path: &String, hieroglyph: &String, reading: &String) -> Self {
 | 
			
		||||
    pub fn new(image_path: &String, hieroglyph: &String, translation: &String) -> Self {
 | 
			
		||||
        Object::builder()
 | 
			
		||||
            .property("imagepath", image_path)
 | 
			
		||||
            .property("hieroglyph", hieroglyph)
 | 
			
		||||
            .property("reading", reading)
 | 
			
		||||
            .property("translation", translation)
 | 
			
		||||
            .build()
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user