[planner: 48/61] charts: Drop usage of gdk_color_white()




commit 2f63a0a02a421490ac6a25700e274b1cbea85418
Author: Mart Raudsepp <leio gentoo org>
Date:   Sun Jan 3 00:08:57 2021 +0200

    charts: Drop usage of gdk_color_white()
    
    Use the equivalent enough code with colormaps support for now.
    GTK3 won't have nor need it with colormaps, but that will be a change
    to be done at the time of the switch to GTK3.
    After this change planner is compiling clean with
    CFLAGS+="-DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"
    on top of GTK2.

 src/planner-gantt-chart.c | 3 ++-
 src/planner-usage-chart.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/planner-gantt-chart.c b/src/planner-gantt-chart.c
index 10eb1051..bd45ef70 100644
--- a/src/planner-gantt-chart.c
+++ b/src/planner-gantt-chart.c
@@ -543,7 +543,8 @@ gantt_chart_realize (GtkWidget *widget)
        /* Set the background to white. */
        style = gtk_style_copy (canvas->style);
        colormap = gtk_widget_get_colormap (canvas);
-       gdk_color_white (colormap, &style->bg[GTK_STATE_NORMAL]);
+       gdk_color_parse ("white", &style->bg[GTK_STATE_NORMAL]);
+       gdk_colormap_alloc_color (colormap, &style->bg[GTK_STATE_NORMAL], FALSE, TRUE);
        gtk_widget_set_style (canvas, style);
        g_object_unref (style);
 
diff --git a/src/planner-usage-chart.c b/src/planner-usage-chart.c
index 983ee643..f46b3dbb 100644
--- a/src/planner-usage-chart.c
+++ b/src/planner-usage-chart.c
@@ -649,7 +649,8 @@ usage_chart_realize (GtkWidget *widget)
        /* Set the background to white. */
        style = gtk_style_copy (canvas->style);
        colormap = gtk_widget_get_colormap (canvas);
-       gdk_color_white (colormap, &style->bg[GTK_STATE_NORMAL]);
+       gdk_color_parse ("white", &style->bg[GTK_STATE_NORMAL]);
+       gdk_colormap_alloc_color (colormap, &style->bg[GTK_STATE_NORMAL], FALSE, TRUE);
        gtk_widget_set_style (canvas, style);
        g_object_unref (style);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]