[gnome-clocks/gnome-3-14] widgets: use a Cairo.Surface() to render location icon



commit d1e6d10b1b8bf56e1a28e22a0f1d2936910e55a0
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Mon May 25 20:57:03 2015 -0700

    widgets: use a Cairo.Surface() to render location icon
    
    This fixes a blurry icon with hi-dpi displays.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=749871

 src/widgets.vala |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/widgets.vala b/src/widgets.vala
index 647ba43..1bee23a 100644
--- a/src/widgets.vala
+++ b/src/widgets.vala
@@ -108,11 +108,11 @@ private class TitleRenderer : Gtk.CellRendererText {
 
             Gtk.IconTheme icon_theme = Gtk.IconTheme.get_for_screen (Gdk.Screen.get_default ());
             try {
-                Gtk.IconInfo? icon_info = icon_theme.lookup_icon (title_icon, ICON_SIZE, 0);
+                Gtk.IconInfo? icon_info = icon_theme.lookup_icon_for_scale (title_icon, ICON_SIZE, 
widget.scale_factor, 0);
                 assert (icon_info != null);
 
-                Gdk.Pixbuf pixbuf = icon_info.load_icon ();
-                context.render_icon (cr, pixbuf, x, y);
+                Cairo.Surface surface = icon_info.load_surface (widget.get_window ());
+                Gtk.render_icon_surface (context, cr, surface, x, y);
             } catch (Error e) {
                 warning (e.message);
             }


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