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:
@ -3,8 +3,10 @@
|
||||
<menubar>
|
||||
<menu name="FileMenu" action="FileMenuAction">
|
||||
<menuitem name="New" action="NewAction" position="top" />
|
||||
<separator />
|
||||
<separator name="Sep1" />
|
||||
<separator name="Sep2" />
|
||||
<menuitem name="Quit" action="QuitAction" />
|
||||
<separator name="Sep3" />
|
||||
</menu>
|
||||
<menu name="HelpMenu" action="HelpMenuAction">
|
||||
<menuitem name="About" action="AboutAction" />
|
||||
@ -13,7 +15,7 @@
|
||||
<toolbar name="toolbar1">
|
||||
<placeholder name="ToolbarPlaceholder">
|
||||
<toolitem name="Quit" action="QuitAction" />
|
||||
<separator />
|
||||
<separator name="Sep2"/>
|
||||
</placeholder>
|
||||
</toolbar>
|
||||
<popup name="FileMenu" action="FileMenuAction">
|
||||
|
||||
Reference in New Issue
Block a user