gnucash master: Multiple changes pushed
John Ralls
jralls at code.gnucash.org
Fri Dec 30 18:51:58 EST 2022
Updated via https://github.com/Gnucash/gnucash/commit/a7abb82d (commit)
via https://github.com/Gnucash/gnucash/commit/0e565f48 (commit)
from https://github.com/Gnucash/gnucash/commit/fb29ed9d (commit)
commit a7abb82d30628ced3eaafa797bdc62c0c8566379
Merge: fb29ed9d4 0e565f48d
Author: John Ralls <jralls at ceridwen.us>
Date: Fri Dec 30 15:46:51 2022 -0800
Merge Bob Fewell's 'bug403979' into master.
commit 0e565f48d63a409f058634eef5bdd35caa1aff92
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Fri Nov 25 15:12:25 2022 +0000
Bug 403979 - Balance column shows only low order digits when too narrow
When the column/cell is too narrow to display all of the numbers it
will only display the low-order digits which can be confusing.
To over come this, when the column/cell is too narrow elipsize at
the end so you have a visual indication the cell is to narrow.
diff --git a/gnucash/register/register-gnome/gnucash-sheet-private.c b/gnucash/register/register-gnome/gnucash-sheet-private.c
index 07723e296..9db025869 100644
--- a/gnucash/register/register-gnome/gnucash-sheet-private.c
+++ b/gnucash/register/register-gnome/gnucash-sheet-private.c
@@ -514,6 +514,26 @@ draw_cell (GnucashSheet *sheet, SheetBlock *block,
}
#endif
+ if ((text != NULL) && (*text != '\0') && g_strcmp0 (PRICE_CELL_TYPE_NAME,
+ gnc_table_get_cell_type_name (table, virt_loc)) == 0)
+ {
+ int text_width;
+ int text_border_padding;
+
+ pango_layout_get_pixel_size (layout, &text_width, NULL);
+
+ text_border_padding = gnc_item_edit_get_margin (item_edit, left_right) +
+ gnc_item_edit_get_padding_border (item_edit, left_right);
+
+ if (text_width + text_border_padding > width)
+ {
+ int pango_width = (width - text_border_padding) * PANGO_SCALE;
+
+ pango_layout_set_width (layout, pango_width); //pango units
+ pango_layout_set_ellipsize (layout, PANGO_ELLIPSIZE_END);
+ }
+ }
+
/* If this is the currently open transaction and
there is no text in this cell */
if ((table->current_cursor_loc.vcell_loc.virt_row ==
Summary of changes:
.../register/register-gnome/gnucash-sheet-private.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
More information about the gnucash-changes
mailing list