GNOME Bugzilla – Bug 738473
Add GtkBox center-widget support
Last modified: 2014-10-27 10:11:01 UTC
In 3.12, GtkBox gained support for a centered child. With this patch, glade supports this too.
Created attachment 288410 [details] [review] Add GtkBox center-widget support
pushed a box-center branch for this
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.
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.
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.