GNOME Bugzilla – Bug 142377
overflow menu shown even when empty
Last modified: 2011-02-04 16:17:18 UTC
In the presence of tool items without overflow menu items (set to NULL with gtk_tool_item_set_proxy_menu_item), the overflow menu can end up empty, but is nevertheless shown (as a tiny square) when clicking the arrow. To see this, use for example epiphany: move the favicon drag handle to the first toolbar to the right using the toolbar editor, then narrow the window so just this item disappears.
It's not clear what to do instead. The arrow serves also as an indicator that there are more items. The best thing is probably to make an empty menu come up with a grayed out menu item saying "Empty".
I decided to just not show the arrow in that case. That's what we do for most other widgets when they are allocated smaller then they request. Sat Jun 5 20:05:39 2004 Soeren Sandmann <sandmann@daimi.au.dk> * tests/testmerge.c: Add a checkbox to queue an merge/unmerge. Patch from Matthias Clasen. * gtk/gtktoolbar.c (struct _GtkToolbarPrivate): Add a new flag "need_rebuild" (rebuild_menu): New function that rebuilds the overflow menu and makes sure it doesn't start or end with a separator. (toolbar_content_new_tool_item) (toolbar_content_remove) (toolbar_content_new_compatibility): Set the rebuild_needed flag (gtk_toolbar_size_allocate): Only show the overflow arrow when we have actually overflown an item with a proxy menu item. Also make sure we rebuild the menu if needed. Fix #125504, #142377, #143463 * gtk/gtkseparatortoolitem.c (gtk_separator_tool_item_expose): Obey the "priv->draw" flag. (#143692)