Skip to content

Commit b2e4fbe

Browse files
gtk: Implement HasParamSpec for TemplateChild<T>
Fixes #1456
1 parent 2910bca commit b2e4fbe

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

gtk4/src/subclass/widget.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1230,6 +1230,19 @@ where
12301230
}
12311231
}
12321232

1233+
impl<T> glib::HasParamSpec for TemplateChild<T>
1234+
where
1235+
T: ObjectType + IsA<glib::Object> + FromGlibPtrNone<*mut <T as ObjectType>::GlibType>,
1236+
{
1237+
type ParamSpec = glib::ParamSpecObject;
1238+
type SetValue = T;
1239+
type BuilderFn = fn(&str) -> glib::ParamSpecObjectBuilder<T>;
1240+
1241+
fn param_spec_builder() -> Self::BuilderFn {
1242+
Self::ParamSpec::builder
1243+
}
1244+
}
1245+
12331246
impl<T> std::ops::Deref for TemplateChild<T>
12341247
where
12351248
T: ObjectType + FromGlibPtrNone<*mut <T as ObjectType>::GlibType>,

0 commit comments

Comments
 (0)