gnucash maint: Multiple changes pushed

Geert Janssens gjanssens at code.gnucash.org
Sat Jun 23 12:11:50 EDT 2018


Updated	 via  https://github.com/Gnucash/gnucash/commit/b74cc7c4 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/7a33c6c0 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/e1288360 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/3f9bb7a1 (commit)
	from  https://github.com/Gnucash/gnucash/commit/a438a595 (commit)



commit b74cc7c4e6b51685a5ac5092f194ead22f195760
Merge: a438a59 7a33c6c
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sat Jun 23 17:39:29 2018 +0200

    Merge branch 'bug795471' of https://github.com/Bob-IT/gnucash into maint


commit 7a33c6c0ba3742ba77d6838626dad8f7b69b6a23
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Thu Jun 21 12:07:19 2018 +0100

    Added some padding to the numbers in Budget view
    
    Added some padding to the numbers so they are separated from the next
    more clearly.

diff --git a/gnucash/gnome/gnc-budget-view.c b/gnucash/gnome/gnc-budget-view.c
index 964a522..4059775 100644
--- a/gnucash/gnome/gnc-budget-view.c
+++ b/gnucash/gnome/gnc-budget-view.c
@@ -1125,6 +1125,16 @@ gbv_refresh_col_titles(GncBudgetView *view)
     }
 }
 
+static void
+gbv_renderer_add_padding (GtkCellRenderer *renderer)
+{
+    gint xpad, ypad;
+
+    gtk_cell_renderer_get_padding (renderer, &xpad, &ypad);
+    if (xpad < 5)
+        gtk_cell_renderer_set_padding (renderer, 5, ypad);
+}
+
 /** \brief Function to create the totals column to the right of the view.
 */
 static GtkTreeViewColumn*
@@ -1140,6 +1150,9 @@ gbv_create_totals_column(GncBudgetView* view, gint period_num)
     renderer = gtk_cell_renderer_text_new();
     col = gtk_tree_view_column_new_with_attributes("", renderer, NULL);
 
+    // add some padding to the right of the numbers
+    gbv_renderer_add_padding (renderer);
+
     gtk_tree_view_column_set_cell_data_func(col, renderer, totals_col_source, view, NULL);
     g_object_set_data(G_OBJECT(col), "budget", priv->budget);
     g_object_set_data(G_OBJECT(col), "period_num", GUINT_TO_POINTER(period_num));
@@ -1233,6 +1246,9 @@ gnc_budget_view_refresh(GncBudgetView *view)
         // as we only have one renderer/column, use this function to get it
         renderer = gnc_tree_view_column_get_renderer (col);
 
+        // add some padding to the right of the numbers
+        gbv_renderer_add_padding (renderer);
+
         g_signal_connect(G_OBJECT(renderer), "edited", (GCallback)gbv_col_edited_cb, view);
 
         col = gbv_create_totals_column(view, num_periods_visible);
@@ -1252,6 +1268,7 @@ gnc_budget_view_refresh(GncBudgetView *view)
         gchar title[MAX_DATE_LENGTH];
         guint titlelen;
         GDate *date;
+        GtkCellRenderer* renderer;
 
         priv->total_col = gnc_tree_view_account_add_custom_column(
                               GNC_TREE_VIEW_ACCOUNT(priv->tree_view), _("Total"),
@@ -1276,6 +1293,12 @@ gnc_budget_view_refresh(GncBudgetView *view)
         g_date_free (date);
         g_object_set_data(G_OBJECT(priv->total_col), "budget", priv->budget);
 
+        // as we only have one renderer/column, use this function to get it
+        renderer = gnc_tree_view_column_get_renderer (priv->total_col);
+
+        // add some padding to the right of the numbers
+        gbv_renderer_add_padding (renderer);
+
         col = gbv_create_totals_column(view, -1);
         if (col != NULL)
         {

commit e1288360137e59f37b64841aeed1d54e0844f57b
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Thu Jun 21 11:43:35 2018 +0100

    Simplify getting the cell renderer in budget view

diff --git a/gnucash/gnome/gnc-budget-view.c b/gnucash/gnome/gnc-budget-view.c
index 7fe15fe..964a522 100644
--- a/gnucash/gnome/gnc-budget-view.c
+++ b/gnucash/gnome/gnc-budget-view.c
@@ -1219,8 +1219,7 @@ gnc_budget_view_refresh(GncBudgetView *view)
     /* Create any needed columns */
     while (num_periods_visible < num_periods)
     {
-        GList* renderer_list;
-        GList* renderer_node;
+        GtkCellRenderer* renderer;
 
         col = gnc_tree_view_account_add_custom_column(
                   GNC_TREE_VIEW_ACCOUNT(priv->tree_view), "",
@@ -1231,13 +1230,10 @@ gnc_budget_view_refresh(GncBudgetView *view)
                           GUINT_TO_POINTER(num_periods_visible));
         col_list = g_list_append(col_list, col);
 
-        renderer_list = gtk_cell_layout_get_cells(GTK_CELL_LAYOUT(col));
-        for (renderer_node = renderer_list; renderer_node != NULL; renderer_node = g_list_next(renderer_node))
-        {
-            GtkCellRenderer* renderer = GTK_CELL_RENDERER(renderer_node->data);
-            g_signal_connect(G_OBJECT(renderer), "edited", (GCallback)gbv_col_edited_cb, view);
-        }
-        g_list_free(renderer_list);
+        // as we only have one renderer/column, use this function to get it
+        renderer = gnc_tree_view_column_get_renderer (col);
+
+        g_signal_connect(G_OBJECT(renderer), "edited", (GCallback)gbv_col_edited_cb, view);
 
         col = gbv_create_totals_column(view, num_periods_visible);
         if (col != NULL)

commit 3f9bb7a109133e6a41f0a2db4e3bdd6346da70ba
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Thu Jun 21 11:40:52 2018 +0100

    Bug 795471 - Make sure account column has expand option
    
    By default the account column is the expand column but if it is manually
     changed this is reset to the last column. If Gnucash is maximised in
    this state, the totals column then has a lot of white space so this
    change reapplies the expand setting to the account column so it has the
    extra space.

diff --git a/gnucash/gnome/gnc-budget-view.c b/gnucash/gnome/gnc-budget-view.c
index fd64636..7fe15fe 100644
--- a/gnucash/gnome/gnc-budget-view.c
+++ b/gnucash/gnome/gnc-budget-view.c
@@ -389,6 +389,9 @@ gbv_create_widget(GncBudgetView *view)
     selection = gtk_tree_view_get_selection(tree_view);
     gtk_tree_selection_set_mode(selection, GTK_SELECTION_MULTIPLE);
 
+    // make sure the account column is the expand column
+    gnc_tree_view_expand_columns (GNC_TREE_VIEW(tree_view), "name", NULL);
+
     // Accounts filter
     priv->fd->tree_view = GNC_TREE_VIEW_ACCOUNT(priv->tree_view);
     gnc_tree_view_account_set_filter(
@@ -696,6 +699,8 @@ gbv_treeview_resized_cb(GtkWidget* widget, GtkAllocation* allocation, GncBudgetV
             j++;
         }
     }
+    // make sure the account column is the expand column
+    gnc_tree_view_expand_columns (GNC_TREE_VIEW(priv->tree_view), "name", NULL);
     LEAVE("");
 }
 



Summary of changes:
 gnucash/gnome/gnc-budget-view.c | 42 ++++++++++++++++++++++++++++++++---------
 1 file changed, 33 insertions(+), 9 deletions(-)



More information about the gnucash-changes mailing list