Commit Graph

6 Commits

Author SHA1 Message Date
Matthias Clasen
6061f234a9 GtkMenuSectionBox: Don't show separators for nested subsections
...unless they are labeled.

To implement this, keep track of the nesting depth of section boxes,
starting from 0 for the toplevel and the submenu ones, and only
insert unlabeled separators if the depth is at most 1.
2014-04-29 12:19:53 -04:00
Matthias Clasen
f3ba001a1d GtkMenuSectionBox: Always show separators for labeled sections
...unless they are empty.
2014-04-29 12:19:53 -04:00
Matthias Clasen
4f293c427c Add a comment with rules for separators 2014-04-29 12:19:53 -04:00
Matthias Clasen
effc7514e7 GtkMenuSectionBox: don't leak
This wasn't fully fleshed out yet.
2014-04-29 10:18:22 -04:00
Matthias Clasen
28a567f5a9 GtkMenuSectionBox: add support for iconic sections
Sections that have the display-hint attribute set to
"horizontal-boxes" will be rendered as a row of icon
buttons, instead of menuitem-like.
2014-04-28 14:20:26 -04:00
Ryan Lortie
5137e491dc GtkPopover: new approach to menu model binding
Instead of using GtkMenuTracker to flatten the sections into a single
linear menu, handle the sections ourselves by nesting boxes.

Each section gets an inner and outer box.  The inner box numbers its
children in the way that the tracker instructs.  The outer box
containes the inner box and the separator, if appropriate.

Having the two separate boxes will allow us to change the orientation of
the inner box if we want to pack widgets horizontally within a section.
2014-04-28 14:14:42 -04:00