Account for the fact that the border width is _outside_ the window. (Fixes
Thu May 31 12:43:57 2001 Owen Taylor <otaylor@redhat.com> * gtk/gtkoptionmenu.c: Account for the fact that the border width is _outside_ the window. (Fixes #54585, bug found by Bastien Nocera.)
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
Thu May 31 12:43:57 2001 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
|
* gtk/gtkoptionmenu.c: Account for the fact that the border
|
||||||
|
width is _outside_ the window. (Fixes #54585, bug found
|
||||||
|
by Bastien Nocera.)
|
||||||
|
|
||||||
Wed May 30 15:56:30 2001 Owen Taylor <otaylor@redhat.com>
|
Wed May 30 15:56:30 2001 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* gtk/gtksettings.c (gtk_settings_get_property): Validate
|
* gtk/gtksettings.c (gtk_settings_get_property): Validate
|
||||||
|
|||||||
@ -1,3 +1,9 @@
|
|||||||
|
Thu May 31 12:43:57 2001 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
|
* gtk/gtkoptionmenu.c: Account for the fact that the border
|
||||||
|
width is _outside_ the window. (Fixes #54585, bug found
|
||||||
|
by Bastien Nocera.)
|
||||||
|
|
||||||
Wed May 30 15:56:30 2001 Owen Taylor <otaylor@redhat.com>
|
Wed May 30 15:56:30 2001 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* gtk/gtksettings.c (gtk_settings_get_property): Validate
|
* gtk/gtksettings.c (gtk_settings_get_property): Validate
|
||||||
|
|||||||
@ -1,3 +1,9 @@
|
|||||||
|
Thu May 31 12:43:57 2001 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
|
* gtk/gtkoptionmenu.c: Account for the fact that the border
|
||||||
|
width is _outside_ the window. (Fixes #54585, bug found
|
||||||
|
by Bastien Nocera.)
|
||||||
|
|
||||||
Wed May 30 15:56:30 2001 Owen Taylor <otaylor@redhat.com>
|
Wed May 30 15:56:30 2001 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* gtk/gtksettings.c (gtk_settings_get_property): Validate
|
* gtk/gtksettings.c (gtk_settings_get_property): Validate
|
||||||
|
|||||||
@ -1,3 +1,9 @@
|
|||||||
|
Thu May 31 12:43:57 2001 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
|
* gtk/gtkoptionmenu.c: Account for the fact that the border
|
||||||
|
width is _outside_ the window. (Fixes #54585, bug found
|
||||||
|
by Bastien Nocera.)
|
||||||
|
|
||||||
Wed May 30 15:56:30 2001 Owen Taylor <otaylor@redhat.com>
|
Wed May 30 15:56:30 2001 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* gtk/gtksettings.c (gtk_settings_get_property): Validate
|
* gtk/gtksettings.c (gtk_settings_get_property): Validate
|
||||||
|
|||||||
@ -1,3 +1,9 @@
|
|||||||
|
Thu May 31 12:43:57 2001 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
|
* gtk/gtkoptionmenu.c: Account for the fact that the border
|
||||||
|
width is _outside_ the window. (Fixes #54585, bug found
|
||||||
|
by Bastien Nocera.)
|
||||||
|
|
||||||
Wed May 30 15:56:30 2001 Owen Taylor <otaylor@redhat.com>
|
Wed May 30 15:56:30 2001 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* gtk/gtksettings.c (gtk_settings_get_property): Validate
|
* gtk/gtksettings.c (gtk_settings_get_property): Validate
|
||||||
|
|||||||
@ -1,3 +1,9 @@
|
|||||||
|
Thu May 31 12:43:57 2001 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
|
* gtk/gtkoptionmenu.c: Account for the fact that the border
|
||||||
|
width is _outside_ the window. (Fixes #54585, bug found
|
||||||
|
by Bastien Nocera.)
|
||||||
|
|
||||||
Wed May 30 15:56:30 2001 Owen Taylor <otaylor@redhat.com>
|
Wed May 30 15:56:30 2001 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* gtk/gtksettings.c (gtk_settings_get_property): Validate
|
* gtk/gtksettings.c (gtk_settings_get_property): Validate
|
||||||
|
|||||||
@ -1,3 +1,9 @@
|
|||||||
|
Thu May 31 12:43:57 2001 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
|
* gtk/gtkoptionmenu.c: Account for the fact that the border
|
||||||
|
width is _outside_ the window. (Fixes #54585, bug found
|
||||||
|
by Bastien Nocera.)
|
||||||
|
|
||||||
Wed May 30 15:56:30 2001 Owen Taylor <otaylor@redhat.com>
|
Wed May 30 15:56:30 2001 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* gtk/gtksettings.c (gtk_settings_get_property): Validate
|
* gtk/gtksettings.c (gtk_settings_get_property): Validate
|
||||||
|
|||||||
@ -397,30 +397,26 @@ gtk_option_menu_size_allocate (GtkWidget *widget,
|
|||||||
GtkWidget *child;
|
GtkWidget *child;
|
||||||
GtkAllocation child_allocation;
|
GtkAllocation child_allocation;
|
||||||
GtkOptionMenuProps props;
|
GtkOptionMenuProps props;
|
||||||
|
gint border_width;
|
||||||
g_return_if_fail (widget != NULL);
|
|
||||||
g_return_if_fail (GTK_IS_OPTION_MENU (widget));
|
|
||||||
g_return_if_fail (allocation != NULL);
|
|
||||||
|
|
||||||
gtk_option_menu_get_props (GTK_OPTION_MENU (widget), &props);
|
gtk_option_menu_get_props (GTK_OPTION_MENU (widget), &props);
|
||||||
|
border_width = GTK_CONTAINER (widget)->border_width;
|
||||||
|
|
||||||
widget->allocation = *allocation;
|
widget->allocation = *allocation;
|
||||||
if (GTK_WIDGET_REALIZED (widget))
|
if (GTK_WIDGET_REALIZED (widget))
|
||||||
gdk_window_move_resize (widget->window,
|
gdk_window_move_resize (widget->window,
|
||||||
allocation->x, allocation->y,
|
allocation->x + border_width, allocation->y + border_width,
|
||||||
allocation->width, allocation->height);
|
allocation->width - border_width * 2, allocation->height - border_width * 2);
|
||||||
|
|
||||||
child = GTK_BIN (widget)->child;
|
child = GTK_BIN (widget)->child;
|
||||||
if (child && GTK_WIDGET_VISIBLE (child))
|
if (child && GTK_WIDGET_VISIBLE (child))
|
||||||
{
|
{
|
||||||
child_allocation.x = (GTK_CONTAINER (widget)->border_width +
|
child_allocation.x = GTK_WIDGET (widget)->style->xthickness + 1;
|
||||||
GTK_WIDGET (widget)->style->xthickness) + 1;
|
child_allocation.y = GTK_CONTAINER (widget)->border_width + 1;
|
||||||
child_allocation.y = (GTK_CONTAINER (widget)->border_width +
|
child_allocation.width = MAX (1, (gint)allocation->width - child_allocation.x * 2 - border_width * 2 -
|
||||||
GTK_WIDGET (widget)->style->ythickness) + 1;
|
|
||||||
child_allocation.width = MAX (1, (gint)allocation->width - child_allocation.x * 2 -
|
|
||||||
props.indicator_size.width - props.indicator_spacing.left - props.indicator_spacing.right -
|
props.indicator_size.width - props.indicator_spacing.left - props.indicator_spacing.right -
|
||||||
CHILD_LEFT_SPACING - CHILD_RIGHT_SPACING - 2);
|
CHILD_LEFT_SPACING - CHILD_RIGHT_SPACING - 2);
|
||||||
child_allocation.height = MAX (1, (gint)allocation->height - child_allocation.y * 2 -
|
child_allocation.height = MAX (1, (gint)allocation->height - child_allocation.y * 2 - border_width * 2 -
|
||||||
CHILD_TOP_SPACING - CHILD_BOTTOM_SPACING - 2);
|
CHILD_TOP_SPACING - CHILD_BOTTOM_SPACING - 2);
|
||||||
child_allocation.x += CHILD_LEFT_SPACING;
|
child_allocation.x += CHILD_LEFT_SPACING;
|
||||||
child_allocation.y += CHILD_TOP_SPACING;
|
child_allocation.y += CHILD_TOP_SPACING;
|
||||||
@ -435,6 +431,7 @@ gtk_option_menu_paint (GtkWidget *widget,
|
|||||||
{
|
{
|
||||||
GdkRectangle button_area;
|
GdkRectangle button_area;
|
||||||
GtkOptionMenuProps props;
|
GtkOptionMenuProps props;
|
||||||
|
gint border_width;
|
||||||
|
|
||||||
g_return_if_fail (widget != NULL);
|
g_return_if_fail (widget != NULL);
|
||||||
g_return_if_fail (GTK_IS_OPTION_MENU (widget));
|
g_return_if_fail (GTK_IS_OPTION_MENU (widget));
|
||||||
@ -442,12 +439,11 @@ gtk_option_menu_paint (GtkWidget *widget,
|
|||||||
|
|
||||||
if (GTK_WIDGET_DRAWABLE (widget))
|
if (GTK_WIDGET_DRAWABLE (widget))
|
||||||
{
|
{
|
||||||
gint border_width = GTK_CONTAINER (widget)->border_width;
|
border_width = GTK_CONTAINER (widget)->border_width;
|
||||||
|
|
||||||
gtk_option_menu_get_props (GTK_OPTION_MENU (widget), &props);
|
gtk_option_menu_get_props (GTK_OPTION_MENU (widget), &props);
|
||||||
|
|
||||||
button_area.x = border_width;
|
button_area.x = 0;
|
||||||
button_area.y = border_width;
|
button_area.y = 0;
|
||||||
button_area.width = widget->allocation.width - 2 * border_width;
|
button_area.width = widget->allocation.width - 2 * border_width;
|
||||||
button_area.height = widget->allocation.height - 2 * border_width;
|
button_area.height = widget->allocation.height - 2 * border_width;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user