Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[gtk,gdk-pixbuf] Updated retina icon patches

  • Loading branch information...
commit 59c6fdfa9c3fbaecef644c7f1d1e04884df39f5f 1 parent 26b7233
@mhutch mhutch authored
View
1  packages/gdk-pixbuf.py
@@ -5,6 +5,7 @@ def __init__ (self):
if Package.profile.name == 'darwin':
self.sources.extend ([
'patches/gdk-pixbuf/0001-pixbuf-load-2x-variants-as-pixbuf-gobject-data.patch',
+ 'patches/gdk-pixbuf/0001-pixbuf-Add-getter-setter-for-the-2x-variants.patch',
])
def prep (self):
View
3  packages/gtk+.py
@@ -82,6 +82,9 @@ def __init__ (self):
'patches/gtk/0065-Make-usual-calls-to-get-a-GdkPixbuf-attach-a-2x-vari.patch',
'patches/gtk/0066-cellrendererpixbuf-let-2x-variants-go-through-pixel-.patch',
+ 'patches/gtk/0001-iconfactory-Check-2x-variants-more-closely-before-at.patch',
+ 'patches/gtk/0002-icontheme-Check-2x-variants-more-closely-before-atta.patch',
+
# Bug 702841 - GdkQuartz does not distinguish Eisu, Kana and Space keys on Japanese keyrboard
# https://bugzilla.gnome.org/show_bug.cgi?id=702841
'patches/gtk/bgo702841-fix-kana-eisu-keys.patch',
View
57 packages/patches/gdk-pixbuf/0001-pixbuf-Add-getter-setter-for-the-2x-variants.patch
@@ -0,0 +1,57 @@
+From f6d2db5a0c105785ee6f03717966ef0dbb1421f6 Mon Sep 17 00:00:00 2001
+From: Carlos Garnacho <carlosg@gnome.org>
+Date: Tue, 16 Jul 2013 10:32:11 +0200
+Subject: [PATCH] pixbuf: Add getter/setter for the 2x variants
+
+---
+ gdk-pixbuf/gdk-pixbuf-core.h | 3 +++
+ gdk-pixbuf/gdk-pixbuf.c | 22 ++++++++++++++++++++++
+ 2 files changed, 25 insertions(+)
+
+diff --git a/gdk-pixbuf/gdk-pixbuf-core.h b/gdk-pixbuf/gdk-pixbuf-core.h
+index eb4d0a1..60c4ea3 100644
+--- a/gdk-pixbuf/gdk-pixbuf-core.h
++++ b/gdk-pixbuf/gdk-pixbuf-core.h
+@@ -474,6 +474,9 @@ GdkPixbuf *gdk_pixbuf_apply_embedded_orientation (GdkPixbuf *src);
+ const gchar * gdk_pixbuf_get_option (GdkPixbuf *pixbuf,
+ const gchar *key);
+
++GdkPixbuf * gdk_pixbuf_get_hires_variant (GdkPixbuf *pixbuf);
++void gdk_pixbuf_set_hires_variant (GdkPixbuf *pixbuf,
++ GdkPixbuf *hires);
+
+ G_END_DECLS
+
+diff --git a/gdk-pixbuf/gdk-pixbuf.c b/gdk-pixbuf/gdk-pixbuf.c
+index 0e13f27..d61f2c7 100644
+--- a/gdk-pixbuf/gdk-pixbuf.c
++++ b/gdk-pixbuf/gdk-pixbuf.c
+@@ -990,3 +990,25 @@ gdk_pixbuf_get_property (GObject *object,
+ break;
+ }
+ }
++
++GdkPixbuf *
++gdk_pixbuf_get_hires_variant (GdkPixbuf *pixbuf)
++{
++ g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), NULL);
++
++ return g_object_get_data (G_OBJECT (pixbuf),
++ "gdk-pixbuf-2x-variant");
++}
++
++void
++gdk_pixbuf_set_hires_variant (GdkPixbuf *pixbuf,
++ GdkPixbuf *hires)
++{
++ g_return_if_fail (GDK_IS_PIXBUF (pixbuf));
++ g_return_if_fail (GDK_IS_PIXBUF (hires));
++
++ g_object_set_data_full (G_OBJECT (pixbuf),
++ "gdk-pixbuf-2x-variant",
++ g_object_ref (hires),
++ (GDestroyNotify) g_object_unref);
++}
+--
+1.8.3.2
+
View
43 packages/patches/gtk/0001-iconfactory-Check-2x-variants-more-closely-before-at.patch
@@ -0,0 +1,43 @@
+From f2a12723d60d51cab09bc64468f33c69f54f8eab Mon Sep 17 00:00:00 2001
+From: Carlos Garnacho <carlosg@gnome.org>
+Date: Fri, 12 Jul 2013 14:54:04 +0200
+Subject: [PATCH 1/2] iconfactory: Check 2x variants more closely before
+ attaching
+
+Ensure the 2x variant is actually bigger (fallbacks ensure you
+get either 2x or 1x icons) before attaching it to the returned
+pixbuf.
+---
+ gtk/gtkiconfactory.c | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/gtk/gtkiconfactory.c b/gtk/gtkiconfactory.c
+index b97b38d..291c05e 100644
+--- a/gtk/gtkiconfactory.c
++++ b/gtk/gtkiconfactory.c
+@@ -1740,17 +1740,20 @@ gtk_icon_set_render_icon (GtkIconSet *icon_set,
+ pixbuf = gtk_icon_set_render_icon_internal (icon_set, style, direction,
+ state, size, widget, detail,
+ &scale);
+- if (scale == 1)
++ if (pixbuf && scale == 1)
+ {
+ scale = 2;
+ variant = gtk_icon_set_render_icon_internal (icon_set, style, direction,
+ state, size, widget, detail,
+ &scale);
+- if (variant)
++ if (variant &&
++ gdk_pixbuf_get_width (variant) > gdk_pixbuf_get_width (pixbuf))
+ g_object_set_data_full (G_OBJECT (pixbuf),
+ "gdk-pixbuf-2x-variant",
+ variant,
+ (GDestroyNotify) g_object_unref);
++ else if (variant)
++ g_object_unref (variant);
+ }
+
+ return pixbuf;
+--
+1.8.3.2
+
View
53 packages/patches/gtk/0002-icontheme-Check-2x-variants-more-closely-before-atta.patch
@@ -0,0 +1,53 @@
+From a73c60a6adf9708cdab0f3de3dacd7d9640a3eeb Mon Sep 17 00:00:00 2001
+From: Carlos Garnacho <carlosg@gnome.org>
+Date: Mon, 15 Jul 2013 12:32:51 +0200
+Subject: [PATCH 2/2] icontheme: Check 2x variants more closely before
+ attaching
+
+Ensure the 2x variant is actually bigger (fallbacks ensure you
+get either 2x or 1x icons) before attaching it to the returned
+pixbuf.
+---
+ gtk/gtkicontheme.c | 12 +++++++++---
+ 1 file changed, 9 insertions(+), 3 deletions(-)
+
+diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c
+index 23295ca..0e42adc 100644
+--- a/gtk/gtkicontheme.c
++++ b/gtk/gtkicontheme.c
+@@ -1418,7 +1418,9 @@ gtk_icon_theme_lookup_icon (GtkIconTheme *icon_theme,
+
+ variant = gtk_icon_theme_lookup_icon_for_scale (icon_theme, icon_name,
+ size, 2, flags);
+- if (retval && variant)
++ if (retval && variant &&
++ retval->pixbuf && variant->pixbuf &&
++ gdk_pixbuf_get_width (variant->pixbuf) > gdk_pixbuf_get_width (retval->pixbuf))
+ g_object_set_data_full (G_OBJECT (retval->pixbuf),
+ "gdk-pixbuf-2x-variant",
+ g_object_ref (variant->pixbuf),
+@@ -1525,7 +1527,9 @@ gtk_icon_theme_choose_icon (GtkIconTheme *icon_theme,
+ retval = choose_icon (icon_theme, icon_names, size, 1, flags);
+ variant = choose_icon (icon_theme, icon_names, size, 2, flags);
+
+- if (retval && variant)
++ if (retval && variant &&
++ retval->pixbuf && variant->pixbuf &&
++ gdk_pixbuf_get_width (variant->pixbuf) > gdk_pixbuf_get_width (retval->pixbuf))
+ g_object_set_data_full (G_OBJECT (retval->pixbuf),
+ "gdk-pixbuf-2x-variant",
+ g_object_ref (variant->pixbuf),
+@@ -1609,7 +1613,9 @@ gtk_icon_theme_load_icon (GtkIconTheme *icon_theme,
+
+ variant = gtk_icon_theme_load_icon_for_scale (icon_theme, icon_name,
+ size, 2, flags, NULL);
+- if (pixbuf && variant)
++
++ if (pixbuf && variant &&
++ gdk_pixbuf_get_width (variant) > gdk_pixbuf_get_width (pixbuf))
+ g_object_set_data_full (G_OBJECT (pixbuf),
+ "gdk-pixbuf-2x-variant",
+ g_object_ref (variant),
+--
+1.8.3.2
+
View
4 packages/patches/gtk/0065-Make-usual-calls-to-get-a-GdkPixbuf-attach-a-2x-vari.patch
@@ -71,7 +71,7 @@ index 500f0ab..23295ca 100644
+
+ variant = gtk_icon_theme_lookup_icon_for_scale (icon_theme, icon_name,
+ size, 2, flags);
-+ if (retval->pixbuf && variant)
++ if (retval && variant)
+ g_object_set_data_full (G_OBJECT (retval->pixbuf),
+ "gdk-pixbuf-2x-variant",
+ g_object_ref (variant->pixbuf),
@@ -98,7 +98,7 @@ index 500f0ab..23295ca 100644
+ retval = choose_icon (icon_theme, icon_names, size, 1, flags);
+ variant = choose_icon (icon_theme, icon_names, size, 2, flags);
+
-+ if (retval->pixbuf && variant)
++ if (retval && variant)
+ g_object_set_data_full (G_OBJECT (retval->pixbuf),
+ "gdk-pixbuf-2x-variant",
+ g_object_ref (variant->pixbuf),
Please sign in to comment.
Something went wrong with that request. Please try again.