summaryrefslogtreecommitdiff
path: root/gtk/gtkbutton.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2004-06-05 03:58:50 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2004-06-05 03:58:50 +0000
commitd287b71399f7eecc79fc8379730c9ecc6bf0da5c (patch)
tree1b62305bad628582304ecb26d2a6e5e1ea2c62b4 /gtk/gtkbutton.c
parent8509d7f4ea6c11b88bf6c1b56bad7ebe89c12df7 (diff)
downloadgtk+-d287b71399f7eecc79fc8379730c9ecc6bf0da5c.tar.gz
Add a note about the !CAN_FOCUS quirk in the button size allocation code.
2004-06-04 Matthias Clasen <mclasen@redhat.com> * docs/widget_geometry.txt: Add a note about the !CAN_FOCUS quirk in the button size allocation code. * gtk/gtkbutton.c (gtk_button_size_allocate): Give the space requested for drawing the focus indicator to the child in the !CAN_FOCUS case. This should fix issues which the Gimp has with the button allocation changes in 2.4.2.
Diffstat (limited to 'gtk/gtkbutton.c')
-rw-r--r--gtk/gtkbutton.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c
index 02cc192320..72c2117816 100644
--- a/gtk/gtkbutton.c
+++ b/gtk/gtkbutton.c
@@ -966,10 +966,13 @@ 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 (GTK_WIDGET_CAN_FOCUS (button))
+ {
+ 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)
{