GNOME Bugzilla – Bug 637681
Bluetooth menu items are in the wrong order
Last modified: 2011-01-06 18:51:57 UTC
As discussed on IRC, due to the interpretation of position in PopupMenu. Filing a bug because I'm taking advantage of this to improve StBoxLayout, so that the fixing looks clean.
Created attachment 176773 [details] [review] StBoxLayout: add insert_before Add st_container_move_before internal API, and st_box_layout_insert_before, that inserts an actor before another in the container.
Created attachment 176774 [details] [review] PopupMenu: fix addMenuItem with explicit position Only real menu items should be considered, fix this using the new API in StBoxLayout.
Comment on attachment 176773 [details] [review] StBoxLayout: add insert_before >+ clutter_container_add_actor((ClutterContainer*) self, actor); >+ st_container_move_before ((StContainer*) self, actor, sibling); Use CLUTTER_CONTAINER()-style casts. (Even if the other methods don't; they're wrong.) >+ if (actor_item == NULL || sibling_item == NULL) >+ { >+ g_critical ("Invoking st_container_move_before on object of type %s with " >+ "arguments that are not children of the container", >+ g_type_name (G_OBJECT_TYPE (container))); >+ return; >+ } Just g_return_if_fail (actor_item != NULL); g_return_if_fail (sibling_item != NULL); is fine. Oh, I see, you copied that from st_container_move_child(). Well, move_child is wrong. :)
Created attachment 176959 [details] [review] StBoxLayout: add insert_before Add st_container_move_before internal API, and st_box_layout_insert_before, that inserts an actor before another in the container.