refactor launcher removing templates

This commit is contained in:
Ashley Wulber 2021-12-31 14:58:26 -05:00
parent 839a4a55d7
commit 7c0cf048ee
10 changed files with 188 additions and 84 deletions

View file

@ -1,21 +1,15 @@
use gtk4::glib;
use gtk4::prelude::*;
use gtk4::subclass::prelude::*;
use gtk4::CompositeTemplate;
use std::cell::RefCell;
use std::rc::Rc;
#[derive(Debug, Default, CompositeTemplate)]
#[template(file = "application_row.ui")]
#[derive(Debug, Default)]
pub struct SearchResultRow {
#[template_child]
pub name: TemplateChild<gtk4::Label>,
#[template_child]
pub description: TemplateChild<gtk4::Label>,
#[template_child]
pub shortcut: TemplateChild<gtk4::Label>,
#[template_child]
pub image: TemplateChild<gtk4::Image>,
#[template_child]
pub categoryimage: TemplateChild<gtk4::Image>,
pub name: Rc<RefCell<gtk4::Label>>,
pub description: Rc<RefCell<gtk4::Label>>,
pub shortcut: Rc<RefCell<gtk4::Label>>,
pub image: Rc<RefCell<gtk4::Image>>,
pub category_image: Rc<RefCell<gtk4::Image>>,
}
#[glib::object_subclass]
@ -23,14 +17,6 @@ impl ObjectSubclass for SearchResultRow {
const NAME: &'static str = "SearchResultRow";
type Type = super::SearchResultRow;
type ParentType = gtk4::Box;
fn class_init(klass: &mut Self::Class) {
Self::bind_template(klass);
}
fn instance_init(obj: &glib::subclass::InitializingObject<Self>) {
obj.init_template();
}
}
impl ObjectImpl for SearchResultRow {}