Skip to content

Commit

Permalink
Merge pull request #1495 from gtk-rs/bilelmoussaoui/impl-paramspec
Browse files Browse the repository at this point in the history
gtk: Implement HasParamSpec for TemplateChild<T>
  • Loading branch information
ranfdev authored Sep 25, 2023
2 parents 2910bca + b2e4fbe commit e7ca908
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions gtk4/src/subclass/widget.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1230,6 +1230,19 @@ where
}
}

impl<T> glib::HasParamSpec for TemplateChild<T>
where
T: ObjectType + IsA<glib::Object> + FromGlibPtrNone<*mut <T as ObjectType>::GlibType>,
{
type ParamSpec = glib::ParamSpecObject;
type SetValue = T;
type BuilderFn = fn(&str) -> glib::ParamSpecObjectBuilder<T>;

fn param_spec_builder() -> Self::BuilderFn {
Self::ParamSpec::builder
}
}

impl<T> std::ops::Deref for TemplateChild<T>
where
T: ObjectType + FromGlibPtrNone<*mut <T as ObjectType>::GlibType>,
Expand Down

0 comments on commit e7ca908

Please sign in to comment.