Commit Graph

7 Commits

Author SHA1 Message Date
Ryan Lortie
bac58abec3 gtkmodelmenuitem: don't crash on missing action 2011-12-20 10:51:58 -05:00
Matthias Clasen
2398d7e900 Introduce gtkaccelmapprivate.h
Move internal accel map API there and update all users.
Also, add an internal function to create an accel path for
an action and parameter, and use it in gtkapplication.c and
gtkmodelmenuitem.c instead of duplicating that code.
2011-12-19 12:51:11 -05:00
Matthias Clasen
1c6d0c3e27 GtkApplicationWindow: Set the accel group on constructed windows
This will make the menuitems pick up matching accel map entries
automatically. Currently, nothing creates such accel map entries,
though.
2011-12-19 12:51:11 -05:00
Ryan Lortie
cd7ce867a7 Split off GMenuModel -> GtkMenuBar code
Put this in a separate file and substantially refactor it.

Move handling of submenu creation into gtkmodelmenuitem where it
belongs.

Improve our handling of when to show separators or not.
2011-12-19 12:51:10 -05:00
Ryan Lortie
2e64177e3f GtkModelMenuItem: don't leak a GVariant 2011-12-19 12:51:10 -05:00
Ryan Lortie
f83530ae3a GtkModelMenuItem: omit indicator if not required
GtkModelMenuItem, being based on GtkCheckMenuItem, was always reserving
space for a check/radio indicator.  This ends up looking pretty strange
in a GtkMenuBar.

Don't reserve space for the indicator unless it's appropriate.
2011-12-19 12:51:10 -05:00
Ryan Lortie
612e24dfc6 introduce GtkModelMenuItem
This GtkMenuItem subclass (and GActionObserver implementation) contains
all the knowledge necessary for converting a GMenuModel item description
into a GtkMenuItem.

Remove much of the code that used to do this from
gtkapplicationwindow.c.
2011-12-19 12:51:09 -05:00