summaryrefslogtreecommitdiff
path: root/gtk/gtkbutton.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2004-05-07 15:26:35 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2004-05-07 15:26:35 +0000
commita4f0cc112b133b624559781b4e95087e525b30be (patch)
tree084ad27175c2139328d91a7b4644f561e572f9e0 /gtk/gtkbutton.c
parent2072f9268dd316cfa701b785bf38efcde9b06f2d (diff)
downloadgdk-pixbuf-a4f0cc112b133b624559781b4e95087e525b30be.tar.gz
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.
Diffstat (limited to 'gtk/gtkbutton.c')
-rw-r--r--gtk/gtkbutton.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c
index d1c7c1610..f60fb6820 100644
--- a/gtk/gtkbutton.c
+++ b/gtk/gtkbutton.c
@@ -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;