[Gnucash-changes] r13319 - gnucash/trunk - If the number of "visible to the user" lines in the register has

David Hampton hampton at cvs.gnucash.org
Mon Feb 20 11:02:08 EST 2006


Author: hampton
Date: 2006-02-20 11:02:06 -0500 (Mon, 20 Feb 2006)
New Revision: 13319
Trac: http://svn.gnucash.org/trac/changeset/13319

Modified:
   gnucash/trunk/ChangeLog
   gnucash/trunk/src/register/register-gnome/gnucash-sheet.c
Log:
If the number of "visible to the user" lines in the register has
shrunk, force the parent widget to redraw.  This fixes #328787.


Modified: gnucash/trunk/ChangeLog
===================================================================
--- gnucash/trunk/ChangeLog	2006-02-20 10:10:14 UTC (rev 13318)
+++ gnucash/trunk/ChangeLog	2006-02-20 16:02:06 UTC (rev 13319)
@@ -1,3 +1,9 @@
+2006-02-20  David Hampton  <hampton at employees.org>
+
+	* src/register/register-gnome/gnucash-sheet.c: If the number of
+	"visible to the user" lines in the register has shrunk, force the
+	parent widget to redraw.  This fixes #328787.
+
 2006-02-19  Derek Atkins  <derek at ihtfp.com>
 
 	* src/engine/Transaction.c:

Modified: gnucash/trunk/src/register/register-gnome/gnucash-sheet.c
===================================================================
--- gnucash/trunk/src/register/register-gnome/gnucash-sheet.c	2006-02-20 10:10:14 UTC (rev 13318)
+++ gnucash/trunk/src/register/register-gnome/gnucash-sheet.c	2006-02-20 16:02:06 UTC (rev 13319)
@@ -343,6 +343,7 @@
         VirtualCellLocation vcell_loc;
         gint height;
         gint cy;
+	gint old_visible_blocks, old_visible_rows;
 
         g_return_if_fail (sheet != NULL);
         g_return_if_fail (GNUCASH_IS_SHEET (sheet));
@@ -354,6 +355,8 @@
 
         sheet->top_block = gnucash_sheet_y_pixel_to_block (sheet, cy);
 
+	old_visible_blocks = sheet->num_visible_blocks;
+	old_visible_rows = sheet->num_visible_phys_rows;
         sheet->num_visible_blocks = 0;
         sheet->num_visible_phys_rows = 0;
 
@@ -380,6 +383,16 @@
         /* FIXME */
         sheet->left_block = 0;
         sheet->right_block = 0;
+
+	if ((old_visible_blocks > sheet->num_visible_blocks) ||
+	    (old_visible_rows > sheet->num_visible_phys_rows)) {
+		/* Reach up and tell the parent widget to redraw as
+		 * well.  The sheet doesn't occupy all the visible
+		 * area in the notebook page, and this will cause the
+		 * parent to color in the empty grey space after the
+		 * area occupied by the sheet. */
+		gtk_widget_queue_draw(gtk_widget_get_parent(GTK_WIDGET(sheet)));
+	}
 }
 
 



More information about the gnucash-changes mailing list