2021-12-03 12:40:51 -05:00
|
|
|
use std::cell::Cell;
|
2021-12-31 16:03:47 -05:00
|
|
|
use std::cell::RefCell;
|
|
|
|
|
use std::rc::Rc;
|
2021-12-02 12:49:01 -05:00
|
|
|
|
2022-01-02 01:46:44 -05:00
|
|
|
use gtk4::glib;
|
2021-12-30 16:54:35 -05:00
|
|
|
use gtk4::subclass::prelude::*;
|
2021-12-02 12:49:01 -05:00
|
|
|
|
2021-12-31 16:03:47 -05:00
|
|
|
#[derive(Debug, Default)]
|
2021-12-02 17:25:33 -05:00
|
|
|
pub struct GridItem {
|
2021-12-31 16:03:47 -05:00
|
|
|
pub name: Rc<RefCell<gtk4::Label>>,
|
|
|
|
|
pub image: Rc<RefCell<gtk4::Image>>,
|
2021-12-03 12:40:51 -05:00
|
|
|
pub index: Cell<u32>,
|
2021-12-02 12:49:01 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[glib::object_subclass]
|
2021-12-02 17:25:33 -05:00
|
|
|
impl ObjectSubclass for GridItem {
|
|
|
|
|
const NAME: &'static str = "GridItem";
|
|
|
|
|
type Type = super::GridItem;
|
2021-12-30 16:54:35 -05:00
|
|
|
type ParentType = gtk4::Box;
|
2021-12-02 12:49:01 -05:00
|
|
|
}
|
|
|
|
|
|
2021-12-02 17:25:33 -05:00
|
|
|
impl ObjectImpl for GridItem {}
|
2021-12-29 17:31:01 -05:00
|
|
|
|
2021-12-02 17:25:33 -05:00
|
|
|
impl WidgetImpl for GridItem {}
|
2021-12-29 17:31:01 -05:00
|
|
|
|
2021-12-02 17:25:33 -05:00
|
|
|
impl BoxImpl for GridItem {}
|