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.
This commit is contained in:
Owen Taylor
2002-02-27 21:57:27 +00:00
committed by Owen Taylor
parent 0be9b6fba8
commit 90b7a9f68a
8 changed files with 80 additions and 8 deletions

View File

@ -1,3 +1,12 @@
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.
Wed Feb 27 14:45:21 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtktoolbar.c (gtk_toolbar_size_allocate): Go

View File

@ -1,3 +1,12 @@
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.
Wed Feb 27 14:45:21 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtktoolbar.c (gtk_toolbar_size_allocate): Go

View File

@ -1,3 +1,12 @@
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.
Wed Feb 27 14:45:21 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtktoolbar.c (gtk_toolbar_size_allocate): Go

View File

@ -1,3 +1,12 @@
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.
Wed Feb 27 14:45:21 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtktoolbar.c (gtk_toolbar_size_allocate): Go

View File

@ -1,3 +1,12 @@
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.
Wed Feb 27 14:45:21 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtktoolbar.c (gtk_toolbar_size_allocate): Go

View File

@ -1,3 +1,12 @@
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.
Wed Feb 27 14:45:21 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtktoolbar.c (gtk_toolbar_size_allocate): Go

View File

@ -1,3 +1,12 @@
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.
Wed Feb 27 14:45:21 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtktoolbar.c (gtk_toolbar_size_allocate): Go

View File

@ -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))
{