gnucash maint: Multiple changes pushed

Robert Fewell bobit at code.gnucash.org
Mon Dec 13 08:47:12 EST 2021


Updated	 via  https://github.com/Gnucash/gnucash/commit/793c8735 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/11ed0b5d (commit)
	 via  https://github.com/Gnucash/gnucash/commit/75be8001 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/89e9211c (commit)
	 via  https://github.com/Gnucash/gnucash/commit/c48a887c (commit)
	from  https://github.com/Gnucash/gnucash/commit/f363e176 (commit)



commit 793c8735b81f8839db6c37cc624c28cf499c1d04
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Sun Dec 12 11:34:42 2021 +0000

    Bug 798266 - Dropdown picker menu for category does not appear
    
    If the OS/Theme is not using overlay scrolling, the register combos's
    will not pop. This is down to the popup calculated height not including
    the space for the horizontal scrollbar.
    
    To fix this test for the horizontal scrollbar having the style class
    "overlay-indicator" and if so add the height of the horizontal
    scrollbar to the popup calculated height.
    
    This can be seen if in a terminal you...
    export GTK_OVERLAY_SCROLLING=0
    and then run gnucash.

diff --git a/gnucash/register/register-gnome/combocell-gnome.c b/gnucash/register/register-gnome/combocell-gnome.c
index f0a73da02..cc1a88c5c 100644
--- a/gnucash/register/register-gnome/combocell-gnome.c
+++ b/gnucash/register/register-gnome/combocell-gnome.c
@@ -910,11 +910,23 @@ popup_get_height (G_GNUC_UNUSED GtkWidget* widget,
 {
     PopBox* box = user_data;
     GtkScrolledWindow* scrollwin = GNC_ITEM_LIST(widget)->scrollwin;
+    GtkWidget *hsbar = gtk_scrolled_window_get_hscrollbar (scrollwin);
+    GtkStyleContext *context = gtk_widget_get_style_context (hsbar);
+    /* Note: gtk_scrolled_window_get_overlay_scrolling (scrollwin) always returns
+       TRUE so look for style class "overlay-indicator" on the scrollbar. */
+    gboolean overlay = gtk_style_context_has_class (context, "overlay-indicator");
     int count, height;
 
     count = gnc_item_list_num_entries (box->item_list);
     height = count * (gnc_item_list_get_cell_height (box->item_list) + 2);
 
+    if (!overlay)
+    {
+        gint minh, nath;
+        gtk_widget_get_preferred_height (hsbar, &minh, &nath);
+        height = height + minh;
+    }
+
     if (height < space_available)
     {
         gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrollwin),

commit 11ed0b5db1f2c73b1ca6ea98473d493991ec7785
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Sat Dec 11 12:37:50 2021 +0000

    Fix default folder for the Document link dialogue
    
    When the document link is a relative one, we need to convert that to a
    absolute path so the file chooser current folder can be set correctly.

diff --git a/gnucash/gnome/dialog-doclink.c b/gnucash/gnome/dialog-doclink.c
index 8991f05b7..a71c91a67 100644
--- a/gnucash/gnome/dialog-doclink.c
+++ b/gnucash/gnome/dialog-doclink.c
@@ -166,10 +166,12 @@ fcb_clicked_cb (GtkButton *button, GtkWidget *ok_button)
 
     if (uri && *uri)
     {
-        gchar *full_filename = gnc_uri_get_path (uri);
+        gchar *scheme = gnc_uri_get_scheme (uri);
+        gchar *full_filename = gnc_doclink_get_unescape_uri (path_head, uri, scheme);
         gchar *path = g_path_get_dirname (full_filename);
         gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER(native), path);
         g_free (full_filename);
+        g_free (scheme);
         g_free (path);
     }
     else if (path_head)

commit 75be800151111275be4132c0a575ec0fb14e7d9f
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Sat Dec 11 12:35:20 2021 +0000

    Manage Document Link dialog shows escaped characters.
    
    Before updating the file chooser label, unescape the returned file name.

diff --git a/gnucash/gnome/dialog-doclink.c b/gnucash/gnome/dialog-doclink.c
index e2c05883d..8991f05b7 100644
--- a/gnucash/gnome/dialog-doclink.c
+++ b/gnucash/gnome/dialog-doclink.c
@@ -183,13 +183,15 @@ fcb_clicked_cb (GtkButton *button, GtkWidget *ok_button)
         if (uri && *uri)
         {
             gchar *filename = g_path_get_basename (uri);
-            gtk_label_set_text (GTK_LABEL(label), filename);
+            gchar *unescape_filename = g_uri_unescape_string (filename, NULL);
+            gtk_label_set_text (GTK_LABEL(label), unescape_filename);
 
             DEBUG("Native file uri is '%s'", uri);
 
             g_object_set_data_full (G_OBJECT(button), "uri", g_strdup (uri), g_free);
             g_free (uri);
             g_free (filename);
+            g_free (unescape_filename);
         }
         file_ok_cb (button, ok_button);
     }
@@ -382,7 +384,9 @@ gnc_doclink_get_uri_dialog (GtkWindow *parent, const gchar *title,
 
             if (filename)
             {
-                gtk_label_set_text (GTK_LABEL(fcb_label), filename);
+                gchar *unescape_filename = g_uri_unescape_string (filename, NULL);
+                gtk_label_set_text (GTK_LABEL(fcb_label), unescape_filename);
+                g_free (unescape_filename);
                 g_free (filename);
             }
             setup_file_dialog (builder, path_head, uri, scheme);

commit 89e9211c9a3413b06a8fecf863240c3d3a600215
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Sat Dec 11 12:31:36 2021 +0000

    Bug798341 - Right align in Hebrew - Account screen
    
    When Gnucash is run in Hebrew which is a right-to-left language, the
    monetary columns on the accounts page are left aligned but should be
    right aligned. This is down to GTK transposing the column alignment
    when using an RTL language so detect this and align to the left before
    GTK transposes it.

diff --git a/gnucash/gnome-utils/gnc-tree-view.c b/gnucash/gnome-utils/gnc-tree-view.c
index 37faa5d8e..babe8dc67 100644
--- a/gnucash/gnome-utils/gnc-tree-view.c
+++ b/gnucash/gnome-utils/gnc-tree-view.c
@@ -2118,6 +2118,7 @@ gnc_tree_view_add_numeric_column (GncTreeView *view,
 {
     GtkTreeViewColumn *column;
     GtkCellRenderer *renderer;
+    gfloat alignment = 1.0;
 
     column = gnc_tree_view_add_text_column (view, column_title, pref_name,
                                             NULL, sizing_text, model_data_column,
@@ -2126,9 +2127,12 @@ gnc_tree_view_add_numeric_column (GncTreeView *view,
 
     renderer = gnc_tree_view_column_get_renderer (column);
 
-    /* Right align the column title and data */
-    g_object_set (G_OBJECT(column), "alignment",   1.0, NULL);
-    g_object_set (G_OBJECT(renderer), "xalign",   1.0, NULL);
+    /* Right align the column title and data for both ltr and rtl */
+    if (gtk_widget_get_direction (GTK_WIDGET(view)) == GTK_TEXT_DIR_RTL)
+        alignment = 0.0;
+
+    g_object_set (G_OBJECT(column), "alignment", alignment, NULL);
+    g_object_set (G_OBJECT(renderer), "xalign", alignment, NULL);
 
     /* Change the text color */
     if (model_color_column != GNC_TREE_VIEW_COLUMN_COLOR_NONE)

commit c48a887c92bcb80d2e687bd7523a92a01eb4077a
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Sat Dec 11 12:22:01 2021 +0000

    Bug 797502 - (RTL) - Right edge of the reports are locked
    
    Running gnucash in Hebrew, the right edge of the reports are locked
    while scrolling down and do not scroll with the rest of the report.
    
    Adding a left and right margin of 8px fixes this and I think looks
    better as text is not immediately against window edge.
    
    Keeping top and bottom margin at 0px prevents the scrollbar from
    appearing in charts.

diff --git a/gnucash/report/html-fonts.scm b/gnucash/report/html-fonts.scm
index 08d208114..fb600e23d 100644
--- a/gnucash/report/html-fonts.scm
+++ b/gnucash/report/html-fonts.scm
@@ -177,7 +177,7 @@
       "body, p, table, tr, td { vertical-align: top; " text-cell-info " }\n"
       "tr.alternate-row { background: " alternate-row-color " }\n"
       "tr { page-break-inside: avoid !important;}\n"
-      "html, body { height: 100vh; margin: 0; }\n"
+      "html, body { height: 100vh; margin-top: 0px; margin-bottom: 0px; margin-left: 8px; margin-right: 8px; }\n"
       "td, th { border-color: grey }\n"
       "th.column-heading-left { text-align: left; " number-header-info " }\n"
       "th.column-heading-center { text-align: center; " number-header-info " }\n"
diff --git a/gnucash/report/stylesheets/css.scm b/gnucash/report/stylesheets/css.scm
index edbb87b7a..ae47ddea8 100644
--- a/gnucash/report/stylesheets/css.scm
+++ b/gnucash/report/stylesheets/css.scm
@@ -38,7 +38,10 @@
 
 html, body {
     height: 100vh;
-    margin: 0;
+    margin-top: 0px;
+    margin-bottom: 0px;
+    margin-left: 8px;
+    margin-right: 8px;
     font-family: \"Noto Sans\", Sans-Serif;
     font-size: 10pt;
 }



Summary of changes:
 gnucash/gnome-utils/gnc-tree-view.c               | 10 +++++++---
 gnucash/gnome/dialog-doclink.c                    | 12 +++++++++---
 gnucash/register/register-gnome/combocell-gnome.c | 12 ++++++++++++
 gnucash/report/html-fonts.scm                     |  2 +-
 gnucash/report/stylesheets/css.scm                |  5 ++++-
 5 files changed, 33 insertions(+), 8 deletions(-)



More information about the gnucash-changes mailing list