libcosmic/examples/app_library/grid_item/imp.rs

27 lines
537 B
Rust
Raw Normal View History

2021-12-03 12:40:51 -05:00
use std::cell::Cell;
use std::cell::RefCell;
use std::rc::Rc;
use gtk4::glib;
2021-12-30 16:54:35 -05:00
use gtk4::subclass::prelude::*;
#[derive(Debug, Default)]
2021-12-02 17:25:33 -05:00
pub struct GridItem {
pub name: Rc<RefCell<gtk4::Label>>,
pub image: Rc<RefCell<gtk4::Image>>,
2021-12-03 12:40:51 -05:00
pub index: Cell<u32>,
}
#[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 17:25:33 -05:00
impl ObjectImpl for GridItem {}
2021-12-02 17:25:33 -05:00
impl WidgetImpl for GridItem {}
2021-12-02 17:25:33 -05:00
impl BoxImpl for GridItem {}