diff options
author | Matthias Clasen <mclasen@redhat.com> | 2005-02-11 07:15:11 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2005-02-11 07:15:11 +0000 |
commit | 812e0cfdb7f987040fadae5f8e9fa47c153aac0e (patch) | |
tree | a34d385ac8d5abb42891c76de1b1939dedd24f3f /gtk/gtkmenubar.h | |
parent | 1c10200c25fb28af6058810efdd4e1ad0fc50a78 (diff) | |
download | gtk+-812e0cfdb7f987040fadae5f8e9fa47c153aac0e.tar.gz |
Support vertical menubars (#166632):
2005-02-11 Matthias Clasen <mclasen@redhat.com>
Support vertical menubars (#166632):
* gtk/gtkenums.h (GtkPackDirection): New enumeration for pack
directions, with values for left-to-right, right-to-left,
top-to-bottom and bottom-to-top.
* gtk/gtk.symbols:
* gtk/gtkmenubar.h:
* gtk/gtkmenubar.c: Add two properties, pack-direction and
child-pack-direction, which specify how children and
grandchildren of a menubar are packed, with getters and setters.
* gtk/gtkmenubar.c (gtk_menu_bar_set_property):
(gtk_menu_bar_get_property): Implement set_property and get_property.
* gtk/gtkmenubar.c (gtk_menu_bar_size_request):
(gtk_menu_bar_size_allocate): Take pack direction into account.
* gtk/gtkmenubar.c (gtk_menu_bar_move_current): Implement
move_current here move all the menubar-specific direction
tweaking from the generic menushell implementation here.
* gtk/gtkmenu.c (gtk_menu_move_current): Move menu-specific
direction tweaking from the generic menushell implementation here.
* gtk/gtkmenuitem.c (gtk_menu_item_size_request):
(gtk_menu_bar_size_allocate): Take pack direction into account.
* gtk/gtkimagemenuitem.c (gtk_image_menu_item_size_request)
(gtk_image_menu_item_size_allocate):
(gtk_image_menu_item_toggle_size_request): Take child pack
direction into account and pack the image vertically if
necessary.
* gtk/gtkmenushell.c (gtk_menu_shell_real_select_item):
Set the submenu direction to left-right for menuitems in
vertical menubars.
(gtk_real_menu_shell_move_current): Simplify by moving
direction tweaking to menu- and menubar-specific
implementations. Take pack direction into account when
doing fallbacks.
* tests/testmenubars.c: Test menubars in various packing
direction combinations.
* tests/Makefile.am (noinst_PROGRAMS): Add testmenubars.
Diffstat (limited to 'gtk/gtkmenubar.h')
-rw-r--r-- | gtk/gtkmenubar.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gtk/gtkmenubar.h b/gtk/gtkmenubar.h index f7a1831e64..f315c32a2a 100644 --- a/gtk/gtkmenubar.h +++ b/gtk/gtkmenubar.h @@ -44,7 +44,6 @@ extern "C" { #define GTK_IS_MENU_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_MENU_BAR)) #define GTK_MENU_BAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_MENU_BAR, GtkMenuBarClass)) - typedef struct _GtkMenuBar GtkMenuBar; typedef struct _GtkMenuBarClass GtkMenuBarClass; @@ -68,6 +67,13 @@ struct _GtkMenuBarClass GType gtk_menu_bar_get_type (void) G_GNUC_CONST; GtkWidget* gtk_menu_bar_new (void); +GtkPackDirection gtk_menu_bar_get_pack_direction (GtkMenuBar *menubar); +void gtk_menu_bar_set_pack_direction (GtkMenuBar *menubar, + GtkPackDirection pack_dir); +GtkPackDirection gtk_menu_bar_get_child_pack_direction (GtkMenuBar *menubar); +void gtk_menu_bar_set_child_pack_direction (GtkMenuBar *menubar, + GtkPackDirection child_pack_dir); + #ifndef GTK_DISABLE_DEPRECATED #define gtk_menu_bar_append(menu,child) gtk_menu_shell_append ((GtkMenuShell *)(menu),(child)) #define gtk_menu_bar_prepend(menu,child) gtk_menu_shell_prepend ((GtkMenuShell *)(menu),(child)) |