New function which implements "smart" separators by iterating once over

* gtk/gtkuimanager.c (update_smart_separators): New function which
	implements "smart" separators by iterating once over the entries of a
	menu, hiding and showing separators as necessary.
	(update_node): Mark separators used as fences of placeholders as
	hidden. Explicitly added separators are marked as smart. Call
	update_smart_separators after updating a menu or toolbar node.
	Connect update_smart_separators to "notify::visible" signal on menu
	and tool items.

	* tests/merge-[12].ui: Test smart separators.

	* gtk/tmpl/gtkuimanager.sgml: Add a paragraph about smart separators.
This commit is contained in:
Matthias Clasen
2003-09-15 20:35:28 +00:00
parent caf380c793
commit c77b0caab1
10 changed files with 272 additions and 36 deletions

View File

@ -12,6 +12,7 @@
<toolbar name="toolbar1">
<placeholder name="ToolbarPlaceholder">
<toolitem name="nb2" action="NewAction" />
<separator name="Sep1" />
</placeholder>
<toolitem name="NewButton" action="NewAction" />
<toolitem name="CutButton" action="CutAction" />