diff options
author | Matthias Clasen <matthiasc@src.gnome.org> | 2003-09-15 20:35:28 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2003-09-15 20:35:28 +0000 |
commit | c77b0caab16f094176938c30d7d6a25bbfb69fcc (patch) | |
tree | bbf467cc7e2e5841d7f2be8ad835844a5f68355b /tests | |
parent | caf380c793789e868458e32fbb64a33b5ef1d852 (diff) | |
download | gtk+-c77b0caab16f094176938c30d7d6a25bbfb69fcc.tar.gz |
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.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/merge-1.ui | 1 | ||||
-rw-r--r-- | tests/merge-2.ui | 6 |
2 files changed, 5 insertions, 2 deletions
diff --git a/tests/merge-1.ui b/tests/merge-1.ui index 55b3455592..a7fb9779d4 100644 --- a/tests/merge-1.ui +++ b/tests/merge-1.ui @@ -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" /> diff --git a/tests/merge-2.ui b/tests/merge-2.ui index 18fbc607f6..a073f917dc 100644 --- a/tests/merge-2.ui +++ b/tests/merge-2.ui @@ -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"> |