2021-12-30 16:54:35 -05:00
|
|
|
use gtk4::glib;
|
|
|
|
|
use gtk4::prelude::*;
|
|
|
|
|
use gtk4::subclass::prelude::*;
|
2021-12-30 17:53:06 -05:00
|
|
|
use gtk4::CompositeTemplate;
|
2021-11-28 21:11:02 -05:00
|
|
|
|
|
|
|
|
#[derive(Debug, Default, CompositeTemplate)]
|
|
|
|
|
#[template(file = "application_row.ui")]
|
2021-12-28 11:19:55 -05:00
|
|
|
pub struct SearchResultRow {
|
2021-11-28 21:11:02 -05:00
|
|
|
#[template_child]
|
2021-12-30 16:54:35 -05:00
|
|
|
pub name: TemplateChild<gtk4::Label>,
|
2021-11-28 21:11:02 -05:00
|
|
|
#[template_child]
|
2021-12-30 16:54:35 -05:00
|
|
|
pub description: TemplateChild<gtk4::Label>,
|
2021-11-28 21:11:02 -05:00
|
|
|
#[template_child]
|
2021-12-30 16:54:35 -05:00
|
|
|
pub shortcut: TemplateChild<gtk4::Label>,
|
2021-11-28 21:11:02 -05:00
|
|
|
#[template_child]
|
2021-12-30 16:54:35 -05:00
|
|
|
pub image: TemplateChild<gtk4::Image>,
|
2021-11-30 16:15:06 -05:00
|
|
|
#[template_child]
|
2021-12-30 16:54:35 -05:00
|
|
|
pub categoryimage: TemplateChild<gtk4::Image>,
|
2021-11-28 21:11:02 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[glib::object_subclass]
|
2021-12-28 11:19:55 -05:00
|
|
|
impl ObjectSubclass for SearchResultRow {
|
|
|
|
|
const NAME: &'static str = "SearchResultRow";
|
|
|
|
|
type Type = super::SearchResultRow;
|
2021-12-30 16:54:35 -05:00
|
|
|
type ParentType = gtk4::Box;
|
2021-11-28 21:11:02 -05:00
|
|
|
|
|
|
|
|
fn class_init(klass: &mut Self::Class) {
|
|
|
|
|
Self::bind_template(klass);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn instance_init(obj: &glib::subclass::InitializingObject<Self>) {
|
|
|
|
|
obj.init_template();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-28 11:19:55 -05:00
|
|
|
impl ObjectImpl for SearchResultRow {}
|
2021-12-29 17:31:01 -05:00
|
|
|
|
2021-12-28 11:19:55 -05:00
|
|
|
impl WidgetImpl for SearchResultRow {}
|
2021-12-29 17:31:01 -05:00
|
|
|
|
2021-12-28 11:19:55 -05:00
|
|
|
impl BoxImpl for SearchResultRow {}
|