This function doesn't do much and is only used for new account registers

This function is used to get the width of the toggle button and add it
to the sample text length to set the default column width. As it is
square, just use the row height instead and the user will no doubt set
there own widths any way.
This commit is contained in:
Robert Fewell 2017-11-01 11:57:58 +00:00
parent bb16e07d8f
commit 70ad2c3bc4
3 changed files with 3 additions and 12 deletions

View File

@ -94,14 +94,6 @@ gnc_item_edit_get_pixel_coords (GncItemEdit *item_edit,
*y += yd;
}
int
gnc_item_edit_get_toggle_offset (int row_height)
{
/* sync with gnc_item_edit_update */
return row_height - (2 * (CELL_VPADDING + 1)) + 3;
}
static gboolean
gnc_item_edit_update (GncItemEdit *item_edit)
{

View File

@ -133,8 +133,6 @@ void gnc_item_edit_set_popup (GncItemEdit *item_edit,
void gnc_item_edit_show_popup (GncItemEdit *item_edit);
void gnc_item_edit_hide_popup (GncItemEdit *item_edit);
int gnc_item_edit_get_toggle_offset (int row_height);
void gnc_item_edit_cut_clipboard (GncItemEdit *item_edit);
void gnc_item_edit_copy_clipboard (GncItemEdit *item_edit);
void gnc_item_edit_paste_clipboard (GncItemEdit *item_edit);

View File

@ -215,9 +215,10 @@ set_dimensions_pass_one (GnucashSheet *sheet, CellBlock *cursor,
if (cd->pixel_width > 0)
continue;
// This is used on new account popup cells to get the default
// width of text plus toggle button.
if (cell && cell->is_popup)
width += gnc_item_edit_get_toggle_offset
(cd->pixel_height);
width += cd->pixel_height; // toggle button is square, use cell height
cd->pixel_width = MAX (cd->pixel_width, width);
}