[Gnucash-changes] r14309 - gnucash/trunk - Only use the amount of space required to show all the entries in the

David Hampton hampton at cvs.gnucash.org
Sat Jun 3 17:20:53 EDT 2006


Author: hampton
Date: 2006-06-03 17:20:52 -0400 (Sat, 03 Jun 2006)
New Revision: 14309
Trac: http://svn.gnucash.org/trac/changeset/14309

Modified:
   gnucash/trunk/ChangeLog
   gnucash/trunk/src/register/register-gnome/combocell-gnome.c
   gnucash/trunk/src/register/register-gnome/gnucash-item-list.c
   gnucash/trunk/src/register/register-gnome/gnucash-item-list.h
Log:
Only use the amount of space required to show all the entries in the
popup, not all the available space. Fixes #343242.


Modified: gnucash/trunk/ChangeLog
===================================================================
--- gnucash/trunk/ChangeLog	2006-06-03 19:58:18 UTC (rev 14308)
+++ gnucash/trunk/ChangeLog	2006-06-03 21:20:52 UTC (rev 14309)
@@ -1,5 +1,10 @@
 2006-06-03  David Hampton  <hampton at employees.org>
 
+	* src/register/register-gnome/combocell-gnome.c:
+	* src/register/register-gnome/gnucash-item-list.[ch]: Only use the
+	amount of space required to show all the entries in the popup, not
+	all the available space. Fixes #343242.
+
 	* src/register/register-gnome/gnucash-sheet.c: The register code
 	shouldn't process any keystrokes that have a "modifier" (e.g. Alt,
 	Meta, etc.) key pressed.  This allows Alt-Ctl-Pgup/Down in a

Modified: gnucash/trunk/src/register/register-gnome/combocell-gnome.c
===================================================================
--- gnucash/trunk/src/register/register-gnome/combocell-gnome.c	2006-06-03 19:58:18 UTC (rev 14308)
+++ gnucash/trunk/src/register/register-gnome/combocell-gnome.c	2006-06-03 21:20:52 UTC (rev 14309)
@@ -785,7 +785,11 @@
                   int row_height,
                   gpointer user_data)
 {
-        return space_available;
+        PopBox *box = user_data;
+        int count, pad = 4;
+
+        count = gnc_item_list_num_entries(box->item_list);
+        return MIN(space_available, (count * (row_height + pad)) + pad);
 }
 
 static int

Modified: gnucash/trunk/src/register/register-gnome/gnucash-item-list.c
===================================================================
--- gnucash/trunk/src/register/register-gnome/gnucash-item-list.c	2006-06-03 19:58:18 UTC (rev 14308)
+++ gnucash/trunk/src/register/register-gnome/gnucash-item-list.c	2006-06-03 21:20:52 UTC (rev 14309)
@@ -51,7 +51,19 @@
 
 gboolean _gnc_item_find_selection(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data);
 
+gint
+gnc_item_list_num_entries (GncItemList *item_list)
+{
+        GtkTreeModel *model;
 
+        g_return_val_if_fail(item_list != NULL, 0);
+        g_return_val_if_fail(IS_GNC_ITEM_LIST(item_list), 0);
+
+        model = GTK_TREE_MODEL(item_list->list_store);
+        return gtk_tree_model_iter_n_children(model, NULL);
+}
+
+
 void
 gnc_item_list_clear (GncItemList *item_list)
 {

Modified: gnucash/trunk/src/register/register-gnome/gnucash-item-list.h
===================================================================
--- gnucash/trunk/src/register/register-gnome/gnucash-item-list.h	2006-06-03 19:58:18 UTC (rev 14308)
+++ gnucash/trunk/src/register/register-gnome/gnucash-item-list.h	2006-06-03 21:20:52 UTC (rev 14309)
@@ -61,6 +61,8 @@
 
 GnomeCanvasItem *gnc_item_list_new (GnomeCanvasGroup *parent, GtkListStore *shared_store);
 
+gint gnc_item_list_num_entries (GncItemList *item_list);
+
 void gnc_item_list_clear (GncItemList *item_list);
 
 void gnc_item_list_append (GncItemList *item_list, char *string);



More information about the gnucash-changes mailing list