From b2e4fbe0ff73fd3cadb0b8d1bcdcd305b4d645b3 Mon Sep 17 00:00:00 2001 From: Bilal Elmoussaoui Date: Sat, 23 Sep 2023 11:05:48 +0200 Subject: [PATCH] gtk: Implement HasParamSpec for TemplateChild Fixes #1456 --- gtk4/src/subclass/widget.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/gtk4/src/subclass/widget.rs b/gtk4/src/subclass/widget.rs index 369fadaf7159..588802208d1d 100644 --- a/gtk4/src/subclass/widget.rs +++ b/gtk4/src/subclass/widget.rs @@ -1230,6 +1230,19 @@ where } } +impl glib::HasParamSpec for TemplateChild +where + T: ObjectType + IsA + FromGlibPtrNone<*mut ::GlibType>, +{ + type ParamSpec = glib::ParamSpecObject; + type SetValue = T; + type BuilderFn = fn(&str) -> glib::ParamSpecObjectBuilder; + + fn param_spec_builder() -> Self::BuilderFn { + Self::ParamSpec::builder + } +} + impl std::ops::Deref for TemplateChild where T: ObjectType + FromGlibPtrNone<*mut ::GlibType>,