gtk+ r21031 - in trunk: . gtk
- From: mitch svn gnome org
- To: svn-commits-list gnome org
- Subject: gtk+ r21031 - in trunk: . gtk
- Date: Thu, 7 Aug 2008 10:07:50 +0000 (UTC)
Author: mitch
Date: Thu Aug 7 10:07:49 2008
New Revision: 21031
URL: http://svn.gnome.org/viewvc/gtk+?rev=21031&view=rev
Log:
2008-08-07 Michael Natterer <mitch imendio com>
* gtk/gtkicontheme.c (apply_emblems): move variables to local
scopes, fix indentation and silence bogus warning about using
uninitialized variables.
Modified:
trunk/ChangeLog
trunk/gtk/gtkicontheme.c
Modified: trunk/gtk/gtkicontheme.c
==============================================================================
--- trunk/gtk/gtkicontheme.c (original)
+++ trunk/gtk/gtkicontheme.c Thu Aug 7 10:07:49 2008
@@ -2776,9 +2776,8 @@
static void
apply_emblems (GtkIconInfo *info)
{
- gint pos, w, h, ew, eh, x, y;
- gdouble scale;
- GdkPixbuf *icon, *emblem;
+ GdkPixbuf *icon;
+ gint w, h, pos;
GSList *l;
icon = info->pixbuf;
@@ -2788,41 +2787,48 @@
for (l = info->emblem_infos, pos = 0; l; l = l->next, pos++)
{
GtkIconInfo *emblem_info = l->data;
- if (icon_info_ensure_scale_and_pixbuf (emblem_info, FALSE))
+
+ if (icon_info_ensure_scale_and_pixbuf (emblem_info, FALSE))
{
- emblem = emblem_info->pixbuf;
- ew = gdk_pixbuf_get_width (emblem);
- eh = gdk_pixbuf_get_height (emblem);
- if (ew >= w)
- {
- scale = 0.75;
- ew = ew * 0.75;
- eh = eh * 0.75;
- }
- else
- scale = 1.0;
- switch (pos % 4)
- {
- case 0:
- x = w - ew;
- y = h - eh;
- break;
- case 1:
- x = w - ew;
- y = 0;
- break;
- case 2:
- x = 0;
- y = h - eh;
- break;
- case 3:
- x = 0;
- y = 0;
- break;
- }
- gdk_pixbuf_composite (emblem, icon, x, y, ew, eh, x, y,
+ GdkPixbuf *emblem = emblem_info->pixbuf;
+ gint ew, eh;
+ gint x = 0, y = 0; /* silence compiler */
+ gdouble scale;
+
+ ew = gdk_pixbuf_get_width (emblem);
+ eh = gdk_pixbuf_get_height (emblem);
+ if (ew >= w)
+ {
+ scale = 0.75;
+ ew = ew * 0.75;
+ eh = eh * 0.75;
+ }
+ else
+ scale = 1.0;
+
+ switch (pos % 4)
+ {
+ case 0:
+ x = w - ew;
+ y = h - eh;
+ break;
+ case 1:
+ x = w - ew;
+ y = 0;
+ break;
+ case 2:
+ x = 0;
+ y = h - eh;
+ break;
+ case 3:
+ x = 0;
+ y = 0;
+ break;
+ }
+
+ gdk_pixbuf_composite (emblem, icon, x, y, ew, eh, x, y,
scale, scale, GDK_INTERP_BILINEAR, 255);
- }
+ }
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]