autoupdate on card_entry add

This commit is contained in:
2024-04-06 15:58:20 +03:00
parent 193db81657
commit 24acb4ecd1
2 changed files with 21 additions and 8 deletions

View File

@@ -1,7 +1,9 @@
use std::cell::RefCell;
use std::sync::OnceLock;
use glib::subclass::InitializingObject;
use glib::Properties;
use gtk::glib::subclass::Signal;
use gtk::subclass::prelude::*;
use gtk::{glib, prelude::*, Button, CompositeTemplate, Label, Picture};
@@ -42,6 +44,15 @@ impl ObjectSubclass for CardEntry {
}
#[glib::derived_properties]
impl ObjectImpl for CardEntry {
fn signals() -> &'static [Signal] {
static SIGNALS: OnceLock<Vec<Signal>> = OnceLock::new();
SIGNALS.get_or_init(|| {
vec![Signal::builder("created")
.build()]
})
}
fn constructed(&self) {
self.parent_constructed();
@@ -57,7 +68,6 @@ impl ObjectImpl for CardEntry {
.bind_property("reading", reading_label_binding, "label")
.sync_create()
.build();
}
fn dispose(&self) {