[gimp] plug-ins: don't use GtkStyle in ifs-compose, it's deprecated



commit b347cc73a1b3e6db066d27670d79dd4ab658016f
Author: Michael Natterer <mitch gimp org>
Date:   Sun Jul 21 20:36:01 2019 +0200

    plug-ins: don't use GtkStyle in ifs-compose, it's deprecated

 plug-ins/ifs-compose/ifs-compose-utils.c |  4 ++--
 plug-ins/ifs-compose/ifs-compose.c       | 21 +++++++++++----------
 plug-ins/ifs-compose/ifs-compose.h       |  2 +-
 3 files changed, 14 insertions(+), 13 deletions(-)
---
diff --git a/plug-ins/ifs-compose/ifs-compose-utils.c b/plug-ins/ifs-compose/ifs-compose-utils.c
index 32c05cc9da..49f3cc4b36 100644
--- a/plug-ins/ifs-compose/ifs-compose-utils.c
+++ b/plug-ins/ifs-compose/ifs-compose-utils.c
@@ -718,7 +718,7 @@ aff_element_draw (AffElement  *elem,
                   gint         width,
                   gint         height,
                   cairo_t     *cr,
-                  GdkColor    *color,
+                  GdkRGBA     *color,
                   PangoLayout *layout)
 {
   PangoRectangle rect;
@@ -727,7 +727,7 @@ aff_element_draw (AffElement  *elem,
   pango_layout_set_text (layout, elem->name, -1);
   pango_layout_get_pixel_extents (layout, NULL, &rect);
 
-  gdk_cairo_set_source_color (cr, color);
+  gdk_cairo_set_source_rgba (cr, color);
 
   cairo_move_to (cr,
                  elem->v.x * width - rect.width  / 2,
diff --git a/plug-ins/ifs-compose/ifs-compose.c b/plug-ins/ifs-compose/ifs-compose.c
index 6b5e934e5e..c7e4458558 100644
--- a/plug-ins/ifs-compose/ifs-compose.c
+++ b/plug-ins/ifs-compose/ifs-compose.c
@@ -1476,19 +1476,20 @@ static gboolean
 design_area_draw (GtkWidget *widget,
                   cairo_t   *cr)
 {
-  GtkStyle      *style = gtk_widget_get_style (widget);
-  GtkStateType   state = gtk_widget_get_state (widget);
-  cairo_t       *design_cr;
-  GtkAllocation  allocation;
-  PangoLayout   *layout;
-  gint           i;
-  gint           cx, cy;
+  GtkStyleContext *style = gtk_widget_get_style_context (widget);
+  cairo_t         *design_cr;
+  GtkAllocation    allocation;
+  PangoLayout     *layout;
+  GdkRGBA          black = { 0.0, 0.0, 0.0, 1.0 };
+  GdkRGBA          white = { 1.0, 1.0, 1.0, 1.0 };
+  gint             i;
+  gint             cx, cy;
 
   gtk_widget_get_allocation (widget, &allocation);
 
   design_cr = cairo_create (ifsDesign->surface);
 
-  gdk_cairo_set_source_color (design_cr, &style->bg[state]);
+  gdk_cairo_set_source_rgba (design_cr, &white);
   cairo_paint (design_cr);
 
   cairo_set_line_join (design_cr, CAIRO_LINE_JOIN_ROUND);
@@ -1506,7 +1507,7 @@ design_area_draw (GtkWidget *widget,
   cairo_move_to (design_cr, cx, cy - 10);
   cairo_line_to (design_cr, cx, cy + 10);
 
-  gdk_cairo_set_source_color (design_cr, &style->fg[state]);
+  gdk_cairo_set_source_rgba (design_cr, &black);
   cairo_set_line_width (design_cr, 1.0);
   cairo_stroke (design_cr);
 
@@ -1518,7 +1519,7 @@ design_area_draw (GtkWidget *widget,
                         allocation.width,
                         allocation.height,
                         design_cr,
-                        &style->fg[state],
+                        &black,
                         layout);
     }
 
diff --git a/plug-ins/ifs-compose/ifs-compose.h b/plug-ins/ifs-compose/ifs-compose.h
index 28b9a3b472..7b01675d35 100644
--- a/plug-ins/ifs-compose/ifs-compose.h
+++ b/plug-ins/ifs-compose/ifs-compose.h
@@ -156,7 +156,7 @@ void        aff_element_draw                 (AffElement  *elem,
                                               gint         width,
                                               gint         height,
                                               cairo_t     *cr,
-                                              GdkColor    *color,
+                                              GdkRGBA     *color,
                                               PangoLayout *layout);
 
 


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