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.
This commit is contained in:
Robert Fewell 2020-02-17 13:28:27 +00:00
parent bc14e05027
commit e7cfcb3f70
4 changed files with 16 additions and 10 deletions

View File

@ -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");

View File

@ -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 */

View File

@ -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;

View File

@ -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);
}