[gnome-clocks] widgets: use a Cairo.Surface() to render location icon
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-clocks] widgets: use a Cairo.Surface() to render location icon
- Date: Tue, 26 May 2015 16:58:28 +0000 (UTC)
commit 7f8b3c163f6efdd3c54286793ef9bf542bd32960
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 87d89ca..849a32d 100644
--- a/src/widgets.vala
+++ b/src/widgets.vala
@@ -112,11 +112,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]