Don't let the child draw over the focus rectangle.

2004-05-07  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkbutton.c (gtk_button_size_allocate): Don't let the child
	draw over the focus rectangle.
This commit is contained in:
Matthias Clasen 2004-05-07 15:26:35 +00:00 committed by Matthias Clasen
parent 2072f9268d
commit a4f0cc112b
5 changed files with 24 additions and 0 deletions

View File

@ -1,5 +1,8 @@
2004-05-07 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkbutton.c (gtk_button_size_allocate): Don't let the child
draw over the focus rectangle.
* gtk/gtkhsv.c: Draw focus indication in the color wheel using
standard focus style. (#63071, Bill Haneman, idea for new
style by Owen Taylor)

View File

@ -1,5 +1,8 @@
2004-05-07 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkbutton.c (gtk_button_size_allocate): Don't let the child
draw over the focus rectangle.
* gtk/gtkhsv.c: Draw focus indication in the color wheel using
standard focus style. (#63071, Bill Haneman, idea for new
style by Owen Taylor)

View File

@ -1,5 +1,8 @@
2004-05-07 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkbutton.c (gtk_button_size_allocate): Don't let the child
draw over the focus rectangle.
* gtk/gtkhsv.c: Draw focus indication in the color wheel using
standard focus style. (#63071, Bill Haneman, idea for new
style by Owen Taylor)

View File

@ -1,5 +1,8 @@
2004-05-07 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkbutton.c (gtk_button_size_allocate): Don't let the child
draw over the focus rectangle.
* gtk/gtkhsv.c: Draw focus indication in the color wheel using
standard focus style. (#63071, Bill Haneman, idea for new
style by Owen Taylor)

View File

@ -930,8 +930,15 @@ gtk_button_size_allocate (GtkWidget *widget,
gint xthickness = GTK_WIDGET (widget)->style->xthickness;
gint ythickness = GTK_WIDGET (widget)->style->ythickness;
GtkBorder default_border;
gint focus_width;
gint focus_pad;
gtk_button_get_props (button, &default_border, NULL, NULL);
gtk_widget_style_get (GTK_WIDGET (widget),
"focus-line-width", &focus_width,
"focus-padding", &focus_pad,
NULL);
widget->allocation = *allocation;
@ -960,6 +967,11 @@ gtk_button_size_allocate (GtkWidget *widget,
child_allocation.height = MAX (1, child_allocation.height - default_border.top - default_border.bottom);
}
child_allocation.x += focus_width + focus_pad;
child_allocation.y += focus_width + focus_pad;
child_allocation.width = MAX (1, child_allocation.width - (focus_width + focus_pad) * 2);
child_allocation.height = MAX (1, child_allocation.height - (focus_width + focus_pad) * 2);
if (button->depressed)
{
gint child_displacement_x;