After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 757544 - GtkHeaderBar subclass template and <child type="title"> does not work
GtkHeaderBar subclass template and <child type="title"> does not work
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2015-11-03 21:14 UTC by Christian Hergert
Modified: 2015-11-03 22:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
example (1.04 KB, application/x-designer)
2015-11-03 21:19 UTC, Christian Hergert
  Details
remove G_PARAM_CONSTRUCT from :custom-title (1.06 KB, patch)
2015-11-03 22:38 UTC, Christian Hergert
committed Details | Review

Description Christian Hergert 2015-11-03 21:14:51 UTC
If you inherit from GtkHeaderBar and use a template to layout the UI, the <child type="title"> will be ignored by a call to gtk_header_bar_set_custom_title() after the object instantiation.

This was verified with a printf() in gtk_header_bar_set_custom_title() which saw a valid pointer initially during buildable creation, and then a (nil) afterwards. Presumably from the G_PARAM_CONSTRUCT (although I have not verified).
Comment 1 Matthias Clasen 2015-11-03 21:16:32 UTC
Try <child type="titlebar">
Comment 2 Matthias Clasen 2015-11-03 21:17:28 UTC
Oh, I guess I misunderstood - an example would clarify.
Comment 3 Christian Hergert 2015-11-03 21:19:58 UTC
Created attachment 314768 [details]
example

Quick example of the in progress .ui file
Comment 4 Christian Hergert 2015-11-03 22:38:26 UTC
Created attachment 314773 [details] [review]
remove G_PARAM_CONSTRUCT from :custom-title

Quick patch to remove the construct param for custom-title. I'm not sure why it was set to construct, since it is not used in gtk_header_bar_new().

This fixes my issue.
Comment 5 Christian Hergert 2015-11-03 22:53:23 UTC
This problem has been fixed in the unstable development version. The fix will be available in the next major software release. You may need to upgrade your Linux distribution to obtain that newer version.