From ba8e5adcfe00c659f055d0e851a895c2b83e2554 Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Fri, 11 Jun 2004 23:16:13 +0000 Subject: Make spinner not use a visible window, and fix coordinates accordingly. 2004-06-12 Christian Persch * lib/widgets/ephy-spinner.c: (ephy_spinner_new), (ephy_spinner_init), (ephy_spinner_expose): Make spinner not use a visible window, and fix coordinates accordingly. Patch by Crispin Flowerday, fixes bug #134686. --- lib/widgets/ephy-spinner.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'lib/widgets/ephy-spinner.c') diff --git a/lib/widgets/ephy-spinner.c b/lib/widgets/ephy-spinner.c index 19ddae8bb..7467b85cb 100644 --- a/lib/widgets/ephy-spinner.c +++ b/lib/widgets/ephy-spinner.c @@ -105,7 +105,9 @@ ephy_spinner_get_type (void) GtkWidget * ephy_spinner_new (void) { - return GTK_WIDGET (g_object_new (EPHY_TYPE_SPINNER, NULL)); + return GTK_WIDGET (g_object_new (EPHY_TYPE_SPINNER, + "visible-window", FALSE, + NULL)); } static gboolean @@ -164,8 +166,6 @@ ephy_spinner_init (EphySpinner *spinner) { GtkWidget *widget = GTK_WIDGET (spinner); - GTK_WIDGET_UNSET_FLAGS (spinner, GTK_NO_WINDOW); - gtk_widget_set_events (widget, gtk_widget_get_events (widget) | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK @@ -261,8 +261,8 @@ ephy_spinner_expose (GtkWidget *widget, GdkEventExpose *event) x_offset = (widget->allocation.width - width) / 2; y_offset = (widget->allocation.height - height) / 2; - pix_area.x = x_offset; - pix_area.y = y_offset; + pix_area.x = x_offset + widget->allocation.x; + pix_area.y = y_offset + widget->allocation.y; pix_area.width = width; pix_area.height = height; @@ -274,7 +274,8 @@ ephy_spinner_expose (GtkWidget *widget, GdkEventExpose *event) gc = gdk_gc_new (widget->window); gdk_draw_pixbuf (widget->window, gc, pixbuf, - dest.x - x_offset, dest.y - y_offset, + dest.x - x_offset - widget->allocation.x, + dest.y - y_offset - widget->allocation.y, dest.x, dest.y, dest.width, dest.height, GDK_RGB_DITHER_MAX, 0, 0); -- cgit v1.2.3