summaryrefslogtreecommitdiff
path: root/gtk/gtkmenubar.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@pobox.com>2001-02-13 05:44:47 +0000
committerHavoc Pennington <hp@src.gnome.org>2001-02-13 05:44:47 +0000
commit2097d764a7a60f87a0ca4c43720f3e2644652a14 (patch)
tree5ce16eb25b20f4f6993b003c8e35e4eaf2f9b3c8 /gtk/gtkmenubar.c
parent41b2d039af6f972a5c442d860277164f90fb9ccb (diff)
downloadgdk-pixbuf-2097d764a7a60f87a0ca4c43720f3e2644652a14.tar.gz
fix bug where it always set the foreground, even if we were only using a
2001-02-12 Havoc Pennington <hp@pobox.com> * gdk/gdkpango.c (gdk_pango_get_gc): fix bug where it always set the foreground, even if we were only using a stipple. (gdk_draw_layout_line_with_colors): new function, allow override colors (gdk_draw_layout_with_colors): new function, allow override colors (gdk_pango_layout_line_get_clip_region): function to get the clip region for a logical text range (gdk_pango_layout_get_clip_region): get the clip region for a logical text range * gdk/x11/gdkcolor-x11.c: forward declare gdk_colormap_sync(), (gdk_colormap_new): fix call to gdk_colormap_sync() so it has the right number of arguments. * gtk/gtktextbtree.c (gtk_text_btree_node_check_consistency): enhance the function to check that node data corresponds to a view still belonging to the tree. * gtk/gtktreeview.c (gtk_tree_view_changed): we were leaking the GtkTreePath (gtk_tree_view_inserted): ditto (gtk_tree_view_child_toggled): ditto * gtk/gtktreemodel.c (gtk_tree_path_append_index): use realloc to simplify this code. * gtk/gtkcellrenderertext.c (get_layout): fix leak of a PangoAttrList * demos/gtk-demo/main.c (load_file): Fix leak of a GString * gtk/gtkentry.c (gtk_entry_realize): Fix leak of a GdkCursor * gtk/gtkmenubar.c (gtk_menu_bar_size_request): consider toggle size in the size request (gtk_menu_bar_size_allocate): consider toggle size here * gtk/gtkimagemenuitem.h, gtkimagemenuitem.c: Menu item that displays a widget in the toggle slot * gtk/testgtk.c: test GtkImageMenuItem * gtk/Makefile.am, gtk/gtk.h: Add GtkImageMenuItem * gtk/gtkmenuitem.h: Use "gint" not "guint16" for toggle size request and allocation * gtk/gtkmenu.c (gtk_menu_size_request): use gint not guint16 * gtk/gtkcheckmenuitem.c (gtk_check_menu_item_toggle_size_request): ditto
Diffstat (limited to 'gtk/gtkmenubar.c')
-rw-r--r--gtk/gtkmenubar.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/gtk/gtkmenubar.c b/gtk/gtkmenubar.c
index 3be496c72..e6e7baf2d 100644
--- a/gtk/gtkmenubar.c
+++ b/gtk/gtkmenubar.c
@@ -237,10 +237,16 @@ gtk_menu_bar_size_request (GtkWidget *widget,
if (GTK_WIDGET_VISIBLE (child))
{
+ gint toggle_size;
+
GTK_MENU_ITEM (child)->show_submenu_indicator = FALSE;
gtk_widget_size_request (child, &child_requisition);
-
+ gtk_menu_item_toggle_size_request (GTK_MENU_ITEM (child),
+ &toggle_size);
+
requisition->width += child_requisition.width;
+ requisition->width += toggle_size;
+
requisition->height = MAX (requisition->height, child_requisition.height);
/* Support for the right justified help menu */
if ((children == NULL) && GTK_IS_MENU_ITEM(child) &&
@@ -305,11 +311,17 @@ gtk_menu_bar_size_allocate (GtkWidget *widget,
children = menu_shell->children;
while (children)
{
+ gint toggle_size;
+
child = children->data;
children = children->next;
+ gtk_menu_item_toggle_size_request (GTK_MENU_ITEM (child),
+ &toggle_size);
gtk_widget_get_child_requisition (child, &child_requisition);
-
+
+ child_requisition.width += toggle_size;
+
/* Support for the right justified help menu */
if ( (children == NULL) && (GTK_IS_MENU_ITEM(child))
&& (GTK_MENU_ITEM(child)->right_justify))
@@ -321,6 +333,8 @@ gtk_menu_bar_size_allocate (GtkWidget *widget,
{
child_allocation.width = child_requisition.width;
+ gtk_menu_item_toggle_size_allocate (GTK_MENU_ITEM (child),
+ toggle_size);
gtk_widget_size_allocate (child, &child_allocation);
child_allocation.x += child_allocation.width + CHILD_SPACING * 2;