libcosmic/examples/launcher/search_result_object/mod.rs

21 lines
550 B
Rust
Raw Normal View History

use crate::utils::BoxedSearchResult;
use gtk4::glib;
use gtk4::prelude::*;
mod imp;
2021-11-23 18:09:35 -05:00
glib::wrapper! {
2021-12-28 11:19:55 -05:00
pub struct SearchResultObject(ObjectSubclass<imp::SearchResultObject>);
2021-11-23 18:09:35 -05:00
}
2021-12-28 11:19:55 -05:00
impl SearchResultObject {
2021-12-28 11:08:02 -05:00
pub fn new(search_result: &BoxedSearchResult) -> Self {
glib::Object::new(&[("data", search_result)]).expect("Failed to create Application Object")
2021-11-23 18:09:35 -05:00
}
pub fn data(&self) -> Option<pop_launcher::SearchResult> {
2022-01-19 10:19:56 -05:00
let search_result = self.property::<BoxedSearchResult>("data");
return search_result.0;
}
2021-11-23 18:09:35 -05:00
}