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 738473 - Add GtkBox center-widget support
Add GtkBox center-widget support
Status: RESOLVED FIXED
Product: glade
Classification: Applications
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Glade 3 Maintainers
Glade 3 Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-10-13 17:50 UTC by Matthias Clasen
Modified: 2014-10-27 10:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add GtkBox center-widget support (9.64 KB, patch)
2014-10-13 17:50 UTC, Matthias Clasen
none Details | Review

Description Matthias Clasen 2014-10-13 17:50:04 UTC
In 3.12, GtkBox gained support for a centered child. With this
patch, glade supports this too.
Comment 1 Matthias Clasen 2014-10-13 17:50:11 UTC
Created attachment 288410 [details] [review]
Add GtkBox center-widget support
Comment 2 Matthias Clasen 2014-10-14 17:54:31 UTC
pushed a box-center branch for this
Comment 3 Tristan Van Berkom 2014-10-23 12:08:38 UTC
This works surprisingly well, considering how complex the GtkBox code is.

  o Undo/Redo seems to work pretty well under most circumstances

  o Tried to fool it by giving some children the GTK_PACK_END, seems
    to respond well to that

  o Load and save seems consistent

Only a few problems:

  o Setting "Center Child" to FALSE in the UI orphans project widgets
    (same thing that happened with the CSD setting), causing the center
    widget to be lost when undoing the setting of Center Child to FALSE.

    This should be a manually implemented checkbox in the
    glade-box-editor.[c,ui] like we did for CSD.

    Likewise, a possible "center child" should be undoably deleted when
    setting the virtual property.

  o Probably the packing property "pack-type" should be disabled for a widget
    that is the center widget, as it seems to be meaningless.

    The pack-type of the center widget is however loaded and saved properly,

The second problem does not block the merge of this branch, the symtom is
not so bad and the fix for this would require adding a facility to the
gladeui core that we don't currently have (we do have 
glade_widget_remove_property() which removes properties that are irrelevant,
and some dialogs call that in the post create function, however what we would
need here is a glade_widget_remove_pack_property() and call from the box's
adaptor after having added or replaced the child... this is uncharted waters
as the packing properties are generated dynamically at widget add time, we've
never had this need before).

So, please don't worry about the pack-type property, just please fix the
GladeBoxEditor so that it undoably removes the center child when setting
the use-center-child virtual property to FALSE, as I did for the CSD branch,
and we should be good to go.
Comment 4 Matthias Clasen 2014-10-26 00:40:07 UTC
pushed a new box-center branch that moves the use-center-child to the box editor and makes it properly undoable. I've also pushed a fix to GTK+ that makes loading ui files with center widgets not crash.
Comment 5 Tristan Van Berkom 2014-10-27 10:11:01 UTC
Played around with this for a while, resists the stress tests I can come up
with for now.

Thanks again, merged box-center branch to master now.