ghex r1203 - in trunk: . src



Author: jjongsma
Date: Sun Apr 13 16:54:26 2008
New Revision: 1203
URL: http://svn.gnome.org/viewvc/ghex?rev=1203&view=rev

Log:
Fix 'floating' GtkHex widget issue (bug 527272)

	* src/gtkhex.c (draw_shadow, gtk_hex_size_allocate): Fix the allocation code
	to allocate the child widgets relative to the GtkHex allocation.x and
	allocation.y coordinates instead of (0,0).  Fixes Bug #527272


Modified:
   trunk/ChangeLog
   trunk/src/gtkhex.c

Modified: trunk/src/gtkhex.c
==============================================================================
--- trunk/src/gtkhex.c	(original)
+++ trunk/src/gtkhex.c	Sun Apr 13 16:54:26 2008
@@ -736,7 +736,8 @@
 		gtk_paint_shadow(widget->style, widget->window,
 						 GTK_STATE_NORMAL, GTK_SHADOW_IN,
 						 NULL, widget, NULL,
-						 border, border, 8*gh->char_width + 2*widget_get_xt(widget),
+						 widget->allocation.x + border, widget->allocation.y + border,
+						 8*gh->char_width + 2*widget_get_xt(widget),
 						 widget->allocation.height - 2*border);
 		x += 8*gh->char_width + 2*widget_get_xt(widget);
 	}
@@ -744,13 +745,15 @@
 	gtk_paint_shadow(widget->style, widget->window,
 					GTK_STATE_NORMAL, GTK_SHADOW_IN,
 					 NULL, widget, NULL,
-					x, border, gh->xdisp_width + 2*widget_get_xt(widget),
+					widget->allocation.x + x, widget->allocation.y + border,
+					gh->xdisp_width + 2*widget_get_xt(widget),
 					widget->allocation.height - 2*border);
 	
 	gtk_paint_shadow(widget->style, widget->window,
 					GTK_STATE_NORMAL, GTK_SHADOW_IN,
 					 NULL, widget, NULL,
-					widget->allocation.width - border - gh->adisp_width - gh->scrollbar->requisition.width - 2*widget_get_xt(widget), border,
+					widget->allocation.x + widget->allocation.width - border - gh->adisp_width - gh->scrollbar->requisition.width - 2*widget_get_xt(widget),
+					widget->allocation.y + border,
 					gh->adisp_width + 2*widget_get_xt(widget),
 					widget->allocation.height - 2*border);
 }
@@ -1818,8 +1821,8 @@
 	xt = widget_get_xt(w);
 	yt = widget_get_yt(w);
 
-   	my_alloc.x = border_width + xt;
-	my_alloc.y = border_width + yt;
+   	my_alloc.x = alloc->x + border_width + xt;
+	my_alloc.y = alloc->y + border_width + yt;
 	my_alloc.height = MAX(alloc->height - 2*border_width - 2*yt, 1);
 	if(gh->show_offsets) {
 		my_alloc.width = 8*gh->char_width;
@@ -1829,13 +1832,13 @@
 	}
 	my_alloc.width = gh->xdisp_width;
 	gtk_widget_size_allocate(gh->xdisp, &my_alloc);
-	my_alloc.x = alloc->width - border_width - gh->scrollbar->requisition.width;
-	my_alloc.y = border_width;
+	my_alloc.x = alloc->x + alloc->width - border_width - gh->scrollbar->requisition.width;
+	my_alloc.y = alloc->y + border_width;
 	my_alloc.width = gh->scrollbar->requisition.width;
 	my_alloc.height = MAX(alloc->height - 2*border_width, 1);
 	gtk_widget_size_allocate(gh->scrollbar, &my_alloc);
 	my_alloc.x -= gh->adisp_width + xt;
-	my_alloc.y = border_width + yt;
+	my_alloc.y = alloc->y + border_width + yt;
 	my_alloc.width = gh->adisp_width;
 	my_alloc.height = MAX(alloc->height - 2*border_width - 2*yt, 1);
 	gtk_widget_size_allocate(gh->adisp, &my_alloc);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]