upgrade gtk-rs version

This commit is contained in:
Ashley Wulber 2022-01-19 10:19:56 -05:00
parent 0b5f6b8386
commit cc577b1367
23 changed files with 401 additions and 317 deletions

View file

@ -1,6 +1,10 @@
use std::cell::RefCell;
use std::rc::Rc;
use gdk4::glib::ParamSpecBoolean;
use gdk4::glib::ParamSpecString;
use gdk4::glib::ParamSpecUInt;
use gdk4::glib::ParamSpecVariant;
use glib::{FromVariant, ParamFlags, ParamSpec, ToVariant, Value, Variant, VariantTy};
use gtk4::glib;
use gtk4::prelude::*;
@ -28,7 +32,7 @@ impl ObjectImpl for AppGroup {
fn properties() -> &'static [ParamSpec] {
static PROPERTIES: Lazy<Vec<ParamSpec>> = Lazy::new(|| {
vec![
ParamSpec::new_uint(
ParamSpecUInt::new(
// Name
"id",
// Nickname
@ -42,7 +46,7 @@ impl ObjectImpl for AppGroup {
// The property can be read and written to
ParamFlags::READWRITE,
),
ParamSpec::new_string(
ParamSpecString::new(
// Name
"name",
// Nickname
@ -54,7 +58,7 @@ impl ObjectImpl for AppGroup {
// The property can be read and written to
ParamFlags::READWRITE,
),
ParamSpec::new_boolean(
ParamSpecBoolean::new(
// Name
"mutable",
// Nickname
@ -66,7 +70,7 @@ impl ObjectImpl for AppGroup {
// The property can be read and written to
ParamFlags::READWRITE,
),
ParamSpec::new_string(
ParamSpecString::new(
// Name
"icon",
// Nickname
@ -78,7 +82,7 @@ impl ObjectImpl for AppGroup {
// The property can be read and written to
ParamFlags::READWRITE,
),
ParamSpec::new_string(
ParamSpecString::new(
// Name
"category",
// Nickname
@ -90,7 +94,7 @@ impl ObjectImpl for AppGroup {
// The property can be read and written to
ParamFlags::READWRITE,
),
ParamSpec::new_variant(
ParamSpecVariant::new(
// Name
"appnames",
// Nickname

View file

@ -21,10 +21,7 @@ impl AppGroup {
("category", &data.category),
])
.expect("Failed to create `ApplicationObject`.");
if let Err(e) = self_.set_property("appnames", data.app_names.to_variant()) {
println!("failed to set category icon property");
dbg!(e);
};
self_.set_property("appnames", data.app_names.to_variant());
self_
}