Commit d287b713 authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen

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.
parent 8509d7f4
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.
Thu Jun 3 21:17:29 2004 Matthias Clasen <maclas@gmx.de> Thu Jun 3 21:17:29 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkentry.c (gtk_entry_completion_timeout): Calculate the * gtk/gtkentry.c (gtk_entry_completion_timeout): Calculate the
......
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.
Thu Jun 3 21:17:29 2004 Matthias Clasen <maclas@gmx.de> Thu Jun 3 21:17:29 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkentry.c (gtk_entry_completion_timeout): Calculate the * gtk/gtkentry.c (gtk_entry_completion_timeout): Calculate the
......
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.
Thu Jun 3 21:17:29 2004 Matthias Clasen <maclas@gmx.de> Thu Jun 3 21:17:29 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkentry.c (gtk_entry_completion_timeout): Calculate the * gtk/gtkentry.c (gtk_entry_completion_timeout): Calculate the
......
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.
Thu Jun 3 21:17:29 2004 Matthias Clasen <maclas@gmx.de> Thu Jun 3 21:17:29 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkentry.c (gtk_entry_completion_timeout): Calculate the * gtk/gtkentry.c (gtk_entry_completion_timeout): Calculate the
......
...@@ -271,6 +271,11 @@ GtkButton ...@@ -271,6 +271,11 @@ GtkButton
===================== =====================
NOTE: Due to a bug that is basically unfixable in a sufficiently compatible
NOTE: way, the button gives the space requested for focus_width and
NOTE: focus_padding to the child (in addition to the space requested by
NOTE: the child), if the button is !CAN_FOCUS.
Style properties Style properties
GtkWidget::interior_focus = TRUE GtkWidget::interior_focus = TRUE
......
...@@ -966,10 +966,13 @@ gtk_button_size_allocate (GtkWidget *widget, ...@@ -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.height = MAX (1, child_allocation.height - default_border.top - default_border.bottom);
} }
child_allocation.x += focus_width + focus_pad; if (GTK_WIDGET_CAN_FOCUS (button))
child_allocation.y += focus_width + focus_pad; {
child_allocation.width = MAX (1, child_allocation.width - (focus_width + focus_pad) * 2); child_allocation.x += focus_width + focus_pad;
child_allocation.height = MAX (1, child_allocation.height - (focus_width + focus_pad) * 2); 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) if (button->depressed)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment