summaryrefslogtreecommitdiff
path: root/gtk/gtkmenubar.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2002-02-27 21:57:27 +0000
committerOwen Taylor <otaylor@src.gnome.org>2002-02-27 21:57:27 +0000
commit90b7a9f68a6e8e6bd8375bf32fa54a4bb3259ad1 (patch)
treeb001953ead19f18faea604f0d7091cfc48f34823 /gtk/gtkmenubar.c
parent0be9b6fba856ee2d919f208beb9a0fbf19b55518 (diff)
downloadgdk-pixbuf-90b7a9f68a6e8e6bd8375bf32fa54a4bb3259ad1.tar.gz
Don't reserve space for border when the shadow type for the menubar is
Wed Feb 27 14:58:12 2002 Owen Taylor <otaylor@redhat.com> * gtk/gtkmenubar.c (gtk_menu_bar_size_request/allocate): Don't reserve space for border when the shadow type for the menubar is "none". (#61843) * gtk/gtkmenubar.c (gtk_menu_bar_size_allocate): Fix offset for right-justified menu items.
Diffstat (limited to 'gtk/gtkmenubar.c')
-rw-r--r--gtk/gtkmenubar.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/gtk/gtkmenubar.c b/gtk/gtkmenubar.c
index 84a40da83..3a3e9399d 100644
--- a/gtk/gtkmenubar.c
+++ b/gtk/gtkmenubar.c
@@ -228,14 +228,18 @@ gtk_menu_bar_size_request (GtkWidget *widget,
gtk_widget_style_get (widget, "internal_padding", &ipadding, NULL);
requisition->width += (GTK_CONTAINER (menu_bar)->border_width +
- widget->style->xthickness +
ipadding +
BORDER_SPACING) * 2;
requisition->height += (GTK_CONTAINER (menu_bar)->border_width +
- widget->style->ythickness +
ipadding +
BORDER_SPACING) * 2;
+ if (get_shadow_type (menu_bar) != GTK_SHADOW_NONE)
+ {
+ requisition->width += widget->style->xthickness * 2;
+ requisition->height += widget->style->ythickness * 2;
+ }
+
if (nchildren > 0)
requisition->width += 2 * CHILD_SPACING * (nchildren - 1);
}
@@ -271,17 +275,22 @@ gtk_menu_bar_size_allocate (GtkWidget *widget,
if (menu_shell->children)
{
child_allocation.x = (GTK_CONTAINER (menu_bar)->border_width +
- widget->style->xthickness +
ipadding +
BORDER_SPACING);
- offset = child_allocation.x; /* Window edge to menubar start */
-
child_allocation.y = (GTK_CONTAINER (menu_bar)->border_width +
- widget->style->ythickness +
ipadding +
BORDER_SPACING);
+
+ if (get_shadow_type (menu_bar) != GTK_SHADOW_NONE)
+ {
+ child_allocation.x += widget->style->xthickness;
+ child_allocation.y += widget->style->ythickness;
+ }
+
child_allocation.height = MAX (1, (gint)allocation->height - child_allocation.y * 2);
+ offset = child_allocation.x; /* Window edge to menubar start */
+
children = menu_shell->children;
while (children)
{
@@ -297,11 +306,11 @@ gtk_menu_bar_size_allocate (GtkWidget *widget,
child_requisition.width += toggle_size;
/* Support for the right justified help menu */
- if ( (children == NULL) && (GTK_IS_MENU_ITEM(child))
+ if ((children == NULL) && (GTK_IS_MENU_ITEM(child))
&& (GTK_MENU_ITEM(child)->right_justify))
{
child_allocation.x = allocation->width -
- child_requisition.width - CHILD_SPACING - offset;
+ child_requisition.width - offset;
}
if (GTK_WIDGET_VISIBLE (child))
{