save/restore custom app groups

This commit is contained in:
Ashley Wulber 2021-12-06 10:56:45 -05:00 committed by Jeremy Soller
parent 04b4b88534
commit ce3bcd7821
8 changed files with 156 additions and 25 deletions

View file

@ -12,7 +12,7 @@ use super::AppGroupData;
// Object holding the state
#[derive(Default)]
pub struct AppGroup {
data: Rc<RefCell<AppGroupData>>,
pub data: Rc<RefCell<AppGroupData>>,
}
// The central trait for subclassing a GObject

View file

@ -1,9 +1,10 @@
mod imp;
use gdk4::glib::Object;
use glib::Object;
use glib::ObjectExt;
use glib::ToVariant;
use gtk4::glib;
use gtk4::subclass::prelude::*;
use serde::{Deserialize, Serialize};
glib::wrapper! {
@ -26,6 +27,11 @@ impl AppGroup {
};
self_
}
pub fn group_data(&self) -> AppGroupData {
let imp = imp::AppGroup::from_instance(self);
imp.data.borrow().clone()
}
}
// Object holding the state