Commit 6878910a authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor

Code cleanup.

Thu Jan 21 16:03:02 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkbutton.c (gtk_button_expose): Code cleanup.

	* gtk/gtktree.c: Add a paint routine, fix up bugs
	in drawing where if the expose area was contained
	completely in the right side of the tree the background
	wasn't redraw, etc.

	* gtk/gtkwidget.c (gtk_widget_clip_rect): Fix a bug
	in clipping draw regions while propagating them
	upwards.
parent d1d9c5bf
......@@ -636,7 +636,7 @@ static gint
gtk_button_expose (GtkWidget *widget,
GdkEventExpose *event)
{
GtkButton *button;
GtkButton *bin;
GdkEventExpose child_event;
g_return_val_if_fail (widget != NULL, FALSE);
......@@ -645,14 +645,14 @@ gtk_button_expose (GtkWidget *widget,
if (GTK_WIDGET_DRAWABLE (widget))
{
button = GTK_BUTTON (widget);
bin = GTK_BIN (widget);
gtk_button_paint (widget, &event->area);
child_event = *event;
if (GTK_BIN (button)->child && GTK_WIDGET_NO_WINDOW (GTK_BIN (button)->child) &&
gtk_widget_intersect (GTK_BIN (button)->child, &event->area, &child_event.area))
gtk_widget_event (GTK_BIN (button)->child, (GdkEvent*) &child_event);
if (bin->child && GTK_WIDGET_NO_WINDOW (bin->child) &&
gtk_widget_intersect (bin->child, &event->area, &child_event.area))
gtk_widget_event (bin->child, (GdkEvent*) &child_event);
}
return FALSE;
......
......@@ -1971,12 +1971,12 @@ gtk_widget_clip_rect (GtkWidget *widget,
if (rect->x < 0)
{
rect->width = (width > -rect->x) ? width + rect->x : 0;
rect->width = (rect->width > -rect->x) ? rect->width + rect->x : 0;
rect->x = 0;
}
if (rect->y < 0)
{
rect->height = (height > -rect->y) ? width + rect->y : 0;
rect->height = (rect->height > -rect->y) ? rect->width + rect->y : 0;
rect->y = 0;
}
if (rect->x + rect->width > width)
......
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