[Xfce4-commits] [xfce/exo] 02/21: exo-cell-renderer-icon: Draw icons using cairo

noreply at xfce.org noreply at xfce.org
Tue Jul 12 04:07:54 CEST 2016


This is an automated email from the git hooks/post-receive script.

bluesabre pushed a commit to branch master
in repository xfce/exo.

commit 845ba3e2e48b6f6ec9cd119d6c0bf663908a4d4c
Author: Jonas Kümmerlin <rgcjonas at gmail.com>
Date:   Thu Aug 6 10:21:37 2015 +0200

    exo-cell-renderer-icon: Draw icons using cairo
---
 exo/exo-cell-renderer-icon.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/exo/exo-cell-renderer-icon.c b/exo/exo-cell-renderer-icon.c
index db8884a..e8681b8 100644
--- a/exo/exo-cell-renderer-icon.c
+++ b/exo/exo-cell-renderer-icon.c
@@ -388,6 +388,7 @@ exo_cell_renderer_icon_render (GtkCellRenderer     *renderer,
   gint                             *icon_sizes;
   gint                              icon_size;
   gint                              n;
+  cairo_t                          *cr;
 
   /* verify that we have an icon */
   if (G_UNLIKELY (priv->icon == NULL && priv->gicon == NULL))
@@ -540,10 +541,11 @@ exo_cell_renderer_icon_render (GtkCellRenderer     *renderer,
         }
 
       /* render the invalid parts of the icon */
-      gdk_draw_pixbuf (window, gtk_widget_get_style (widget)->black_gc, icon,
-                       draw_area.x - icon_area.x, draw_area.y - icon_area.y,
-                       draw_area.x, draw_area.y, draw_area.width, draw_area.height,
-                       GDK_RGB_DITHER_NORMAL, 0, 0);
+      cr = gdk_cairo_create (window);
+      gdk_cairo_set_source_pixbuf (cr, icon, icon_area.x, icon_area.y);
+      cairo_rectangle (cr, draw_area.x, draw_area.y, draw_area.width, draw_area.height);
+      cairo_fill (cr);
+      cairo_destroy (cr);
     }
 
   /* release the file's icon */

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list