[gnome-calendar] event-widget: fix icons scaling, made 16x always.
- From: Erick Pérez Castellanos <erickpc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] event-widget: fix icons scaling, made 16x always.
- Date: Thu, 4 Dec 2014 22:42:54 +0000 (UTC)
commit 746864e7bca08524332883021c0b69a5726b54b0
Author: Erick Pérez Castellanos <erick red gmail com>
Date: Mon Nov 10 16:25:27 2014 -0500
event-widget: fix icons scaling, made 16x always.
Previously the scaling was made to the size of the text layout which
caused a blurriness of the icon. Making its size a multiple of 16 made
the icon preserve its sharpness.
src/gcal-event-widget.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/src/gcal-event-widget.c b/src/gcal-event-widget.c
index 45e8fa3..9591002 100644
--- a/src/gcal-event-widget.c
+++ b/src/gcal-event-widget.c
@@ -630,11 +630,13 @@ gcal_event_widget_draw (GtkWidget *widget,
GtkIconInfo *icon_info;
GdkPixbuf *pixbuf;
gboolean was_symbolic;
+ gint multiplier;
+ multiplier = icon_size / 16;
icon_theme = gtk_icon_theme_get_default ();
icon_info = gtk_icon_theme_lookup_icon (icon_theme,
"alarm-symbolic",
- icon_size,
+ 16 * multiplier,
0);
pixbuf = gtk_icon_info_load_symbolic_for_context (icon_info,
context,
@@ -644,7 +646,7 @@ gcal_event_widget_draw (GtkWidget *widget,
gdk_cairo_set_source_pixbuf (cr,
pixbuf,
x + padding.left,
- y + padding.top);
+ y + padding.top + ((icon_size - (16 * multiplier)) / 2));
g_object_unref (pixbuf);
cairo_paint (cr);
}
@@ -656,11 +658,13 @@ gcal_event_widget_draw (GtkWidget *widget,
GtkIconInfo *icon_info;
GdkPixbuf *pixbuf;
gboolean was_symbolic;
+ gint multiplier;
+ multiplier = icon_size / 16;
icon_theme = gtk_icon_theme_get_default ();
icon_info = gtk_icon_theme_lookup_icon (icon_theme,
"changes-prevent-symbolic",
- icon_size,
+ 16 * multiplier,
0);
pixbuf = gtk_icon_info_load_symbolic_for_context (icon_info,
context,
@@ -670,7 +674,7 @@ gcal_event_widget_draw (GtkWidget *widget,
gdk_cairo_set_source_pixbuf (cr,
pixbuf,
width - right_gap,
- y + padding.top);
+ y + padding.top + ((icon_size - (16 * multiplier)) / 2));
g_object_unref (pixbuf);
cairo_paint (cr);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]