gnucash master: Multiple changes pushed

Robert Fewell bobit at code.gnucash.org
Mon Feb 17 09:16:57 EST 2020


Updated	 via  https://github.com/Gnucash/gnucash/commit/6149352e (commit)
	 via  https://github.com/Gnucash/gnucash/commit/2b2fa847 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/e7cfcb3f (commit)
	 via  https://github.com/Gnucash/gnucash/commit/bc14e050 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/1d1d7369 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/ff514e3b (commit)
	 via  https://github.com/Gnucash/gnucash/commit/ad4c150d (commit)
	 via  https://github.com/Gnucash/gnucash/commit/f2cc1a1c (commit)
	from  https://github.com/Gnucash/gnucash/commit/5475f39f (commit)



commit 6149352e6b78b81a25655a0066892e6028ea6e8b
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Mon Feb 17 14:14:43 2020 +0000

    Bug 797489 - No option to use account codes in Budget View - Part2
    
    Add option to allow the account code column to be shown in the budget
    tree view and as such the account tree view can be sorted by this column

diff --git a/gnucash/gnome/gnc-budget-view.c b/gnucash/gnome/gnc-budget-view.c
index 4dbe5b907..5d120e458 100644
--- a/gnucash/gnome/gnc-budget-view.c
+++ b/gnucash/gnome/gnc-budget-view.c
@@ -168,6 +168,8 @@ struct GncBudgetViewPrivate
     GtkTreeViewColumn   *total_col;
     AccountFilterDialog *fd;
     Account             *rootAcct;
+    gboolean             show_account_code;
+    gboolean             show_account_desc;
 
     GtkCellRenderer *temp_cr;
     GtkCellEditable *temp_ce;
@@ -198,6 +200,8 @@ gnc_budget_view_new (GncBudget *budget, AccountFilterDialog *fd)
     priv->key = *gnc_budget_get_guid (budget);
     priv->fd = fd;
     priv->total_col = NULL;
+    priv->show_account_code = FALSE;
+    priv->show_account_desc = FALSE;
     gbv_create_widget (budget_view);
 
     LEAVE("new budget view %p", budget_view);
@@ -241,6 +245,36 @@ gbv_treeview_update_grid_lines (gpointer prefs, gchar *pref, gpointer user_data)
     gtk_tree_view_set_grid_lines (GTK_TREE_VIEW(view), gnc_tree_view_get_grid_lines_pref ());
 }
 
+void
+gnc_budget_view_set_show_account_code (GncBudgetView *budget_view, gboolean show_account_code)
+{
+    GncBudgetViewPrivate *priv = GNC_BUDGET_VIEW_GET_PRIVATE(budget_view);
+    priv->show_account_code = show_account_code;
+    gnc_budget_view_refresh (budget_view);
+}
+
+gboolean
+gnc_budget_view_get_show_account_code (GncBudgetView *budget_view)
+{
+    GncBudgetViewPrivate *priv = GNC_BUDGET_VIEW_GET_PRIVATE(budget_view);
+    return priv->show_account_code;
+}
+
+void
+gnc_budget_view_set_show_account_description (GncBudgetView *budget_view, gboolean show_account_desc)
+{
+    GncBudgetViewPrivate *priv = GNC_BUDGET_VIEW_GET_PRIVATE(budget_view);
+    priv->show_account_desc = show_account_desc;
+    gnc_budget_view_refresh (budget_view);
+}
+
+gboolean
+gnc_budget_view_get_show_account_description (GncBudgetView *budget_view)
+{
+    GncBudgetViewPrivate *priv = GNC_BUDGET_VIEW_GET_PRIVATE(budget_view);
+    return priv->show_account_desc;
+}
+
 static void
 gbv_update_use_red (gpointer prefs, gchar *pref, gpointer user_data)
 {
@@ -376,10 +410,9 @@ gbv_create_widget (GncBudgetView *budget_view)
     GtkBox               *vbox;
     GtkListStore         *totals_tree_model;
     GtkTreeView          *totals_tree_view;
-    GtkTreeViewColumn    *totals_title_col;
+    GtkTreeViewColumn    *totals_title_col, *name_col, *code_col, *desc_col;
     GtkTreeIter           iter;
     GtkWidget            *h_separator;
-    GKeyFile             *state_file = gnc_state_get_current ();
     gchar                *state_section;
     gchar                 guidstr[GUID_ENCODING_LENGTH+1];
 
@@ -401,17 +434,6 @@ gbv_create_widget (GncBudgetView *budget_view)
     guid_to_string_buff (&priv->key, guidstr);
     state_section = g_strjoin (" ", STATE_SECTION_PREFIX, guidstr, NULL);
     g_object_set (G_OBJECT(tree_view), "state-section", state_section, NULL);
-
-    // make sure any extra account columns are hidden, there will be an option to
-    // show code and description in 4.0 which will disrupt the display of the table
-    if (gnc_features_check_used (gnc_get_current_book (), GNC_FEATURE_BUDGET_SHOW_EXTRA_ACCOUNT_COLS))
-    {
-        if (g_key_file_has_group (state_file, state_section))
-        {
-            g_key_file_set_boolean (state_file, state_section, "account-code_visible", FALSE);
-            g_key_file_set_boolean (state_file, state_section, "description_visible", FALSE);
-        }
-    }
     g_free (state_section);
 
     gnc_tree_view_configure_columns (GNC_TREE_VIEW(tree_view));
@@ -421,6 +443,8 @@ gbv_create_widget (GncBudgetView *budget_view)
 
     // make sure the account column is the expand column
     gnc_tree_view_expand_columns (GNC_TREE_VIEW(tree_view), "name", NULL);
+    name_col = gnc_tree_view_find_column_by_name (GNC_TREE_VIEW(priv->tree_view), "name");
+    gtk_tree_view_column_set_reorderable (name_col, FALSE);
 
     // Accounts filter
     priv->fd->tree_view = GNC_TREE_VIEW_ACCOUNT(priv->tree_view);
@@ -428,6 +452,16 @@ gbv_create_widget (GncBudgetView *budget_view)
                                       gnc_plugin_page_account_tree_filter_accounts,
                                       priv->fd, NULL);
 
+    // get the visibility of the account code column
+    code_col = gnc_tree_view_find_column_by_name (GNC_TREE_VIEW(priv->tree_view), "account-code");
+    priv->show_account_code = gtk_tree_view_column_get_visible (code_col);
+    gtk_tree_view_column_set_reorderable (code_col, FALSE);
+
+    // get the visibility of the account description column
+    desc_col = gnc_tree_view_find_column_by_name (GNC_TREE_VIEW(priv->tree_view), "description");
+    priv->show_account_desc = gtk_tree_view_column_get_visible (desc_col);
+    gtk_tree_view_column_set_reorderable (desc_col, FALSE);
+
     // Add accounts tree view to scroll window
     gtk_container_add (GTK_CONTAINER(scrolled_window), GTK_WIDGET(tree_view));
 
@@ -460,15 +494,19 @@ gbv_create_widget (GncBudgetView *budget_view)
                       G_CALLBACK(gbv_totals_scrollbar_value_changed_cb), budget_view);
 
     // Create totals tree view
-    totals_tree_model = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_INT);
+    totals_tree_model = gtk_list_store_new (4, G_TYPE_STRING, G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING);
     gtk_list_store_append (totals_tree_model, &iter);
-    gtk_list_store_set (totals_tree_model, &iter, 0, _("Inflow from Income"), 1, TOTALS_TYPE_INCOME, -1);
+    gtk_list_store_set (totals_tree_model, &iter, 0, _("Inflow from Income"),
+                                                  1, TOTALS_TYPE_INCOME, 2, " ", 3, " ", -1);
     gtk_list_store_append (totals_tree_model, &iter);
-    gtk_list_store_set (totals_tree_model, &iter, 0, _("Outflow to Expenses"), 1, TOTALS_TYPE_EXPENSES, -1);
+    gtk_list_store_set (totals_tree_model, &iter, 0, _("Outflow to Expenses"),
+                                                  1, TOTALS_TYPE_EXPENSES, 2, " ", 3, " ", -1);
     gtk_list_store_append (totals_tree_model, &iter);
-    gtk_list_store_set (totals_tree_model, &iter, 0, _("Outflow to Asset/Equity/Liability"), 1, TOTALS_TYPE_ASSET_LIAB_EQ, -1);
+    gtk_list_store_set (totals_tree_model, &iter, 0, _("Outflow to Asset/Equity/Liability"),
+                                                  1, TOTALS_TYPE_ASSET_LIAB_EQ, 2, " ", 3, " ", -1);
     gtk_list_store_append (totals_tree_model, &iter);
-    gtk_list_store_set (totals_tree_model, &iter, 0, _("Remaining to Budget"), 1, TOTALS_TYPE_REMAINDER, -1);
+    gtk_list_store_set (totals_tree_model, &iter, 0, _("Remaining to Budget"),
+                                                  1, TOTALS_TYPE_REMAINDER, 2, " ", 3, " ", -1);
 
     totals_tree_view = GTK_TREE_VIEW(gtk_tree_view_new ());
     priv->totals_tree_view = totals_tree_view;
@@ -476,11 +514,24 @@ gbv_create_widget (GncBudgetView *budget_view)
     gtk_tree_view_set_headers_visible (totals_tree_view, FALSE);
     gtk_tree_view_set_model (totals_tree_view, GTK_TREE_MODEL(totals_tree_model));
 
+    // add the totals title column
     totals_title_col = gtk_tree_view_column_new_with_attributes ("", gtk_cell_renderer_text_new (), "text", 0, NULL);
     gtk_tree_view_column_set_expand (totals_title_col, TRUE);
     gtk_tree_view_column_set_sizing (totals_title_col, GTK_TREE_VIEW_COLUMN_FIXED);
     gtk_tree_view_append_column (totals_tree_view, totals_title_col);
 
+    // add the totals account code column
+    code_col = gtk_tree_view_column_new_with_attributes ("", gtk_cell_renderer_text_new(), "text", 2, NULL);
+    gtk_tree_view_column_set_sizing (code_col, GTK_TREE_VIEW_COLUMN_FIXED);
+    gtk_tree_view_append_column (totals_tree_view, code_col);
+    gtk_tree_view_column_set_visible (code_col, priv->show_account_code);
+
+    // add the totals account description column
+    desc_col = gtk_tree_view_column_new_with_attributes ("", gtk_cell_renderer_text_new(), "text", 3, NULL);
+    gtk_tree_view_column_set_sizing (desc_col, GTK_TREE_VIEW_COLUMN_FIXED);
+    gtk_tree_view_append_column (totals_tree_view, desc_col);
+    gtk_tree_view_column_set_visible (desc_col, priv->show_account_desc);
+
     // Add totals tree view to scroll window
     gtk_container_add (GTK_CONTAINER(priv->totals_scroll_window), GTK_WIDGET(totals_tree_view));
 
@@ -822,11 +873,22 @@ gbv_treeview_resized_cb (GtkWidget *widget, GtkAllocation *allocation,
     for (i = 0, j = 0; i < ncols; ++i)
     {
         gint col_width;
+        const gchar *name;
         GtkTreeViewColumn *tree_view_col;
         GtkTreeViewColumn *totals_view_col;
 
         tree_view_col = gtk_tree_view_get_column (priv->tree_view, i);
 
+        name = g_object_get_data (G_OBJECT(tree_view_col), PREF_NAME);
+
+        // if we do not show account code, step over the equivalent totals column
+        if ((g_strcmp0 (name, "account-code") == 0) && (!priv->show_account_code))
+           j++;
+
+        // if we do not show account description, step over the equivalent totals column
+        if ((g_strcmp0 (name, "description") == 0) && (!priv->show_account_desc))
+           j++;
+
         if (gtk_tree_view_column_get_visible (tree_view_col))
         {
             col_width = gtk_tree_view_column_get_width (tree_view_col);
@@ -1481,7 +1543,7 @@ gnc_budget_view_refresh (GncBudgetView *budget_view)
     GncBudgetViewPrivate *priv;
     gint num_periods;
     gint num_periods_visible;
-    GtkTreeViewColumn *col;
+    GtkTreeViewColumn *col, *code_col, *desc_col;
     GList *col_list;
     GList *totals_col_list;
     GdkRGBA *note_color, *note_color_selected;
@@ -1517,6 +1579,18 @@ gnc_budget_view_refresh (GncBudgetView *budget_view)
 
     gnc_tree_view_configure_columns (GNC_TREE_VIEW(priv->tree_view));
 
+    // set visibility of the account code columns
+    code_col = gnc_tree_view_find_column_by_name (GNC_TREE_VIEW(priv->tree_view), "account-code");
+    gtk_tree_view_column_set_visible (code_col, priv->show_account_code);
+    code_col = gtk_tree_view_get_column (GTK_TREE_VIEW(priv->totals_tree_view), 1);
+    gtk_tree_view_column_set_visible (code_col, priv->show_account_code);
+
+    // set visibility of the account description columns
+    desc_col = gnc_tree_view_find_column_by_name (GNC_TREE_VIEW(priv->tree_view), "description");
+    gtk_tree_view_column_set_visible (desc_col, priv->show_account_desc);
+    desc_col = gtk_tree_view_get_column (GTK_TREE_VIEW(priv->totals_tree_view), 2);
+    gtk_tree_view_column_set_visible (desc_col, priv->show_account_desc);
+
     /* If we're creating new columns to be appended to already existing
      * columns, first delete the total column. (Then regenerate after
      * new columns have been appended */
diff --git a/gnucash/gnome/gnc-budget-view.h b/gnucash/gnome/gnc-budget-view.h
index d61699724..e19abd0d7 100644
--- a/gnucash/gnome/gnc-budget-view.h
+++ b/gnucash/gnome/gnc-budget-view.h
@@ -70,6 +70,10 @@ GtkTreeSelection* gnc_budget_view_get_selection (GncBudgetView *budget_view);
 Account* gnc_budget_view_get_account_from_path (GncBudgetView *budget_view, GtkTreePath *path);
 GList* gnc_budget_view_get_selected_accounts (GncBudgetView *budget_view);
 GtkWidget *gnc_budget_view_get_account_tree_view (GncBudgetView *budget_view);
+void gnc_budget_view_set_show_account_code (GncBudgetView *budget_view, gboolean show_account_code);
+gboolean gnc_budget_view_get_show_account_code (GncBudgetView *budget_view);
+void gnc_budget_view_set_show_account_description (GncBudgetView *budget_view, gboolean show_account_desc);
+gboolean gnc_budget_view_get_show_account_description (GncBudgetView *budget_view);
 
 G_END_DECLS
 
diff --git a/gnucash/gnome/gnc-plugin-page-budget.c b/gnucash/gnome/gnc-plugin-page-budget.c
index 76af4ed07..814a83a33 100644
--- a/gnucash/gnome/gnc-plugin-page-budget.c
+++ b/gnucash/gnome/gnc-plugin-page-budget.c
@@ -44,6 +44,7 @@
 
 #include "gnc-plugin-page-register.h"
 #include "gnc-budget.h"
+#include "gnc-features.h"
 
 #include "dialog-options.h"
 #include "dialog-utils.h"
@@ -804,6 +805,8 @@ gnc_plugin_page_budget_cmd_view_options (GtkAction *action,
 
     GtkTextBuffer *buffer;
     GtkTextIter start, end;
+    GtkWidget *show_account_code, *show_account_desc;
+    gboolean show_ac, show_ad;
 
     g_return_if_fail (GNC_IS_PLUGIN_PAGE_BUDGET(page));
     priv = GNC_PLUGIN_PAGE_BUDGET_GET_PRIVATE(page);
@@ -835,6 +838,15 @@ gnc_plugin_page_budget_cmd_view_options (GtkAction *action,
         gbnumperiods = GTK_WIDGET(gtk_builder_get_object (builder, "BudgetNumPeriods"));
         gtk_spin_button_set_value (GTK_SPIN_BUTTON(gbnumperiods), gnc_budget_get_num_periods (priv->budget));
 
+        show_account_code = GTK_WIDGET(gtk_builder_get_object (builder, "ShowAccountCode"));
+        show_account_desc = GTK_WIDGET(gtk_builder_get_object (builder, "ShowAccountDescription"));
+
+        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(show_account_code),
+                                      gnc_budget_view_get_show_account_code (priv->budget_view));
+
+        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(show_account_desc),
+                                      gnc_budget_view_get_show_account_description (priv->budget_view));
+
         gtk_widget_show_all (priv->dialog);
         result = gtk_dialog_run (GTK_DIALOG(priv->dialog));
 
@@ -858,6 +870,19 @@ gnc_plugin_page_budget_cmd_view_options (GtkAction *action,
             gnc_budget_set_description (priv->budget, desc);
             g_free (desc);
 
+            show_ac = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(show_account_code));
+            gnc_budget_view_set_show_account_code (priv->budget_view, show_ac);
+
+            show_ad = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(show_account_desc));
+            gnc_budget_view_set_show_account_description (priv->budget_view, show_ad);
+
+            // if show account code or description is set then set feature
+            if ((show_ac || show_ad) && (!gnc_features_check_used (gnc_get_current_book (),
+                                           GNC_FEATURE_BUDGET_SHOW_EXTRA_ACCOUNT_COLS)))
+            {
+                gnc_features_set_used (gnc_get_current_book (), GNC_FEATURE_BUDGET_SHOW_EXTRA_ACCOUNT_COLS);
+            }
+
             num_periods = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON(gbnumperiods));
             gnc_budget_set_num_periods (priv->budget, num_periods);
 
diff --git a/gnucash/gtkbuilder/gnc-plugin-page-budget.glade b/gnucash/gtkbuilder/gnc-plugin-page-budget.glade
index c766ef075..3ff3acb60 100644
--- a/gnucash/gtkbuilder/gnc-plugin-page-budget.glade
+++ b/gnucash/gtkbuilder/gnc-plugin-page-budget.glade
@@ -558,7 +558,7 @@
                   </object>
                   <packing>
                     <property name="left_attach">0</property>
-                    <property name="top_attach">4</property>
+                    <property name="top_attach">6</property>
                   </packing>
                 </child>
                 <child>
@@ -574,7 +574,7 @@
                   </object>
                   <packing>
                     <property name="left_attach">1</property>
-                    <property name="top_attach">4</property>
+                    <property name="top_attach">6</property>
                   </packing>
                 </child>
                 <child>
@@ -589,7 +589,7 @@
                   </object>
                   <packing>
                     <property name="left_attach">0</property>
-                    <property name="top_attach">3</property>
+                    <property name="top_attach">5</property>
                   </packing>
                 </child>
                 <child>
@@ -600,7 +600,7 @@
                   </object>
                   <packing>
                     <property name="left_attach">0</property>
-                    <property name="top_attach">2</property>
+                    <property name="top_attach">4</property>
                     <property name="width">2</property>
                   </packing>
                 </child>
@@ -627,6 +627,54 @@
                       </object>
                     </child>
                   </object>
+                  <packing>
+                    <property name="left_attach">1</property>
+                    <property name="top_attach">5</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkLabel">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="halign">end</property>
+                    <property name="label" translatable="yes">Show Account Code</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">2</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkCheckButton" id="ShowAccountCode">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="draw_indicator">True</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">1</property>
+                    <property name="top_attach">2</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkLabel">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="halign">end</property>
+                    <property name="label" translatable="yes">Show Description</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">3</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkCheckButton" id="ShowAccountDescription">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="draw_indicator">True</property>
+                  </object>
                   <packing>
                     <property name="left_attach">1</property>
                     <property name="top_attach">3</property>

commit 2b2fa8476e45cc16e569069c773bcaad9d112504
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Mon Feb 17 13:36:11 2020 +0000

    Change the negative numbers CSS class name to new format
    
    Change from negative-numbers to gnc-class-negative-numbers

diff --git a/gnucash/gnome-utils/dialog-utils.c b/gnucash/gnome-utils/dialog-utils.c
index 9d9ef32cf..49f699ba7 100644
--- a/gnucash/gnome-utils/dialog-utils.c
+++ b/gnucash/gnome-utils/dialog-utils.c
@@ -70,13 +70,13 @@ gnc_set_label_color(GtkWidget *label, gnc_numeric value)
 
     if (deficit)
     {
-        gnc_widget_style_context_remove_class (GTK_WIDGET(label), "default-color");
-        gnc_widget_style_context_add_class (GTK_WIDGET(label), "negative-numbers");
+        gnc_widget_style_context_remove_class (GTK_WIDGET(label), "gnc-class-default-color");
+        gnc_widget_style_context_add_class (GTK_WIDGET(label), "gnc-class-negative-numbers");
     }
     else
     {
-        gnc_widget_style_context_remove_class (GTK_WIDGET(label), "negative-numbers");
-        gnc_widget_style_context_add_class (GTK_WIDGET(label), "default-color");
+        gnc_widget_style_context_remove_class (GTK_WIDGET(label), "gnc-class-negative-numbers");
+        gnc_widget_style_context_add_class (GTK_WIDGET(label), "gnc-class-default-color");
     }
 }
 
@@ -889,7 +889,7 @@ gnc_cost_policy_select_new (void)
     return cost_policy_widget;
 }
 
-/* This function returns a string for the CSS 'negative-numbers' class,
+/* This function returns a string for the CSS 'gnc-class-negative-numbers' class,
  * the returned string must be freed
  */
 gchar*
@@ -898,7 +898,7 @@ gnc_get_negative_color (void)
     GdkRGBA color;
     GtkWidget *label = gtk_label_new ("Color");
     GtkStyleContext *context = gtk_widget_get_style_context (GTK_WIDGET(label));
-    gtk_style_context_add_class (context, "negative-numbers");
+    gtk_style_context_add_class (context, "gnc-class-negative-numbers");
     gtk_style_context_get_color (context, GTK_STATE_FLAG_NORMAL, &color);
 
     return gdk_rgba_to_string (&color);
diff --git a/gnucash/gnome-utils/dialog-utils.h b/gnucash/gnome-utils/dialog-utils.h
index 1c9c56ef0..f62c92d34 100644
--- a/gnucash/gnome-utils/dialog-utils.h
+++ b/gnucash/gnome-utils/dialog-utils.h
@@ -161,7 +161,7 @@ gboolean gnc_new_book_option_display (GtkWidget *parent);
 GtkWidget *
 gnc_cost_policy_select_new (void);
 
-/** This function returns the color string for the CSS 'negative-numbers' class,
+/** This function returns the color string for the CSS 'gnc-class-negative-numbers' class,
  *  the returned value must be freed.
  */
 gchar* gnc_get_negative_color (void);
diff --git a/gnucash/gnome-utils/window-main-summarybar.c b/gnucash/gnome-utils/window-main-summarybar.c
index 14b992835..ca1369ee6 100644
--- a/gnucash/gnome-utils/window-main-summarybar.c
+++ b/gnucash/gnome-utils/window-main-summarybar.c
@@ -450,7 +450,7 @@ get_negative_color_str (void)
     gchar *color_str;
     GtkWidget *label = gtk_label_new ("Color");
     GtkStyleContext *context = gtk_widget_get_style_context (GTK_WIDGET(label));
-    gtk_style_context_add_class (context, "negative-numbers");
+    gtk_style_context_add_class (context, "gnc-class-negative-numbers");
     gtk_style_context_get_color (context, GTK_STATE_FLAG_NORMAL, &color);
     rgba = gdk_rgba_copy (&color);
 
diff --git a/gnucash/gnucash-310.css b/gnucash/gnucash-310.css
index 692919bdc..30c9bdb2a 100644
--- a/gnucash/gnucash-310.css
+++ b/gnucash/gnucash-310.css
@@ -4,11 +4,11 @@
 
 
 /* Negative value label colors */
-.default-color {
+.gnc-class-default-color {
   color: @default-color;
 }
 
-.negative-numbers {
+.gnc-class-negative-numbers {
   color: @negative-numbers;
 }
 
diff --git a/gnucash/gnucash-320.css b/gnucash/gnucash-320.css
index 561de812d..9439430c6 100644
--- a/gnucash/gnucash-320.css
+++ b/gnucash/gnucash-320.css
@@ -4,11 +4,11 @@
 
 
 /* Negative value label colors */
-.default-color {
+.gnc-class-default-color {
   color: @default-color;
 }
 
-.negative-numbers {
+.gnc-class-negative-numbers {
   color: @negative-numbers;
 }
 
diff --git a/gnucash/register/register-gnome/gnucash-sheet.c b/gnucash/register/register-gnome/gnucash-sheet.c
index 36bd9c652..55c373797 100644
--- a/gnucash/register/register-gnome/gnucash-sheet.c
+++ b/gnucash/register/register-gnome/gnucash-sheet.c
@@ -2525,7 +2525,7 @@ gnucash_get_style_classes (GnucashSheet *sheet, GtkStyleContext *stylectxt,
 
     if (field_type >= COLOR_NEGATIVE) // Require a Negative fg color
     {
-        gtk_style_context_add_class (stylectxt, "negative-numbers");
+        gtk_style_context_add_class (stylectxt, "gnc-class-negative-numbers");
         field_type -= COLOR_NEGATIVE;
     }
     else

commit e7cfcb3f7084fa51d88684afaba2de282033c2a2
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Mon Feb 17 13:28:27 2020 +0000

    Rename dialog-utils get_negative_color
    
    Rename dialog-utils 'get_negative_color' to 'gnc_get_negative_color' as
    it is used in more than one source file.

diff --git a/gnucash/gnome-utils/dialog-utils.c b/gnucash/gnome-utils/dialog-utils.c
index 5b15e0690..9d9ef32cf 100644
--- a/gnucash/gnome-utils/dialog-utils.c
+++ b/gnucash/gnome-utils/dialog-utils.c
@@ -889,8 +889,11 @@ gnc_cost_policy_select_new (void)
     return cost_policy_widget;
 }
 
+/* This function returns a string for the CSS 'negative-numbers' class,
+ * the returned string must be freed
+ */
 gchar*
-get_negative_color (void)
+gnc_get_negative_color (void)
 {
     GdkRGBA color;
     GtkWidget *label = gtk_label_new ("Color");
diff --git a/gnucash/gnome-utils/dialog-utils.h b/gnucash/gnome-utils/dialog-utils.h
index 93857ef71..1c9c56ef0 100644
--- a/gnucash/gnome-utils/dialog-utils.h
+++ b/gnucash/gnome-utils/dialog-utils.h
@@ -161,6 +161,9 @@ gboolean gnc_new_book_option_display (GtkWidget *parent);
 GtkWidget *
 gnc_cost_policy_select_new (void);
 
-gchar* get_negative_color (void);
+/** This function returns the color string for the CSS 'negative-numbers' class,
+ *  the returned value must be freed.
+ */
+gchar* gnc_get_negative_color (void);
 
 #endif /* DIALOG_UTILS_H */
diff --git a/gnucash/gnome-utils/gnc-tree-model-account.c b/gnucash/gnome-utils/gnc-tree-model-account.c
index 9f44690e2..83dd35075 100644
--- a/gnucash/gnome-utils/gnc-tree-model-account.c
+++ b/gnucash/gnome-utils/gnc-tree-model-account.c
@@ -140,7 +140,7 @@ gnc_tree_model_account_update_color (gpointer gsettings, gchar *key, gpointer us
         g_free (priv->negative_color);
 
     if (use_red)
-        priv->negative_color = get_negative_color ();
+        priv->negative_color = gnc_get_negative_color ();
     else
         priv->negative_color = NULL;
 }
@@ -175,7 +175,7 @@ static void
 gnc_tree_model_account_init (GncTreeModelAccount *model)
 {
     GncTreeModelAccountPrivate *priv;
-    gboolean red;
+    gboolean use_red;
 
     ENTER("model %p", model);
     while (model->stamp == 0)
@@ -183,7 +183,7 @@ gnc_tree_model_account_init (GncTreeModelAccount *model)
         model->stamp = g_random_int ();
     }
 
-    red = gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL, GNC_PREF_NEGATIVE_IN_RED);
+    use_red = gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL, GNC_PREF_NEGATIVE_IN_RED);
 
     priv = GNC_TREE_MODEL_ACCOUNT_GET_PRIVATE(model);
     priv->book = NULL;
@@ -192,8 +192,8 @@ gnc_tree_model_account_init (GncTreeModelAccount *model)
     if (priv->negative_color)
         g_free (priv->negative_color);
 
-    if (red)
-        priv->negative_color = get_negative_color ();
+    if (use_red)
+        priv->negative_color = gnc_get_negative_color ();
     else
         priv->negative_color = NULL;
 
diff --git a/gnucash/gnome/gnc-budget-view.c b/gnucash/gnome/gnc-budget-view.c
index 992bb8f91..4dbe5b907 100644
--- a/gnucash/gnome/gnc-budget-view.c
+++ b/gnucash/gnome/gnc-budget-view.c
@@ -1066,7 +1066,7 @@ budget_col_source (Account *account, GtkTreeViewColumn *col,
 
             if (priv->use_red_color && gnc_numeric_negative_p (numeric))
             {
-                gchar *color = get_negative_color ();
+                gchar *color = gnc_get_negative_color ();
                 g_object_set (cell, "foreground", color, NULL);
                 g_free (color);
             }
@@ -1162,7 +1162,7 @@ budget_total_col_source (Account *account, GtkTreeViewColumn *col,
 
     if (priv->use_red_color && gnc_numeric_negative_p (total))
     {
-        gchar *color = get_negative_color ();
+        gchar *color = gnc_get_negative_color ();
         g_object_set (cell, "foreground", color, NULL);
         g_free (color);
     }
@@ -1346,7 +1346,7 @@ totals_col_source (GtkTreeViewColumn *col, GtkCellRenderer *cell,
                                                 period_num < 0 ? TRUE : FALSE));
     if (priv->use_red_color && gnc_numeric_negative_p (total))
     {
-        gchar *color = get_negative_color ();
+        gchar *color = gnc_get_negative_color ();
         g_object_set (cell, "foreground", color, NULL);
         g_free (color);
     }

commit bc14e05027a49ee5526b1b7f6d4e300d4506362f
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Mon Feb 17 13:14:23 2020 +0000

    Use a cached value for preference 'use red for negative' in budgets
    
    Instead of retrieving the preference 'use red for negative numbers'
    every time the budget cells are updated/refreshed which could be many
    times retrieve it on create and store it in GncBudgetView and set up a
    preference call back to track the value.

diff --git a/gnucash/gnome/gnc-budget-view.c b/gnucash/gnome/gnc-budget-view.c
index d378d1b01..992bb8f91 100644
--- a/gnucash/gnome/gnc-budget-view.c
+++ b/gnucash/gnome/gnc-budget-view.c
@@ -161,6 +161,7 @@ struct GncBudgetViewPrivate
 
     GncBudget *budget;
     GncGUID    key;
+    gboolean   use_red_color;
 
     GList               *period_col_list;
     GList               *totals_col_list;
@@ -240,6 +241,16 @@ gbv_treeview_update_grid_lines (gpointer prefs, gchar *pref, gpointer user_data)
     gtk_tree_view_set_grid_lines (GTK_TREE_VIEW(view), gnc_tree_view_get_grid_lines_pref ());
 }
 
+static void
+gbv_update_use_red (gpointer prefs, gchar *pref, gpointer user_data)
+{
+    GncBudgetView *budget_view = user_data;
+    GncBudgetViewPrivate *priv = GNC_BUDGET_VIEW_GET_PRIVATE(budget_view);
+
+    priv->use_red_color = gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL,
+                                              GNC_PREF_NEGATIVE_IN_RED);
+}
+
 static void
 gnc_budget_view_finalize (GObject *object)
 {
@@ -256,6 +267,8 @@ gnc_budget_view_finalize (GObject *object)
                                  gbv_treeview_update_grid_lines, priv->totals_tree_view);
     gnc_prefs_remove_cb_by_func (GNC_PREFS_GROUP_GENERAL, GNC_PREF_GRID_LINES_VERTICAL,
                                  gbv_treeview_update_grid_lines, priv->totals_tree_view);
+    gnc_prefs_remove_cb_by_func (GNC_PREFS_GROUP_GENERAL, GNC_PREF_NEGATIVE_IN_RED,
+                                 gbv_update_use_red, budget_view);
 
     G_OBJECT_CLASS(gnc_budget_view_parent_class)->finalize (object);
     LEAVE(" ");
@@ -478,6 +491,11 @@ gbv_create_widget (GncBudgetView *budget_view)
     gnc_prefs_register_cb (GNC_PREFS_GROUP_GENERAL, GNC_PREF_GRID_LINES_VERTICAL,
                            gbv_treeview_update_grid_lines, totals_tree_view);
 
+    // get initial value and register prefs call back for use red color
+    priv->use_red_color = gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL, GNC_PREF_NEGATIVE_IN_RED);
+    gnc_prefs_register_cb (GNC_PREFS_GROUP_GENERAL, GNC_PREF_NEGATIVE_IN_RED,
+                           gbv_update_use_red, budget_view);
+
     PINFO("Number of Created totals columns is %d", gtk_tree_view_get_n_columns (totals_tree_view));
 
     gtk_box_set_homogeneous (GTK_BOX(vbox), FALSE);
@@ -994,40 +1012,39 @@ static gchar *
 budget_col_source (Account *account, GtkTreeViewColumn *col,
                    GtkCellRenderer *cell)
 {
-    GtkTreeView *bview;
-    GncBudget *budget;
+    GncBudgetView *budget_view;
+    GncBudgetViewPrivate *priv;
     guint period_num;
     gnc_numeric numeric;
     gchar amtbuff[100]; //FIXME: overkill, where's the #define?
     const gchar *note;
-    gboolean red = gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL, GNC_PREF_NEGATIVE_IN_RED);
 
-    budget = GNC_BUDGET(g_object_get_data (G_OBJECT(col), "budget"));
-    bview = GTK_TREE_VIEW(g_object_get_data (G_OBJECT(col), "budget_tree_view"));
+    budget_view = GNC_BUDGET_VIEW(g_object_get_data (G_OBJECT(col), "budget_view"));
     period_num = GPOINTER_TO_UINT(g_object_get_data (G_OBJECT(col), "period_num"));
 
-    if (!gnc_budget_is_account_period_value_set (budget, account, period_num))
+    priv = GNC_BUDGET_VIEW_GET_PRIVATE(budget_view);
+
+    if (!gnc_budget_is_account_period_value_set (priv->budget, account, period_num))
     {
         if (gnc_account_n_children (account) == 0)
             amtbuff[0] = '\0';
         else
         {
             GdkRGBA color;
-            GtkStyleContext *stylectxt = gtk_widget_get_style_context (GTK_WIDGET(bview));
+            GtkStyleContext *stylectxt = gtk_widget_get_style_context (GTK_WIDGET(priv->tree_view));
             gtk_style_context_get_color (stylectxt, GTK_STATE_FLAG_NORMAL, &color);
 
-            numeric = gbv_get_accumulated_budget_amount (budget, account, period_num);
-            xaccSPrintAmount (amtbuff, numeric,
-                             gnc_account_print_info (account, FALSE));
+            numeric = gbv_get_accumulated_budget_amount (priv->budget, account, period_num);
+            xaccSPrintAmount (amtbuff, numeric, gnc_account_print_info (account, FALSE));
             if (gnc_is_dark_theme (&color))
                 g_object_set (cell, "foreground",
-                              red && gnc_numeric_negative_p (numeric)
+                              priv->use_red_color && gnc_numeric_negative_p (numeric)
                                   ? "darkred"
                                   : "darkgray",
                               NULL);
             else
                 g_object_set (cell, "foreground",
-                              red && gnc_numeric_negative_p (numeric)
+                              priv->use_red_color && gnc_numeric_negative_p (numeric)
                                   ? "PaleVioletRed"
                                   : "dimgray",
                               NULL);
@@ -1035,7 +1052,7 @@ budget_col_source (Account *account, GtkTreeViewColumn *col,
     }
     else
     {
-        numeric = gnc_budget_get_account_period_value (budget, account,
+        numeric = gnc_budget_get_account_period_value (priv->budget, account,
                                                        period_num);
         if (gnc_numeric_check (numeric))
             strcpy (amtbuff, "error");
@@ -1047,7 +1064,7 @@ budget_col_source (Account *account, GtkTreeViewColumn *col,
             xaccSPrintAmount (amtbuff, numeric,
                               gnc_account_print_info (account, FALSE));
 
-            if (red && gnc_numeric_negative_p (numeric))
+            if (priv->use_red_color && gnc_numeric_negative_p (numeric))
             {
                 gchar *color = get_negative_color ();
                 g_object_set (cell, "foreground", color, NULL);
@@ -1058,7 +1075,7 @@ budget_col_source (Account *account, GtkTreeViewColumn *col,
         }
     }
 
-    note = gnc_budget_get_account_period_note (budget, account, period_num);
+    note = gnc_budget_get_account_period_note (priv->budget, account, period_num);
     g_object_set (cell, "flagged", note != NULL, NULL);
 
     return g_strdup (amtbuff);
@@ -1132,16 +1149,18 @@ static gchar *
 budget_total_col_source (Account *account, GtkTreeViewColumn *col,
                          GtkCellRenderer *cell)
 {
-    GncBudget *budget;
+    GncBudgetView *budget_view;
+    GncBudgetViewPrivate *priv;
     gnc_numeric total;
     gchar amtbuff[100]; //FIXME: overkill, where's the #define?
-    gboolean red = gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL, GNC_PREF_NEGATIVE_IN_RED);
 
-    budget = GNC_BUDGET(g_object_get_data (G_OBJECT(col), "budget"));
-    total = bgv_get_total_for_account (account, budget, NULL);
+    budget_view = GNC_BUDGET_VIEW(g_object_get_data (G_OBJECT(col), "budget_view"));
+    priv = GNC_BUDGET_VIEW_GET_PRIVATE(budget_view);
+
+    total = bgv_get_total_for_account (account, priv->budget, NULL);
     xaccSPrintAmount (amtbuff, total, gnc_account_print_info (account, TRUE));
 
-    if (red && gnc_numeric_negative_p (total))
+    if (priv->use_red_color && gnc_numeric_negative_p (total))
     {
         gchar *color = get_negative_color ();
         g_object_set (cell, "foreground", color, NULL);
@@ -1164,7 +1183,8 @@ static void
 budget_col_edited (Account *account, GtkTreeViewColumn *col,
                    const gchar *new_text)
 {
-    GncBudget *budget;
+    GncBudgetView *budget_view;
+    GncBudgetViewPrivate *priv;
     guint period_num;
     gnc_numeric numeric = gnc_numeric_error (GNC_ERROR_ARG);
 
@@ -1174,15 +1194,16 @@ budget_col_edited (Account *account, GtkTreeViewColumn *col,
 
     period_num = GPOINTER_TO_UINT(g_object_get_data (G_OBJECT(col), "period_num"));
 
-    budget = GNC_BUDGET(g_object_get_data (G_OBJECT(col), "budget"));
+    budget_view = GNC_BUDGET_VIEW(g_object_get_data (G_OBJECT(col), "budget_view"));
+    priv = GNC_BUDGET_VIEW_GET_PRIVATE(budget_view);
 
     if (new_text && *new_text == '\0')
-        gnc_budget_unset_account_period_value (budget, account, period_num);
+        gnc_budget_unset_account_period_value (priv->budget, account, period_num);
     else
     {
         if (gnc_reverse_budget_balance (account, TRUE))
             numeric = gnc_numeric_neg (numeric);
-        gnc_budget_set_account_period_value (budget, account, period_num,
+        gnc_budget_set_account_period_value (priv->budget, account, period_num,
                                              numeric);
     }
 }
@@ -1207,24 +1228,21 @@ totals_col_source (GtkTreeViewColumn *col, GtkCellRenderer *cell,
     GncBudgetView *budget_view;
     GncBudgetViewPrivate *priv;
     gint row_type;
-    GncBudget *budget;
-    Account* account; // used to make things easier in the adding up processes
+    Account *account; // used to make things easier in the adding up processes
     gint period_num;
     gnc_numeric value; // used to assist in adding and subtracting
     gchar amtbuff[100]; //FIXME: overkill, where's the #define?
     gint i;
     gint num_top_accounts;
-    gboolean red, neg;
+    gboolean neg;
     GNCPriceDB *pdb;
     gnc_commodity *total_currency, *currency;
     gnc_numeric total = gnc_numeric_zero ();
 
     budget_view = GNC_BUDGET_VIEW(user_data);
     priv = GNC_BUDGET_VIEW_GET_PRIVATE(budget_view);
-    red = gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL, GNC_PREF_NEGATIVE_IN_RED);
 
     gtk_tree_model_get (s_model, s_iter, 1, &row_type, -1);
-    budget = GNC_BUDGET(g_object_get_data (G_OBJECT(col), "budget"));
     period_num = GPOINTER_TO_INT(g_object_get_data (G_OBJECT(col), "period_num"));
 
     pdb = gnc_pricedb_get_db (gnc_get_current_book ());
@@ -1306,15 +1324,15 @@ totals_col_source (GtkTreeViewColumn *col, GtkCellRenderer *cell,
 
         if (period_num < 0)
         {
-            value = bgv_get_total_for_account (account, budget, total_currency);
+            value = bgv_get_total_for_account (account, priv->budget, total_currency);
         }
         else
         {
-            value = gbv_get_accumulated_budget_amount (budget, account, period_num);
+            value = gbv_get_accumulated_budget_amount (priv->budget, account, period_num);
 
             value = gnc_pricedb_convert_balance_nearest_price_t64 (
                         pdb, value, currency, total_currency,
-                        gnc_budget_get_period_start_date (budget, period_num));
+                        gnc_budget_get_period_start_date (priv->budget, period_num));
         }
 
         if (neg)
@@ -1326,7 +1344,7 @@ totals_col_source (GtkTreeViewColumn *col, GtkCellRenderer *cell,
     xaccSPrintAmount (amtbuff, total,
                       gnc_commodity_print_info (total_currency,
                                                 period_num < 0 ? TRUE : FALSE));
-    if (red && gnc_numeric_negative_p (total))
+    if (priv->use_red_color && gnc_numeric_negative_p (total))
     {
         gchar *color = get_negative_color ();
         g_object_set (cell, "foreground", color, NULL);
@@ -1407,7 +1425,7 @@ gbv_create_totals_column (GncBudgetView *budget_view, gint period_num)
     gbv_renderer_add_padding (renderer);
 
     gtk_tree_view_column_set_cell_data_func (col, renderer, totals_col_source, budget_view, NULL);
-    g_object_set_data (G_OBJECT(col), "budget", priv->budget);
+    g_object_set_data (G_OBJECT(col), "budget_view", budget_view);
     g_object_set_data (G_OBJECT(col), "period_num", GUINT_TO_POINTER(period_num));
     gtk_tree_view_column_set_sizing (col, GTK_TREE_VIEW_COLUMN_FIXED);
 
@@ -1522,8 +1540,7 @@ gnc_budget_view_refresh (GncBudgetView *budget_view)
         col = gnc_tree_view_account_add_custom_column_renderer (
                   GNC_TREE_VIEW_ACCOUNT(priv->tree_view), "",
                   budget_col_source, budget_col_edited, renderer);
-        g_object_set_data (G_OBJECT(col), "budget", priv->budget);
-        g_object_set_data (G_OBJECT(col), "budget_tree_view", priv->tree_view);
+        g_object_set_data (G_OBJECT(col), "budget_view", budget_view);
         g_object_set_data (G_OBJECT(col), "period_num", GUINT_TO_POINTER(num_periods_visible));
         col_list = g_list_append (col_list, col);
 
@@ -1579,7 +1596,7 @@ gnc_budget_view_refresh (GncBudgetView *budget_view)
             gtk_tree_view_column_set_min_width (priv->total_col, logical_rect.width);
         }
         g_date_free (date);
-        g_object_set_data (G_OBJECT(priv->total_col), "budget", priv->budget);
+        g_object_set_data (G_OBJECT(priv->total_col), "budget_view", budget_view);
 
         // as we only have one renderer/column, use this function to get it
         renderer = gnc_tree_view_column_get_renderer (priv->total_col);

commit 1d1d7369381b42c8194cddf020024ea403f7623a
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Mon Feb 17 12:49:34 2020 +0000

    Change some additional spacing in source files gnc-budget-view.*

diff --git a/gnucash/gnome/gnc-budget-view.c b/gnucash/gnome/gnc-budget-view.c
index 254ad4286..d378d1b01 100644
--- a/gnucash/gnome/gnc-budget-view.c
+++ b/gnucash/gnome/gnc-budget-view.c
@@ -127,15 +127,15 @@ static void gbv_row_activated_cb (GtkTreeView *treeview, GtkTreePath *path,
 static gboolean query_tooltip_tree_view_cb (GtkWidget *widget, gint x, gint y,
                                             gboolean keyboard_tip,
                                             GtkTooltip *tooltip,
-                                            GncBudgetView* budget_view);
+                                            GncBudgetView *budget_view);
 #if 0
 static void gbv_selection_changed_cb (GtkTreeSelection *selection,
                                       GncBudgetView *budget_view);
 #endif
-static void gbv_treeview_resized_cb (GtkWidget* widget, GtkAllocation* allocation,
-                                     GncBudgetView* budget_view);
-static gnc_numeric gbv_get_accumulated_budget_amount (GncBudget* budget,
-                                     Account* account, guint period_num);
+static void gbv_treeview_resized_cb (GtkWidget *widget, GtkAllocation *allocation,
+                                     GncBudgetView *budget_view);
+static gnc_numeric gbv_get_accumulated_budget_amount (GncBudget *budget,
+                                     Account *account, guint period_num);
 
 /** \brief the private budget view structure
 
@@ -182,7 +182,7 @@ G_DEFINE_TYPE_WITH_PRIVATE(GncBudgetView, gnc_budget_view, GTK_TYPE_BOX)
     As the name suggests, this creates a new gnc budget view.
 */
 GncBudgetView *
-gnc_budget_view_new (GncBudget *budget, AccountFilterDialog* fd)
+gnc_budget_view_new (GncBudget *budget, AccountFilterDialog *fd)
 {
     GncBudgetView        *budget_view;
     GncBudgetViewPrivate *priv;
@@ -228,13 +228,13 @@ gnc_budget_view_init (GncBudgetView *budget_view)
     priv = GNC_BUDGET_VIEW_GET_PRIVATE(budget_view);
 
     /* Keep track of the root account */
-    priv->rootAcct = gnc_book_get_root_account(gnc_get_current_book());
+    priv->rootAcct = gnc_book_get_root_account (gnc_get_current_book());
 
     LEAVE("");
 }
 
 static void
-gbv_treeview_update_grid_lines (gpointer prefs, gchar* pref, gpointer user_data)
+gbv_treeview_update_grid_lines (gpointer prefs, gchar *pref, gpointer user_data)
 {
     GtkTreeView *view = user_data;
     gtk_tree_view_set_grid_lines (GTK_TREE_VIEW(view), gnc_tree_view_get_grid_lines_pref ());
@@ -267,7 +267,7 @@ gnc_budget_view_finalize (GObject *object)
     macro GNC_BUDGET_VIEW_GET_PRIVATE.
 */
 GtkTreeSelection*
-gnc_budget_view_get_selection (GncBudgetView* budget_view)
+gnc_budget_view_get_selection (GncBudgetView *budget_view)
 {
     GncBudgetViewPrivate *priv;
 
@@ -278,44 +278,44 @@ gnc_budget_view_get_selection (GncBudgetView* budget_view)
 }
 
 Account*
-gnc_budget_view_get_account_from_path (GncBudgetView* budget_view, GtkTreePath* path)
+gnc_budget_view_get_account_from_path (GncBudgetView *budget_view, GtkTreePath *path)
 {
     GncBudgetViewPrivate *priv;
 
-    g_return_val_if_fail(GNC_IS_BUDGET_VIEW(budget_view), NULL);
+    g_return_val_if_fail (GNC_IS_BUDGET_VIEW(budget_view), NULL);
 
     priv = GNC_BUDGET_VIEW_GET_PRIVATE(budget_view);
     return gnc_tree_view_account_get_account_from_path (GNC_TREE_VIEW_ACCOUNT(priv->tree_view), path);
 }
 
 GtkWidget*
-gnc_budget_view_get_account_tree_view (GncBudgetView* budget_view)
+gnc_budget_view_get_account_tree_view (GncBudgetView *budget_view)
 {
     GncBudgetViewPrivate *priv;
 
-    g_return_val_if_fail(GNC_IS_BUDGET_VIEW(budget_view), NULL);
+    g_return_val_if_fail (GNC_IS_BUDGET_VIEW(budget_view), NULL);
 
-    priv =  GNC_BUDGET_VIEW_GET_PRIVATE(budget_view);
+    priv = GNC_BUDGET_VIEW_GET_PRIVATE(budget_view);
     return GTK_WIDGET(priv->fd->tree_view);
 }
 
 GList*
-gnc_budget_view_get_selected_accounts (GncBudgetView* budget_view)
+gnc_budget_view_get_selected_accounts (GncBudgetView *budget_view)
 {
     GncBudgetViewPrivate *priv;
 
-    g_return_val_if_fail(GNC_IS_BUDGET_VIEW(budget_view), NULL);
+    g_return_val_if_fail (GNC_IS_BUDGET_VIEW(budget_view), NULL);
 
     priv = GNC_BUDGET_VIEW_GET_PRIVATE(budget_view);
     return gnc_tree_view_account_get_selected_accounts (GNC_TREE_VIEW_ACCOUNT(priv->tree_view));
 }
 
 static void
-gbv_totals_scrollbar_value_changed_cb (GtkAdjustment *adj, GncBudgetView* budget_view)
+gbv_totals_scrollbar_value_changed_cb (GtkAdjustment *adj, GncBudgetView *budget_view)
 {
     GncBudgetViewPrivate *priv;
 
-    g_return_if_fail(GNC_IS_BUDGET_VIEW(budget_view));
+    g_return_if_fail (GNC_IS_BUDGET_VIEW(budget_view));
 
     priv = GNC_BUDGET_VIEW_GET_PRIVATE(budget_view);
     gtk_adjustment_set_value (priv->hadj, gtk_adjustment_get_value (adj));
@@ -447,23 +447,23 @@ gbv_create_widget (GncBudgetView *budget_view)
                       G_CALLBACK(gbv_totals_scrollbar_value_changed_cb), budget_view);
 
     // Create totals tree view
-    totals_tree_model = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_INT);
-    gtk_list_store_append(totals_tree_model, &iter);
-    gtk_list_store_set(totals_tree_model, &iter, 0, _("Inflow from Income"), 1, TOTALS_TYPE_INCOME, -1);
-    gtk_list_store_append(totals_tree_model, &iter);
-    gtk_list_store_set(totals_tree_model, &iter, 0, _("Outflow to Expenses"), 1, TOTALS_TYPE_EXPENSES, -1);
-    gtk_list_store_append(totals_tree_model, &iter);
-    gtk_list_store_set(totals_tree_model, &iter, 0, _("Outflow to Asset/Equity/Liability"), 1, TOTALS_TYPE_ASSET_LIAB_EQ, -1);
-    gtk_list_store_append(totals_tree_model, &iter);
-    gtk_list_store_set(totals_tree_model, &iter, 0, _("Remaining to Budget"), 1, TOTALS_TYPE_REMAINDER, -1);
-
-    totals_tree_view = GTK_TREE_VIEW(gtk_tree_view_new());
+    totals_tree_model = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_INT);
+    gtk_list_store_append (totals_tree_model, &iter);
+    gtk_list_store_set (totals_tree_model, &iter, 0, _("Inflow from Income"), 1, TOTALS_TYPE_INCOME, -1);
+    gtk_list_store_append (totals_tree_model, &iter);
+    gtk_list_store_set (totals_tree_model, &iter, 0, _("Outflow to Expenses"), 1, TOTALS_TYPE_EXPENSES, -1);
+    gtk_list_store_append (totals_tree_model, &iter);
+    gtk_list_store_set (totals_tree_model, &iter, 0, _("Outflow to Asset/Equity/Liability"), 1, TOTALS_TYPE_ASSET_LIAB_EQ, -1);
+    gtk_list_store_append (totals_tree_model, &iter);
+    gtk_list_store_set (totals_tree_model, &iter, 0, _("Remaining to Budget"), 1, TOTALS_TYPE_REMAINDER, -1);
+
+    totals_tree_view = GTK_TREE_VIEW(gtk_tree_view_new ());
     priv->totals_tree_view = totals_tree_view;
     gtk_tree_selection_set_mode (gtk_tree_view_get_selection (totals_tree_view), GTK_SELECTION_NONE);
     gtk_tree_view_set_headers_visible (totals_tree_view, FALSE);
     gtk_tree_view_set_model (totals_tree_view, GTK_TREE_MODEL(totals_tree_model));
 
-    totals_title_col = gtk_tree_view_column_new_with_attributes ("", gtk_cell_renderer_text_new(), "text", 0, NULL);
+    totals_title_col = gtk_tree_view_column_new_with_attributes ("", gtk_cell_renderer_text_new (), "text", 0, NULL);
     gtk_tree_view_column_set_expand (totals_title_col, TRUE);
     gtk_tree_view_column_set_sizing (totals_title_col, GTK_TREE_VIEW_COLUMN_FIXED);
     gtk_tree_view_append_column (totals_tree_view, totals_title_col);
@@ -495,12 +495,15 @@ gbv_create_widget (GncBudgetView *budget_view)
     h_scrollbar = gtk_scrolled_window_get_hscrollbar (GTK_SCROLLED_WINDOW(scrolled_window));
     gtk_widget_hide (h_scrollbar);
 
-    g_signal_connect(G_OBJECT(tree_view), "size-allocate",
-                     G_CALLBACK(gbv_treeview_resized_cb), budget_view);
+    g_signal_connect (G_OBJECT(tree_view), "size-allocate",
+                      G_CALLBACK(gbv_treeview_resized_cb), budget_view);
 
     // Read account filter state information from budget section
-    gnc_tree_view_account_restore_filter (GNC_TREE_VIEW_ACCOUNT(priv->tree_view), priv->fd,
-       gnc_state_get_current(), gnc_tree_view_get_state_section (GNC_TREE_VIEW(priv->tree_view)));
+    gnc_tree_view_account_restore_filter (GNC_TREE_VIEW_ACCOUNT(priv->tree_view),
+                                          priv->fd,
+                                          gnc_state_get_current(),
+                                          gnc_tree_view_get_state_section (
+                                          GNC_TREE_VIEW(priv->tree_view)));
 
     // use the model row-changed signal to do a redraw on the totals tree view
     g_signal_connect (G_OBJECT(gtk_tree_view_get_model (GTK_TREE_VIEW(tree_view))), "row-changed",
@@ -509,7 +512,6 @@ gbv_create_widget (GncBudgetView *budget_view)
     gnc_budget_view_refresh (budget_view);
 }
 
-
 #define BUDGET_GUID "Budget GncGUID"
 
 /***********************************************************************
@@ -557,7 +559,7 @@ gnc_budget_view_save (GncBudgetView *budget_view, GKeyFile *key_file, const gcha
  *  @return TRUE if successful, FALSE if unsuccessful
  **********************************************************************/
 gboolean
-gnc_budget_view_restore (GncBudgetView* budget_view, GKeyFile *key_file, const gchar *group_name)
+gnc_budget_view_restore (GncBudgetView *budget_view, GKeyFile *key_file, const gchar *group_name)
 {
     GncBudgetViewPrivate *priv;
     GError *error = NULL;
@@ -683,7 +685,7 @@ gbv_button_press_cb (GtkWidget *widget, GdkEventButton *event,
  * The handler is for the cell-editable, not for the treeview
 */
 static gboolean
-gbv_key_press_cb(GtkWidget *widget, GdkEventKey *event, gpointer user_data)
+gbv_key_press_cb (GtkWidget *widget, GdkEventKey *event, gpointer user_data)
 {
     GtkTreeViewColumn    *col;
     GtkTreePath          *path = NULL;
@@ -741,6 +743,7 @@ gbv_key_press_cb(GtkWidget *widget, GdkEventKey *event, gpointer user_data)
             if (!gtk_tree_path_prev (path))
                 gtk_tree_path_up (path);
             else
+            {
                 while (gtk_tree_view_row_expanded (tv, path))
                 {
                     gtk_tree_path_down (path);
@@ -751,6 +754,7 @@ gbv_key_press_cb(GtkWidget *widget, GdkEventKey *event, gpointer user_data)
                         gnc_tree_view_path_is_valid (GNC_TREE_VIEW(tv), path));
                     gtk_tree_path_prev (path);
                 }
+            }
         }
 
         col = g_list_nth_data (priv->period_col_list, period_num);
@@ -779,8 +783,8 @@ gbv_key_press_cb(GtkWidget *widget, GdkEventKey *event, gpointer user_data)
 /** \brief gnc budget view actions for resize of treeview.
 */
 static void
-gbv_treeview_resized_cb (GtkWidget* widget, GtkAllocation* allocation,
-                         GncBudgetView* budget_view)
+gbv_treeview_resized_cb (GtkWidget *widget, GtkAllocation *allocation,
+                         GncBudgetView *budget_view)
 {
     GncBudgetViewPrivate* priv;
     gint ncols;
@@ -809,7 +813,7 @@ gbv_treeview_resized_cb (GtkWidget* widget, GtkAllocation* allocation,
         {
             col_width = gtk_tree_view_column_get_width (tree_view_col);
             totals_view_col = gtk_tree_view_get_column (priv->totals_tree_view, j);
-            if(GTK_IS_TREE_VIEW_COLUMN(totals_view_col))
+            if (GTK_IS_TREE_VIEW_COLUMN(totals_view_col))
                 gtk_tree_view_column_set_fixed_width (totals_view_col, col_width);
             j++;
         }
@@ -838,39 +842,39 @@ gbv_row_activated_cb (GtkTreeView *treeview, GtkTreePath *path,
 }
 
 static gboolean
-query_tooltip_tree_view_cb(GtkWidget *widget, gint x, gint y,
-                           gboolean keyboard_tip, GtkTooltip *tooltip,
-                           GncBudgetView* view)
+query_tooltip_tree_view_cb (GtkWidget *widget, gint x, gint y,
+                            gboolean keyboard_tip, GtkTooltip *tooltip,
+                            GncBudgetView *view)
 {
-    GtkTreeView *tree_view = GTK_TREE_VIEW(widget);
+    GtkTreeView          *tree_view = GTK_TREE_VIEW(widget);
     GncBudgetViewPrivate *priv = GNC_BUDGET_VIEW_GET_PRIVATE(view);
-    GtkTreePath *path      = NULL;
-    GtkTreeViewColumn *column = NULL;
-    const gchar *note;
-    guint period_num;
-    Account *account;
+    GtkTreePath          *path  = NULL;
+    GtkTreeViewColumn    *column = NULL;
+    const gchar          *note;
+    guint                 period_num;
+    Account              *account;
 
-    gtk_tree_view_convert_widget_to_bin_window_coords(tree_view, x, y, &x, &y);
+    gtk_tree_view_convert_widget_to_bin_window_coords (tree_view, x, y, &x, &y);
 
-    if (keyboard_tip || !gtk_tree_view_get_path_at_pos(tree_view, x, y, &path,
-                                                       &column, NULL, NULL))
+    if (keyboard_tip || !gtk_tree_view_get_path_at_pos (tree_view, x, y, &path,
+                                                        &column, NULL, NULL))
         return FALSE;
 
     if (!column)
         return FALSE;
 
-    period_num = GPOINTER_TO_UINT(g_object_get_data(G_OBJECT(column), "period_num"));
+    period_num = GPOINTER_TO_UINT(g_object_get_data (G_OBJECT(column), "period_num"));
     if (!period_num && priv->period_col_list->data != column)
         return FALSE;
-    account = gnc_tree_view_account_get_account_from_path(
-        GNC_TREE_VIEW_ACCOUNT(widget), path);
-    note = gnc_budget_get_account_period_note(priv->budget, account, period_num);
+    account = gnc_tree_view_account_get_account_from_path (
+                  GNC_TREE_VIEW_ACCOUNT(widget), path);
+    note = gnc_budget_get_account_period_note (priv->budget, account, period_num);
     if (!note)
         return FALSE;
 
-    gtk_tooltip_set_text(tooltip, note);
-    gtk_tree_view_set_tooltip_cell(tree_view, tooltip, path, column, NULL);
-    gtk_tree_path_free(path);
+    gtk_tooltip_set_text (tooltip, note);
+    gtk_tree_view_set_tooltip_cell (tree_view, tooltip, path, column, NULL);
+    gtk_tree_path_free (path);
 
     return TRUE;
 }
@@ -922,9 +926,9 @@ typedef struct
 This function is used in conjunction with the function \ref gbv_get_accumulated_budget_amount to find the total of sub accounts. \ref gbv_get_accumulated_budget_amount passes this function to \ref gnc_account_foreach_child function in order to perform this operation. The latter method then calls \ref budget_accum_helper on all of the sub accounts of the main account passed in order to calculate the accumulated total.
 */
 static void
-budget_accum_helper (Account* account, gpointer data)
+budget_accum_helper (Account *account, gpointer data)
 {
-    BudgetAccumulationInfo* info = (BudgetAccumulationInfo*)data;
+    BudgetAccumulationInfo *info = (BudgetAccumulationInfo*)data;
     gnc_numeric numeric;
     gnc_commodity *currency;
 
@@ -957,11 +961,11 @@ budget_accum_helper (Account* account, gpointer data)
 This function uses the \ref budget_accum_helper to calculate the accumulated budget amount in a given budget account for a specified period number. If the account does not have children, then it simply returns the balance of the account.
 */
 static gnc_numeric
-gbv_get_accumulated_budget_amount (GncBudget* budget, Account* account, guint period_num)
+gbv_get_accumulated_budget_amount (GncBudget *budget, Account *account, guint period_num)
 {
     BudgetAccumulationInfo info;
 
-    info.total = gnc_numeric_zero();
+    info.total = gnc_numeric_zero ();
     info.budget = budget;
     info.period_num = period_num;
     info.pdb = gnc_pricedb_get_db (gnc_account_get_book (account));
@@ -969,9 +973,9 @@ gbv_get_accumulated_budget_amount (GncBudget* budget, Account* account, guint pe
 
     if (!gnc_budget_is_account_period_value_set (budget, account, period_num))
         gnc_account_foreach_child (account, budget_accum_helper, &info);
-     else
+    else
         info.total = gnc_budget_get_account_period_value (budget, account, period_num);
- 
+
     if (gnc_reverse_budget_balance (account, TRUE))
         info.total = gnc_numeric_neg (info.total);
 
@@ -1064,7 +1068,7 @@ budget_col_source (Account *account, GtkTreeViewColumn *col,
  totals column to the right.
 */
 static gnc_numeric
-bgv_get_total_for_account (Account* account, GncBudget* budget, gnc_commodity *new_currency)
+bgv_get_total_for_account (Account *account, GncBudget *budget, gnc_commodity *new_currency)
 {
     guint num_periods;
     int period_num;
@@ -1200,8 +1204,8 @@ totals_col_source (GtkTreeViewColumn *col, GtkCellRenderer *cell,
                    GtkTreeModel *s_model, GtkTreeIter *s_iter,
                    gpointer user_data)
 {
-    GncBudgetView* budget_view;
-    GncBudgetViewPrivate* priv;
+    GncBudgetView *budget_view;
+    GncBudgetViewPrivate *priv;
     gint row_type;
     GncBudget *budget;
     Account* account; // used to make things easier in the adding up processes
@@ -1213,9 +1217,7 @@ totals_col_source (GtkTreeViewColumn *col, GtkCellRenderer *cell,
     gboolean red, neg;
     GNCPriceDB *pdb;
     gnc_commodity *total_currency, *currency;
-
-
-    gnc_numeric total = gnc_numeric_zero();
+    gnc_numeric total = gnc_numeric_zero ();
 
     budget_view = GNC_BUDGET_VIEW(user_data);
     priv = GNC_BUDGET_VIEW_GET_PRIVATE(budget_view);
@@ -1239,7 +1241,7 @@ totals_col_source (GtkTreeViewColumn *col, GtkCellRenderer *cell,
         currency = gnc_account_get_currency_or_parent (account);
         acctype = xaccAccountGetType (account);
 
-        if (gnc_using_unreversed_budgets(gnc_account_get_book(account)))
+        if (gnc_using_unreversed_budgets (gnc_account_get_book (account)))
         {  /* using book with unreversed-budgets feature. This will be
               the default in 4.x after budget scrubbing*/
             neg = gnc_reverse_balance (account);
@@ -1389,7 +1391,7 @@ gbv_renderer_add_padding (GtkCellRenderer *renderer)
 /** \brief Function to create the totals column to the right of the view.
 */
 static GtkTreeViewColumn*
-gbv_create_totals_column (GncBudgetView* budget_view, gint period_num)
+gbv_create_totals_column (GncBudgetView *budget_view, gint period_num)
 {
     GncBudgetViewPrivate *priv;
     GtkTreeViewColumn *col;
@@ -1417,8 +1419,8 @@ gbv_create_totals_column (GncBudgetView* budget_view, gint period_num)
 The function simply calls \ref gtk_widget_queue_draw on the current totals_tree_view.
 */
 static void
-gbv_col_edited_cb (GtkCellRendererText* cell, gchar* path_string,
-                   gchar* new_text, gpointer user_data)
+gbv_col_edited_cb (GtkCellRendererText *cell, gchar *path_string,
+                   gchar *new_text, gpointer user_data)
 {
     GncBudgetView *budget_view = GNC_BUDGET_VIEW(user_data);
     GncBudgetViewPrivate *priv = GNC_BUDGET_VIEW_GET_PRIVATE(budget_view);
@@ -1506,7 +1508,7 @@ gnc_budget_view_refresh (GncBudgetView *budget_view)
         col = priv->total_col;
         gtk_tree_view_remove_column (GTK_TREE_VIEW(priv->tree_view), col);
         priv->total_col = NULL;
-        col = gtk_tree_view_get_column (GTK_TREE_VIEW(priv->totals_tree_view), num_periods_visible+1);
+        col = gtk_tree_view_get_column (GTK_TREE_VIEW(priv->totals_tree_view), num_periods_visible + 1);
         gtk_tree_view_remove_column (GTK_TREE_VIEW(priv->totals_tree_view), col);
     }
 
@@ -1514,8 +1516,8 @@ gnc_budget_view_refresh (GncBudgetView *budget_view)
     while (num_periods_visible < num_periods)
     {
         GtkCellRenderer *renderer = gnc_cell_renderer_text_flag_new ();
-        g_object_set(renderer, "flag-color-rgba", note_color, NULL);
-        g_object_set(renderer, "flag-color-rgba-selected", note_color_selected, NULL);
+        g_object_set (renderer, "flag-color-rgba", note_color, NULL);
+        g_object_set (renderer, "flag-color-rgba-selected", note_color_selected, NULL);
 
         col = gnc_tree_view_account_add_custom_column_renderer (
                   GNC_TREE_VIEW_ACCOUNT(priv->tree_view), "",
@@ -1542,7 +1544,7 @@ gnc_budget_view_refresh (GncBudgetView *budget_view)
 
         num_periods_visible = g_list_length (col_list);
     }
-    
+
     gdk_rgba_free (note_color);
     gdk_rgba_free (note_color_selected);
 
diff --git a/gnucash/gnome/gnc-budget-view.h b/gnucash/gnome/gnc-budget-view.h
index 2ac525a54..d61699724 100644
--- a/gnucash/gnome/gnc-budget-view.h
+++ b/gnucash/gnome/gnc-budget-view.h
@@ -60,16 +60,16 @@ GType gnc_budget_view_get_type (void);
  *
  *  @return The newly created widget
  */
-GncBudgetView *gnc_budget_view_new (GncBudget *budget, AccountFilterDialog* fd);
-void gnc_budget_view_save (GncBudgetView* budget_view, GKeyFile *key_file, const gchar* group_name);
-void gnc_budget_view_refresh (GncBudgetView* budget_view);
-void gnc_budget_view_delete_budget (GncBudgetView* budget_view);
+GncBudgetView *gnc_budget_view_new (GncBudget *budget, AccountFilterDialog *fd);
+void gnc_budget_view_save (GncBudgetView *budget_view, GKeyFile *key_file, const gchar *group_name);
+void gnc_budget_view_refresh (GncBudgetView *budget_view);
+void gnc_budget_view_delete_budget (GncBudgetView *budget_view);
 void gnc_budget_view_save_account_filter (GncBudgetView *budget_view);
-gboolean gnc_budget_view_restore (GncBudgetView* budget_view, GKeyFile *key_file, const gchar* group_name);
-GtkTreeSelection* gnc_budget_view_get_selection (GncBudgetView* budget_view);
-Account* gnc_budget_view_get_account_from_path (GncBudgetView* budget_view, GtkTreePath* path);
-GList* gnc_budget_view_get_selected_accounts (GncBudgetView* budget_view);
-GtkWidget *gnc_budget_view_get_account_tree_view (GncBudgetView* budget_view);
+gboolean gnc_budget_view_restore (GncBudgetView *budget_view, GKeyFile *key_file, const gchar *group_name);
+GtkTreeSelection* gnc_budget_view_get_selection (GncBudgetView *budget_view);
+Account* gnc_budget_view_get_account_from_path (GncBudgetView *budget_view, GtkTreePath *path);
+GList* gnc_budget_view_get_selected_accounts (GncBudgetView *budget_view);
+GtkWidget *gnc_budget_view_get_account_tree_view (GncBudgetView *budget_view);
 
 G_END_DECLS
 

commit ff514e3b377dee71def545318b4e8d7fed458a8a
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Mon Feb 17 12:07:01 2020 +0000

    Bug797486 - Add dialog to cascade placeholder and hidden
    
    Make changes to the existing cascade colour dialog to allow the
    selection of cascading colour, placeholder and hidden account properties

diff --git a/gnucash/gnome-utils/dialog-account.c b/gnucash/gnome-utils/dialog-account.c
index 5383f3032..0144d1f96 100644
--- a/gnucash/gnome-utils/dialog-account.c
+++ b/gnucash/gnome-utils/dialog-account.c
@@ -2122,12 +2122,28 @@ update_account_color (Account *acc, const gchar *old_color, const gchar *new_col
     }
 }
 
+static void
+enable_box_cb (GtkToggleButton *toggle_button, gpointer user_data)
+{
+    gboolean sensitive = FALSE;
+
+    if (gtk_toggle_button_get_active (toggle_button))
+        sensitive = TRUE;
+
+    gtk_widget_set_sensitive (GTK_WIDGET(user_data), sensitive);
+}
+
 void
-gnc_account_cascade_color_dialog (GtkWidget *window, Account *account)
+gnc_account_cascade_properties_dialog (GtkWidget *window, Account *account)
 {
     GtkWidget *dialog;
     GtkBuilder *builder;
-    GtkWidget *color_label, *color_button, *over_write, *color_button_default;
+    GtkWidget *label;
+    GtkWidget *color_button, *over_write, *color_button_default;
+    GtkWidget *enable_color, *enable_placeholder, *enable_hidden;
+    GtkWidget *color_box, *placeholder_box, *hidden_box;
+    GtkWidget *placeholder_button, *hidden_button;
+
     gchar *string;
     const char *color_string;
     gchar *old_color_string = NULL;
@@ -2138,24 +2154,31 @@ gnc_account_cascade_color_dialog (GtkWidget *window, Account *account)
     g_return_if_fail (gnc_account_n_children (account) > 0);
 
     builder = gtk_builder_new();
-    gnc_builder_add_from_file (builder, "dialog-account.glade", "account_cascade_color_dialog");
-    dialog = GTK_WIDGET(gtk_builder_get_object (builder, "account_cascade_color_dialog"));
+    gnc_builder_add_from_file (builder, "dialog-account.glade", "account_cascade_dialog");
+    dialog = GTK_WIDGET(gtk_builder_get_object (builder, "account_cascade_dialog"));
     gtk_window_set_transient_for (GTK_WINDOW(dialog), GTK_WINDOW(window));
 
-    color_label = GTK_WIDGET(gtk_builder_get_object (builder, "color_label"));
+    // Color section
+    enable_color = GTK_WIDGET(gtk_builder_get_object (builder, "enable_cascade_color"));
+    color_box = GTK_WIDGET(gtk_builder_get_object (builder, "color_box"));
+
+    label = GTK_WIDGET(gtk_builder_get_object (builder, "color_label"));
     over_write = GTK_WIDGET(gtk_builder_get_object (builder, "replace_check"));
     color_button = GTK_WIDGET(gtk_builder_get_object (builder, "color_button"));
     color_button_default = GTK_WIDGET(gtk_builder_get_object (builder, "color_button_default"));
 
     gtk_color_chooser_set_use_alpha (GTK_COLOR_CHOOSER(color_button), FALSE);
 
+    g_signal_connect (G_OBJECT(enable_color), "toggled",
+                      G_CALLBACK(enable_box_cb), (gpointer)color_box);
+
     g_signal_connect (G_OBJECT(color_button_default), "clicked",
                       G_CALLBACK(default_color_button_cb), (gpointer)color_button);
 
-    string = g_strdup_printf(_( "Set the account color for account '%s' "
-                                "including all sub-accounts to the selected color"),
-                             gnc_account_get_full_name(account));
-    gtk_label_set_text (GTK_LABEL(color_label), string);
+    string = g_strdup_printf (_( "Set the account color for account '%s' "
+                                 "including all sub-accounts to the selected color"),
+                              gnc_account_get_full_name (account));
+    gtk_label_set_text (GTK_LABEL(label), string);
     g_free (string);
 
     color_string = xaccAccountGetColor (account); // get existing account color
@@ -2171,6 +2194,34 @@ gnc_account_cascade_color_dialog (GtkWidget *window, Account *account)
     // set the color chooser to account color
     gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER(color_button), &color);
 
+    // Placeholder section
+    enable_placeholder = GTK_WIDGET(gtk_builder_get_object (builder, "enable_cascade_placeholder"));
+    placeholder_box = GTK_WIDGET(gtk_builder_get_object (builder, "placeholder_box"));
+    label = GTK_WIDGET(gtk_builder_get_object (builder, "placeholder_label"));
+    placeholder_button = GTK_WIDGET(gtk_builder_get_object (builder, "placeholder_check_button"));
+    g_signal_connect (G_OBJECT(enable_placeholder), "toggled",
+                      G_CALLBACK(enable_box_cb), (gpointer)placeholder_box);
+
+    string = g_strdup_printf (_( "Set the account placeholder value for account '%s' "
+                                 "including all sub-accounts"),
+                              gnc_account_get_full_name (account));
+    gtk_label_set_text (GTK_LABEL(label), string);
+    g_free (string);
+
+    // Hidden section
+    enable_hidden = GTK_WIDGET(gtk_builder_get_object (builder, "enable_cascade_hidden"));
+    hidden_box = GTK_WIDGET(gtk_builder_get_object (builder, "hidden_box"));
+    label = GTK_WIDGET(gtk_builder_get_object (builder, "hidden_label"));
+    hidden_button = GTK_WIDGET(gtk_builder_get_object (builder, "hidden_check_button"));
+    g_signal_connect (G_OBJECT(enable_hidden), "toggled",
+                      G_CALLBACK(enable_box_cb), (gpointer)hidden_box);
+
+    string = g_strdup_printf (_( "Set the account hidden value for account '%s' "
+                                 "including all sub-accounts"),
+                              gnc_account_get_full_name (account));
+    gtk_label_set_text (GTK_LABEL(label), string);
+    g_free (string);
+
     /* default to cancel */
     gtk_dialog_set_default_response (GTK_DIALOG(dialog), GTK_RESPONSE_CANCEL);
 
@@ -2184,31 +2235,56 @@ gnc_account_cascade_color_dialog (GtkWidget *window, Account *account)
     if (response == GTK_RESPONSE_OK)
     {
         GList *accounts = gnc_account_get_descendants (account);
-        gboolean replace = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(over_write));
-        GList *acct;
         GdkRGBA new_color;
-        const gchar *new_color_string;
+        const gchar *new_color_string = NULL;
+        gboolean color_active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(enable_color));
+        gboolean placeholder_active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(enable_placeholder));
+        gboolean hidden_active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(enable_hidden));
+        gboolean replace = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(over_write));
+        gboolean placeholder = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(placeholder_button));
+        gboolean hidden = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(hidden_button));
 
-        gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER(color_button), &new_color);
-        new_color_string = gdk_rgba_to_string (&new_color);
+        // Update Account Colors
+        if (color_active)
+        {
+            gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER(color_button), &new_color);
+            new_color_string = gdk_rgba_to_string (&new_color);
+
+            if (g_strcmp0 (new_color_string, DEFAULT_COLOR) == 0)
+                new_color_string = NULL;
 
-        if (g_strcmp0 (new_color_string, DEFAULT_COLOR) == 0)
-            new_color_string = NULL;
+            // check/update selected account
+            update_account_color (account, old_color_string, new_color_string, replace);
+        }
 
-        // check/update selected account
-        update_account_color (account, old_color_string, new_color_string, replace);
+        // Update Account Placeholder value
+        if (placeholder_active)
+            xaccAccountSetPlaceholder (account, placeholder);
 
+        // Update Account Hidden value
+        if (hidden_active)
+            xaccAccountSetHidden (account, hidden);
+
+        // Update SubAccounts
         if (accounts)
         {
-            for (acct = accounts; acct; acct = g_list_next(acct))
+            for (GList *acct = accounts; acct; acct = g_list_next(acct))
             {
-                const char *string = xaccAccountGetColor (acct->data);
-
-                // check/update sub-accounts
-                update_account_color (acct->data, string, new_color_string, replace);
+                // Update SubAccount Colors
+                if (color_active)
+                {
+                    const char *string = xaccAccountGetColor (acct->data);
+                    update_account_color (acct->data, string, new_color_string, replace);
+                }
+                // Update SubAccount PlaceHolder
+                if (placeholder_active)
+                    xaccAccountSetPlaceholder (acct->data, placeholder);
+                // Update SubAccount Hidden
+                if (hidden_active)
+                    xaccAccountSetHidden (acct->data, hidden);
             }
-            g_list_free (accounts);
         }
+        g_list_free (accounts);
     }
     if (old_color_string)
         g_free (old_color_string);
diff --git a/gnucash/gnome-utils/dialog-account.h b/gnucash/gnome-utils/dialog-account.h
index 92281ae83..916f03e3f 100644
--- a/gnucash/gnome-utils/dialog-account.h
+++ b/gnucash/gnome-utils/dialog-account.h
@@ -161,7 +161,7 @@ void gnc_ui_register_account_destroy_callback (void (*cb)(Account *));
 
 void gnc_account_renumber_create_dialog (GtkWidget *window, Account *account);
 
-void gnc_account_cascade_color_dialog (GtkWidget *window, Account *account);
+void gnc_account_cascade_properties_dialog (GtkWidget *window, Account *account);
 
 /** @} */
 /** @} */
diff --git a/gnucash/gnome/gnc-plugin-page-account-tree.c b/gnucash/gnome/gnc-plugin-page-account-tree.c
index 745efc8aa..eac023359 100644
--- a/gnucash/gnome/gnc-plugin-page-account-tree.c
+++ b/gnucash/gnome/gnc-plugin-page-account-tree.c
@@ -155,7 +155,7 @@ static void gnc_plugin_page_account_tree_cmd_lots (GtkAction *action, GncPluginP
 static void gnc_plugin_page_account_tree_cmd_scrub (GtkAction *action, GncPluginPageAccountTree *page);
 static void gnc_plugin_page_account_tree_cmd_scrub_sub (GtkAction *action, GncPluginPageAccountTree *page);
 static void gnc_plugin_page_account_tree_cmd_scrub_all (GtkAction *action, GncPluginPageAccountTree *page);
-static void gnc_plugin_page_account_tree_cmd_cascade_color_account (GtkAction *action, GncPluginPageAccountTree *page);
+static void gnc_plugin_page_account_tree_cmd_cascade_account_properties (GtkAction *action, GncPluginPageAccountTree *page);
 
 /* Command callback for new Register Test */
 static void gnc_plugin_page_account_tree_cmd_open2_account (GtkAction *action, GncPluginPageAccountTree *page);
@@ -230,9 +230,9 @@ static GtkActionEntry gnc_plugin_page_account_tree_actions [] =
         G_CALLBACK (gnc_plugin_page_account_tree_cmd_delete_account)
     },
     {
-        "EditColorCascadeAccountAction", NULL, N_("_Cascade Account Color..."), NULL,
-        N_("Cascade selected account color"),
-        G_CALLBACK (gnc_plugin_page_account_tree_cmd_cascade_color_account)
+        "EditCascadeAccountAction", NULL, N_("_Cascade Account Properties..."), NULL,
+        N_("Cascade selected properties for account"),
+        G_CALLBACK (gnc_plugin_page_account_tree_cmd_cascade_account_properties)
     },
     {
         "EditFindAccountAction", "edit-find", N_("F_ind Account"), "<primary>i",
@@ -1072,7 +1072,7 @@ gnc_plugin_page_account_tree_selection_changed_cb (GtkTreeSelection *selection,
     g_object_set (G_OBJECT(action), "sensitive",
                   is_readwrite && sensitive && subaccounts, NULL);
 
-    action = gtk_action_group_get_action (action_group, "EditColorCascadeAccountAction");
+    action = gtk_action_group_get_action (action_group, "EditCascadeAccountAction");
     g_object_set (G_OBJECT(action), "sensitive", subaccounts, NULL);
 
     gnc_plugin_update_actions (action_group, actions_requiring_account_rw,
@@ -1190,7 +1190,7 @@ gnc_plugin_page_account_tree_cmd_find_account_popup (GtkAction *action, GncPlugi
 }
 
 static void
-gnc_plugin_page_account_tree_cmd_cascade_color_account (GtkAction *action, GncPluginPageAccountTree *page)
+gnc_plugin_page_account_tree_cmd_cascade_account_properties (GtkAction *action, GncPluginPageAccountTree *page)
 {
     Account *account = NULL;
     GtkWidget *window;
@@ -1199,10 +1199,10 @@ gnc_plugin_page_account_tree_cmd_cascade_color_account (GtkAction *action, GncPl
 
     account = gnc_plugin_page_account_tree_get_current_account (page);
 
-    window = gnc_plugin_page_get_window(GNC_PLUGIN_PAGE(page));
+    window = gnc_plugin_page_get_window (GNC_PLUGIN_PAGE(page));
 
     if (account != NULL)
-        gnc_account_cascade_color_dialog (window, account);
+        gnc_account_cascade_properties_dialog (window, account);
 
     LEAVE(" ");
 }
diff --git a/gnucash/gtkbuilder/dialog-account.glade b/gnucash/gtkbuilder/dialog-account.glade
index ccead50e0..29b05bff2 100644
--- a/gnucash/gtkbuilder/dialog-account.glade
+++ b/gnucash/gtkbuilder/dialog-account.glade
@@ -2,9 +2,9 @@
 <!-- Generated with glade 3.22.1 -->
 <interface>
   <requires lib="gtk+" version="3.10"/>
-  <object class="GtkDialog" id="account_cascade_color_dialog">
+  <object class="GtkDialog" id="account_cascade_dialog">
     <property name="can_focus">False</property>
-    <property name="title" translatable="yes">Cascade Account Color</property>
+    <property name="title" translatable="yes">Cascade Account Values</property>
     <property name="type_hint">dialog</property>
     <child>
       <placeholder/>
@@ -56,33 +56,115 @@
           </packing>
         </child>
         <child>
-          <object class="GtkBox">
+          <object class="GtkGrid">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <property name="orientation">vertical</property>
-            <property name="spacing">12</property>
+            <property name="row_spacing">6</property>
+            <property name="column_spacing">6</property>
             <child>
-              <object class="GtkLabel" id="color_label">
+              <object class="GtkBox">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
-                <property name="wrap">True</property>
+                <property name="halign">start</property>
+                <property name="spacing">3</property>
+                <child>
+                  <object class="GtkLabel">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="halign">end</property>
+                    <property name="label" translatable="yes">Enable Cascading Account Color</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkCheckButton" id="enable_cascade_color">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="draw_indicator">True</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
               </object>
               <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">0</property>
+                <property name="left_attach">0</property>
+                <property name="top_attach">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkSeparator">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">3</property>
               </packing>
             </child>
             <child>
               <object class="GtkBox">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
-                <property name="halign">center</property>
+                <property name="spacing">3</property>
+                <child>
+                  <object class="GtkLabel">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="label" translatable="yes">Enable Cascading Account Placeholder</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
                 <child>
-                  <object class="GtkColorButton" id="color_button">
+                  <object class="GtkCheckButton" id="enable_cascade_placeholder">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
-                    <property name="receives_default">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="draw_indicator">True</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">4</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkSeparator">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">6</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkBox">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="spacing">3</property>
+                <child>
+                  <object class="GtkLabel">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="label" translatable="yes">Enable Cascading Account Hidden</property>
                   </object>
                   <packing>
                     <property name="expand">False</property>
@@ -91,11 +173,11 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkButton" id="color_button_default">
-                    <property name="label" translatable="yes">Default</property>
+                  <object class="GtkCheckButton" id="enable_cascade_hidden">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
-                    <property name="receives_default">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="draw_indicator">True</property>
                   </object>
                   <packing>
                     <property name="expand">False</property>
@@ -105,44 +187,199 @@
                 </child>
               </object>
               <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">1</property>
+                <property name="left_attach">0</property>
+                <property name="top_attach">7</property>
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="sub_label">
+              <object class="GtkLabel">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
-                <property name="label" translatable="yes">If any account has an existing color it will not be replaced unless the following is ticked.</property>
-                <property name="wrap">True</property>
+                <property name="label" translatable="yes">Enable the sections to Cascade</property>
+                <attributes>
+                  <attribute name="underline" value="True"/>
+                </attributes>
               </object>
               <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">2</property>
+                <property name="left_attach">0</property>
+                <property name="top_attach">0</property>
               </packing>
             </child>
             <child>
-              <object class="GtkCheckButton" id="replace_check">
-                <property name="label" translatable="yes">Replace any existing account colors</property>
+              <object class="GtkBox" id="color_box">
                 <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">False</property>
-                <property name="halign">center</property>
-                <property name="draw_indicator">True</property>
+                <property name="sensitive">False</property>
+                <property name="can_focus">False</property>
+                <property name="orientation">vertical</property>
+                <property name="spacing">3</property>
+                <child>
+                  <object class="GtkLabel" id="color_label">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="wrap">True</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkBox" id="color_button_box">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="halign">center</property>
+                    <child>
+                      <object class="GtkColorButton" id="color_button">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">True</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkButton" id="color_button_default">
+                        <property name="label" translatable="yes">Default</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">True</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="sub_label">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="label" translatable="yes">If any account has an existing color it will not be replaced unless the following is ticked.</property>
+                    <property name="wrap">True</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">2</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkCheckButton" id="replace_check">
+                    <property name="label" translatable="yes">Replace any existing account colors</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="halign">center</property>
+                    <property name="draw_indicator">True</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">3</property>
+                  </packing>
+                </child>
               </object>
               <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">3</property>
+                <property name="left_attach">0</property>
+                <property name="top_attach">2</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkBox" id="placeholder_box">
+                <property name="visible">True</property>
+                <property name="sensitive">False</property>
+                <property name="can_focus">False</property>
+                <property name="orientation">vertical</property>
+                <property name="spacing">3</property>
+                <child>
+                  <object class="GtkLabel" id="placeholder_label">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="wrap">True</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkCheckButton" id="placeholder_check_button">
+                    <property name="label" translatable="yes">Placeholder</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="halign">center</property>
+                    <property name="draw_indicator">True</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">5</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkBox" id="hidden_box">
+                <property name="visible">True</property>
+                <property name="sensitive">False</property>
+                <property name="can_focus">False</property>
+                <property name="orientation">vertical</property>
+                <property name="spacing">3</property>
+                <child>
+                  <object class="GtkLabel" id="hidden_label">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="wrap">True</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkCheckButton" id="hidden_check_button">
+                    <property name="label" translatable="yes">Hidden</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="halign">center</property>
+                    <property name="draw_indicator">True</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">8</property>
               </packing>
             </child>
           </object>
           <packing>
             <property name="expand">False</property>
             <property name="fill">True</property>
-            <property name="position">1</property>
+            <property name="position">0</property>
           </packing>
         </child>
       </object>
diff --git a/gnucash/ui/gnc-plugin-page-account-tree-ui.xml b/gnucash/ui/gnc-plugin-page-account-tree-ui.xml
index 2584cceed..a6c16c74e 100644
--- a/gnucash/ui/gnc-plugin-page-account-tree-ui.xml
+++ b/gnucash/ui/gnc-plugin-page-account-tree-ui.xml
@@ -5,7 +5,7 @@
         <menuitem name="EditEditAccount" action="EditEditAccountAction"/>
         <menuitem name="EditDeleteAccount" action="EditDeleteAccountAction"/>
         <menuitem name="EditAccountFindAccount" action="EditFindAccountAction"/>
-        <menuitem name="AccountColorCascade" action="EditColorCascadeAccountAction"/>
+        <menuitem name="AccountCascadeProperty" action="EditCascadeAccountAction"/>
         <menuitem name="EditRenumberSubaccounts" action="EditRenumberSubaccountsAction"/>
         <separator name="EditSep2"/>
         <menuitem name="FileOpenAccount" action="FileOpenAccountAction"/>
@@ -46,7 +46,7 @@
       <menuitem name="AccountOpenAccount" action="FileOpenAccountAction"/>
       <menuitem name="AccountOpenSubaccounts" action="FileOpenSubaccountsAction"/>
       <menuitem name="AccountEditAccount" action="EditEditAccountAction"/>
-      <menuitem name="AccountColorCascade" action="EditColorCascadeAccountAction"/>
+      <menuitem name="AccountCascadeProperty" action="EditCascadeAccountAction"/>
       <menuitem name="AccountFindAccountPopup" action="EditFindAccountPopupAction"/>
       <separator name="AccountSep1"/>
       <menuitem name="AccountReconcile" action="ActionsReconcileAction"/>

commit ad4c150db99a745352b8eca5f95253e4d75d30df
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Mon Feb 17 11:48:19 2020 +0000

    Bug 797485 - Show account hidden column on CoA.
    
    To make it easier to change the hidden property on multiple accounts,
    a new column can be added to the CoA to toggle the account hidden
    property. This only makes sense if the 'View->Filter By...' other tab
    has been accessed to enable showing of hidden accounts first.

diff --git a/gnucash/gnome-utils/gnc-tree-model-account.c b/gnucash/gnome-utils/gnc-tree-model-account.c
index c0044b6d9..9f44690e2 100644
--- a/gnucash/gnome-utils/gnc-tree-model-account.c
+++ b/gnucash/gnome-utils/gnc-tree-model-account.c
@@ -418,6 +418,7 @@ gnc_tree_model_account_get_column_type (GtkTreeModel *tree_model, int index)
     case GNC_TREE_MODEL_ACCOUNT_COL_COLOR_TOTAL_PERIOD:
         return G_TYPE_STRING;
 
+    case GNC_TREE_MODEL_ACCOUNT_COL_HIDDEN:
     case GNC_TREE_MODEL_ACCOUNT_COL_PLACEHOLDER:
         return G_TYPE_BOOLEAN;
 
@@ -944,6 +945,11 @@ gnc_tree_model_account_get_value (GtkTreeModel *tree_model,
         g_value_set_string (value, xaccAccountGetLastNum (account));
         break;
 
+    case GNC_TREE_MODEL_ACCOUNT_COL_HIDDEN:
+        g_value_init (value, G_TYPE_BOOLEAN);
+        g_value_set_boolean (value, xaccAccountGetHidden (account));
+        break;
+
     case GNC_TREE_MODEL_ACCOUNT_COL_PLACEHOLDER:
         g_value_init (value, G_TYPE_BOOLEAN);
         g_value_set_boolean (value, xaccAccountGetPlaceholder (account));
diff --git a/gnucash/gnome-utils/gnc-tree-model-account.h b/gnucash/gnome-utils/gnc-tree-model-account.h
index 8d8337579..17fd76d53 100644
--- a/gnucash/gnome-utils/gnc-tree-model-account.h
+++ b/gnucash/gnome-utils/gnc-tree-model-account.h
@@ -79,6 +79,7 @@ typedef enum
     GNC_TREE_MODEL_ACCOUNT_COL_NOTES,
     GNC_TREE_MODEL_ACCOUNT_COL_TAX_INFO,
     GNC_TREE_MODEL_ACCOUNT_COL_TAX_INFO_SUB_ACCT,
+    GNC_TREE_MODEL_ACCOUNT_COL_HIDDEN,
     GNC_TREE_MODEL_ACCOUNT_COL_PLACEHOLDER,
 
     GNC_TREE_MODEL_ACCOUNT_COL_LAST_VISIBLE = GNC_TREE_MODEL_ACCOUNT_COL_PLACEHOLDER,
diff --git a/gnucash/gnome-utils/gnc-tree-view-account.c b/gnucash/gnome-utils/gnc-tree-view-account.c
index 848b800f1..6fabac1c0 100644
--- a/gnucash/gnome-utils/gnc-tree-view-account.c
+++ b/gnucash/gnome-utils/gnc-tree-view-account.c
@@ -207,6 +207,31 @@ gnc_tree_view_account_finalize (GObject *object)
 /************************************************************
  *                        Callbacks                         *
  ************************************************************/
+static void
+gnc_tree_view_account_hidden_toggled (GtkCellRendererToggle *cell,
+                                      const gchar *s_path_str,
+                                      gpointer user_data)
+{
+    GncTreeViewAccount *tree_view;
+    GtkTreePath *s_path;
+    Account *account;
+    gboolean hidden;
+
+    /* Change the requested account */
+    tree_view = user_data;
+    s_path = gtk_tree_path_new_from_string (s_path_str);
+    account = gnc_tree_view_account_get_account_from_path (tree_view, s_path);
+    if (account)
+    {
+        hidden = !gtk_cell_renderer_toggle_get_active (cell); // hasn't changed yet.
+        xaccAccountSetHidden (account, hidden);
+    }
+
+    /* Clean up */
+    gtk_tree_path_free (s_path);
+}
+
+
 static void
 gnc_tree_view_account_placeholder_toggled (GtkCellRendererToggle *cell,
         const gchar *s_path_str,
@@ -423,6 +448,29 @@ sort_by_total_value (GtkTreeModel *f_model,
                               f_model, f_iter_a, f_iter_b, user_data);
 }
 
+static gint
+sort_by_hidden (GtkTreeModel *f_model,
+                GtkTreeIter *f_iter_a,
+                GtkTreeIter *f_iter_b,
+                gpointer user_data)
+{
+    const Account *account_a, *account_b;
+    gboolean flag_a, flag_b;
+
+    /* Find the accounts */
+    sort_cb_setup (f_model, f_iter_a, f_iter_b, &account_a, &account_b);
+
+    /* Get the placeholder flags. */
+    flag_a = xaccAccountGetHidden (account_a);
+    flag_b = xaccAccountGetHidden (account_b);
+
+    if (flag_a > flag_b)
+        return -1;
+    else if (flag_a < flag_b)
+        return 1;
+    return xaccAccountOrder (account_a, account_b);
+}
+
 static gint
 sort_by_placeholder (GtkTreeModel *f_model,
                      GtkTreeIter *f_iter_a,
@@ -902,6 +950,14 @@ gnc_tree_view_account_new_with_root (Account *root, gboolean show_root)
                                             GTK_TREE_VIEW(view),
                                             NULL);
 
+    gnc_tree_view_add_toggle_column (view, _("Hidden"),
+                                     C_("Column header for 'Hidden'", "H"),
+                                     "hidden",
+                                     GNC_TREE_MODEL_ACCOUNT_COL_HIDDEN,
+                                     GNC_TREE_VIEW_COLUMN_VISIBLE_ALWAYS,
+                                     sort_by_hidden,
+                                     gnc_tree_view_account_hidden_toggled);
+
     gnc_tree_view_add_toggle_column(view, _("Placeholder"),
 				    C_("Column header for 'Placeholder'", "P"),
                                     "placeholder",

commit f2cc1a1c35f877446ec9d80f86b8f5f2cc9f93ae
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Mon Feb 17 11:36:49 2020 +0000

    Realign text in dialog-billterms.glade
    
    Missed changing the alignment of text when you select 'Proximo' and
    change to using a grid widget.

diff --git a/gnucash/gtkbuilder/dialog-billterms.glade b/gnucash/gtkbuilder/dialog-billterms.glade
index 6abd94b6c..ae810f802 100644
--- a/gnucash/gtkbuilder/dialog-billterms.glade
+++ b/gnucash/gtkbuilder/dialog-billterms.glade
@@ -64,6 +64,7 @@
               <object class="GtkGrid">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
+                <property name="hexpand">True</property>
                 <property name="row_spacing">3</property>
                 <property name="column_spacing">5</property>
                 <child>
@@ -112,6 +113,7 @@
                     <property name="has_tooltip">True</property>
                     <property name="tooltip_markup">The percentage discount applied for early payment.</property>
                     <property name="tooltip_text" translatable="yes">The percentage discount applied for early payment.</property>
+                    <property name="hexpand">True</property>
                     <property name="invisible_char">●</property>
                     <property name="primary_icon_activatable">False</property>
                     <property name="secondary_icon_activatable">False</property>
@@ -132,6 +134,7 @@
                     <property name="has_tooltip">True</property>
                     <property name="tooltip_markup">The number of days after the post date during which a discount will be applied for early payment.</property>
                     <property name="tooltip_text" translatable="yes">The number of days after the post date during which a discount will be applied for early payment.</property>
+                    <property name="hexpand">True</property>
                     <property name="invisible_char">●</property>
                     <property name="primary_icon_activatable">False</property>
                     <property name="secondary_icon_activatable">False</property>
@@ -152,6 +155,7 @@
                     <property name="has_tooltip">True</property>
                     <property name="tooltip_markup">The number of days to pay the bill after the post date.</property>
                     <property name="tooltip_text" translatable="yes">The number of days to pay the bill after the post date.</property>
+                    <property name="hexpand">True</property>
                     <property name="invisible_char">●</property>
                     <property name="primary_icon_activatable">False</property>
                     <property name="secondary_icon_activatable">False</property>
@@ -195,169 +199,157 @@
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <child>
-                  <object class="GtkBox" id="vbox11">
+                  <object class="GtkGrid">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="orientation">vertical</property>
-                    <property name="homogeneous">True</property>
+                    <property name="hexpand">True</property>
+                    <property name="row_spacing">3</property>
+                    <property name="column_spacing">5</property>
                     <child>
                       <object class="GtkLabel" id="label7">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="label" translatable="yes">Due Day: </property>
+                        <property name="halign">end</property>
+                        <property name="label" translatable="yes">Due Day</property>
                         <property name="justify">right</property>
                       </object>
                       <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">0</property>
+                        <property name="left_attach">0</property>
+                        <property name="top_attach">0</property>
                       </packing>
                     </child>
                     <child>
                       <object class="GtkLabel" id="label8">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="label" translatable="yes">Discount Day: </property>
+                        <property name="halign">end</property>
+                        <property name="label" translatable="yes">Discount Day</property>
                         <property name="justify">right</property>
                       </object>
                       <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">1</property>
+                        <property name="left_attach">0</property>
+                        <property name="top_attach">1</property>
                       </packing>
                     </child>
                     <child>
                       <object class="GtkLabel" id="label19">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="label" translatable="yes">Discount %: </property>
+                        <property name="halign">end</property>
+                        <property name="label" translatable="yes">Discount %</property>
                         <property name="justify">right</property>
                       </object>
                       <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">2</property>
+                        <property name="left_attach">0</property>
+                        <property name="top_attach">2</property>
                       </packing>
                     </child>
                     <child>
                       <object class="GtkLabel" id="label20">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="label" translatable="yes">Cutoff Day: </property>
+                        <property name="halign">end</property>
+                        <property name="label" translatable="yes">Cutoff Day</property>
                         <property name="justify">right</property>
                       </object>
                       <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">3</property>
+                        <property name="left_attach">0</property>
+                        <property name="top_attach">3</property>
                       </packing>
                     </child>
-                  </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">True</property>
-                    <property name="position">0</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkBox" id="vbox12">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="orientation">vertical</property>
-                    <property name="homogeneous">True</property>
                     <child>
-                      <object class="GtkSpinButton" id="prox:due_day">
+                      <object class="GtkSpinButton" id="prox:cutoff_day">
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="has_tooltip">True</property>
-                        <property name="tooltip_markup">The day of the month bills are due</property>
-                        <property name="tooltip_text" translatable="yes">The day of the month bills are due</property>
+                        <property name="tooltip_markup">The cutoff day for applying bills to the next month. After the cutoff, bills are applied to the following month. Negative values count backwards from the end of the month.</property>
+                        <property name="tooltip_text" translatable="yes">The cutoff day for applying bills to the next month. After the cutoff, bills are applied to the following month. Negative values count backwards from the end of the month.</property>
+                        <property name="hexpand">True</property>
                         <property name="invisible_char">●</property>
                         <property name="primary_icon_activatable">False</property>
                         <property name="secondary_icon_activatable">False</property>
-                        <property name="adjustment">pdue_day_adj</property>
+                        <property name="adjustment">pcutoff_day_adj</property>
                         <property name="climb_rate">1</property>
                         <property name="snap_to_ticks">True</property>
                         <property name="numeric">True</property>
                         <property name="wrap">True</property>
                       </object>
                       <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">0</property>
+                        <property name="left_attach">1</property>
+                        <property name="top_attach">3</property>
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkSpinButton" id="prox:discount_day">
+                      <object class="GtkSpinButton" id="prox:discount">
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="has_tooltip">True</property>
-                        <property name="tooltip_markup">The last day of the month for the early payment discount.</property>
-                        <property name="tooltip_text" translatable="yes">The last day of the month for the early payment discount.</property>
+                        <property name="tooltip_markup">The discount percentage applied if paid early.</property>
+                        <property name="tooltip_text" translatable="yes">The discount percentage applied if paid early.</property>
+                        <property name="hexpand">True</property>
                         <property name="invisible_char">●</property>
                         <property name="primary_icon_activatable">False</property>
                         <property name="secondary_icon_activatable">False</property>
-                        <property name="adjustment">pdiscount_day_adj</property>
+                        <property name="adjustment">pdiscount_adj</property>
                         <property name="climb_rate">1</property>
+                        <property name="digits">2</property>
                         <property name="snap_to_ticks">True</property>
                         <property name="numeric">True</property>
-                        <property name="wrap">True</property>
                       </object>
                       <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">1</property>
+                        <property name="left_attach">1</property>
+                        <property name="top_attach">2</property>
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkSpinButton" id="prox:discount">
+                      <object class="GtkSpinButton" id="prox:discount_day">
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="has_tooltip">True</property>
-                        <property name="tooltip_markup">The discount percentage applied if paid early.</property>
-                        <property name="tooltip_text" translatable="yes">The discount percentage applied if paid early.</property>
+                        <property name="tooltip_markup">The last day of the month for the early payment discount.</property>
+                        <property name="tooltip_text" translatable="yes">The last day of the month for the early payment discount.</property>
+                        <property name="hexpand">True</property>
                         <property name="invisible_char">●</property>
                         <property name="primary_icon_activatable">False</property>
                         <property name="secondary_icon_activatable">False</property>
-                        <property name="adjustment">pdiscount_adj</property>
+                        <property name="adjustment">pdiscount_day_adj</property>
                         <property name="climb_rate">1</property>
-                        <property name="digits">2</property>
                         <property name="snap_to_ticks">True</property>
                         <property name="numeric">True</property>
+                        <property name="wrap">True</property>
                       </object>
                       <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">2</property>
+                        <property name="left_attach">1</property>
+                        <property name="top_attach">1</property>
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkSpinButton" id="prox:cutoff_day">
+                      <object class="GtkSpinButton" id="prox:due_day">
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="has_tooltip">True</property>
-                        <property name="tooltip_markup">The cutoff day for applying bills to the next month. After the cutoff, bills are applied to the following month. Negative values count backwards from the end of the month.</property>
-                        <property name="tooltip_text" translatable="yes">The cutoff day for applying bills to the next month. After the cutoff, bills are applied to the following month. Negative values count backwards from the end of the month.</property>
+                        <property name="tooltip_markup">The day of the month bills are due</property>
+                        <property name="tooltip_text" translatable="yes">The day of the month bills are due</property>
+                        <property name="hexpand">True</property>
                         <property name="invisible_char">●</property>
                         <property name="primary_icon_activatable">False</property>
                         <property name="secondary_icon_activatable">False</property>
-                        <property name="adjustment">pcutoff_day_adj</property>
+                        <property name="adjustment">pdue_day_adj</property>
                         <property name="climb_rate">1</property>
                         <property name="snap_to_ticks">True</property>
                         <property name="numeric">True</property>
                         <property name="wrap">True</property>
                       </object>
                       <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">3</property>
+                        <property name="left_attach">1</property>
+                        <property name="top_attach">0</property>
                       </packing>
                     </child>
                   </object>
                   <packing>
                     <property name="expand">False</property>
                     <property name="fill">True</property>
-                    <property name="position">1</property>
+                    <property name="position">2</property>
                   </packing>
                 </child>
               </object>



Summary of changes:
 gnucash/gnome-utils/dialog-account.c            | 124 ++++++--
 gnucash/gnome-utils/dialog-account.h            |   2 +-
 gnucash/gnome-utils/dialog-utils.c              |  15 +-
 gnucash/gnome-utils/dialog-utils.h              |   5 +-
 gnucash/gnome-utils/gnc-tree-model-account.c    |  16 +-
 gnucash/gnome-utils/gnc-tree-model-account.h    |   1 +
 gnucash/gnome-utils/gnc-tree-view-account.c     |  56 ++++
 gnucash/gnome-utils/window-main-summarybar.c    |   2 +-
 gnucash/gnome/gnc-budget-view.c                 | 359 +++++++++++++++---------
 gnucash/gnome/gnc-budget-view.h                 |  22 +-
 gnucash/gnome/gnc-plugin-page-account-tree.c    |  16 +-
 gnucash/gnome/gnc-plugin-page-budget.c          |  25 ++
 gnucash/gnucash-310.css                         |   4 +-
 gnucash/gnucash-320.css                         |   4 +-
 gnucash/gtkbuilder/dialog-account.glade         | 307 +++++++++++++++++---
 gnucash/gtkbuilder/dialog-billterms.glade       | 118 ++++----
 gnucash/gtkbuilder/gnc-plugin-page-budget.glade |  56 +++-
 gnucash/register/register-gnome/gnucash-sheet.c |   2 +-
 gnucash/ui/gnc-plugin-page-account-tree-ui.xml  |   4 +-
 19 files changed, 841 insertions(+), 297 deletions(-)



More information about the gnucash-changes mailing list