Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gtk: Cleanup template related functions #1212

Merged
merged 5 commits into from
Dec 9, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions gtk4/Gir.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2579,6 +2579,9 @@ manual_traits = ["WidgetExtManual"]
pattern = "(init|dispose)_template"
ignore = true # We manually bind this one as part of CompositeTemplatExt
[[object.function]]
name = "get_template_child"
ignore = true # Not useful for Rust bindings
[[object.function]]
name = "get_name"
rename = "widget_name"
[[object.function]]
Expand Down
14 changes: 0 additions & 14 deletions gtk4/src/auto/widget.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,10 +372,6 @@ pub trait WidgetExt: 'static {
#[doc(alias = "get_style_context")]
fn style_context(&self) -> StyleContext;

#[doc(alias = "gtk_widget_get_template_child")]
#[doc(alias = "get_template_child")]
fn template_child(&self, widget_type: glib::types::Type, name: &str) -> glib::Object;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't hurt to have it, does it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no point in having it, you can retrieve child widgets with #[template_child]. This is probably a helper for languages like Python


#[doc(alias = "gtk_widget_get_tooltip_markup")]
#[doc(alias = "get_tooltip_markup")]
fn tooltip_markup(&self) -> Option<glib::GString>;
Expand Down Expand Up @@ -1359,16 +1355,6 @@ impl<O: IsA<Widget>> WidgetExt for O {
}
}

fn template_child(&self, widget_type: glib::types::Type, name: &str) -> glib::Object {
unsafe {
from_glib_none(ffi::gtk_widget_get_template_child(
self.as_ref().to_glib_none().0,
widget_type.into_glib(),
name.to_glib_none().0,
))
}
}

fn tooltip_markup(&self) -> Option<glib::GString> {
unsafe {
from_glib_none(ffi::gtk_widget_get_tooltip_markup(
Expand Down