refactor and clean up app library

This commit is contained in:
Ashley Wulber 2022-01-14 17:53:11 -05:00
parent 4ce3b3cc21
commit 28151177d0
7 changed files with 670 additions and 498 deletions

View file

@ -0,0 +1,26 @@
use gtk4::subclass::prelude::*;
use gtk4::{gio, glib, GridView};
use once_cell::sync::OnceCell;
#[derive(Default)]
pub struct AppGrid {
pub app_grid_view: OnceCell<GridView>,
pub app_model: OnceCell<gio::ListStore>,
pub app_sort_model: OnceCell<gtk4::SortListModel>,
pub search_filter_model: OnceCell<gtk4::FilterListModel>,
pub group_filter_model: OnceCell<gtk4::FilterListModel>,
}
#[glib::object_subclass]
impl ObjectSubclass for AppGrid {
// `NAME` needs to match `class` attribute of template
const NAME: &'static str = "AppGrid";
type Type = super::AppGrid;
type ParentType = gtk4::Box;
}
impl ObjectImpl for AppGrid {}
impl WidgetImpl for AppGrid {}
impl BoxImpl for AppGrid {}