Smarter register combo box height calculations. Misc work.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@3011 57a11ea4-9604-0410-9ed3-97b8803252fd
zzzoldreleases/1.6
Dave Peticolas 26 years ago
parent d66f044a61
commit 010d59408b

@ -2350,7 +2350,8 @@ xaccSRSaveRegEntry (SplitRegister *reg, gboolean do_commit)
xaccTransSetDateEnteredSecs(trans, time(NULL));
}
if (split == NULL) {
if (split == NULL)
{
/* If we were asked to save data for a row for which there is no
* associated split, then assume that this was a row that was
* set aside for adding splits to an existing transaction.

@ -1047,6 +1047,8 @@ item_edit_show_list (ItemEdit *item_edit)
gint list_x, list_y;
gint list_height;
gint view_height;
gint up_height;
gint down_height;
g_return_if_fail(item_edit != NULL);
g_return_if_fail(IS_ITEM_EDIT(item_edit));
@ -1060,15 +1062,22 @@ item_edit_show_list (ItemEdit *item_edit)
item_edit_get_pixel_coords (item_edit, &x, &y, &w, &h);
list_x = x;
list_y = y + h;
list_height = h * 6;
if ((list_y - y_offset) + list_height > view_height) {
up_height = y - y_offset;
down_height = view_height - (up_height + h);
if (up_height > down_height) {
list_y = y;
list_anchor = GTK_ANCHOR_SW;
list_height = up_height;
}
else
else {
list_y = y + h;
list_anchor = GTK_ANCHOR_NW;
list_height = down_height;
}
list_height = (list_height / h) * h;
gnc_item_list_autosize(item_edit->item_list);

@ -140,3 +140,21 @@ g_table_resize (GTable *gtable, int rows, int cols)
gtable->rows = rows;
gtable->cols = cols;
}
int
g_table_rows (GTable *gtable)
{
if (gtable == NULL)
return 0;
return gtable->rows;
}
int
g_table_cols (GTable *gtable)
{
if (gtable == NULL)
return 0;
return gtable->cols;
}

@ -57,4 +57,10 @@ gpointer g_table_index (GTable *gtable, int row, int col);
* first. */
void g_table_resize (GTable *gtable, int rows, int cols);
/* Return the number of table rows. */
int g_table_rows (GTable *gtable);
/* Return the number of table columns. */
int g_table_cols (GTable *gtable);
#endif

@ -332,9 +332,8 @@ gnc_table_set_size (Table * table, int virt_rows, int virt_cols)
{
/* Invalidate the current cursor position, if the array is
* shrinking. This must be done since the table is probably
* shrinking because some rows were deleted, and there's a pretty
* good chance (100% with current design) that the cursor is
* located on the deleted rows. */
* shrinking because some rows were deleted, and the cursor
* could be on the deleted rows. */
if ((virt_rows < table->num_virt_rows) ||
(virt_cols < table->num_virt_cols))
{

Loading…
Cancel
Save