Fix scale XPM icon in menu applications and launchers.

While I'm here,
- Use USES= pathfix instead of gnomehack

Approved by:	portmgr (tabthorpe)
This commit is contained in:
Olivier Duchateau 2013-04-07 07:12:32 +00:00
parent 50300e3a9e
commit e5eeaf2b4e
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=315751
2 changed files with 49 additions and 2 deletions

View file

@ -4,7 +4,7 @@
PORTNAME= xfce4-panel PORTNAME= xfce4-panel
PORTVERSION= 4.10.0 PORTVERSION= 4.10.0
PORTREVISION= 5 PORTREVISION= 6
CATEGORIES= x11-wm xfce CATEGORIES= x11-wm xfce
MASTER_SITES= ${MASTER_SITE_XFCE} MASTER_SITES= ${MASTER_SITE_XFCE}
DIST_SUBDIR= xfce4 DIST_SUBDIR= xfce4
@ -16,11 +16,12 @@ LIB_DEPENDS= wnck-1:${PORTSDIR}/x11-toolkits/libwnck \
cairo:${PORTSDIR}/graphics/cairo \ cairo:${PORTSDIR}/graphics/cairo \
dbus-glib-1:${PORTSDIR}/devel/dbus-glib dbus-glib-1:${PORTSDIR}/devel/dbus-glib
USES= pathfix
GNU_CONFIGURE= yes GNU_CONFIGURE= yes
INSTALLS_ICONS= yes INSTALLS_ICONS= yes
USE_BZIP2= yes USE_BZIP2= yes
USE_GMAKE= yes USE_GMAKE= yes
USE_GNOME= gnomehack glib20 gtk20 intltool intlhack desktopfileutils USE_GNOME= glib20 gtk20 intltool intlhack desktopfileutils
USE_LDCONFIG= yes USE_LDCONFIG= yes
USE_PERL5= yes USE_PERL5= yes
USE_XFCE= configenv garcon libexo libmenu libutil xfconf USE_XFCE= configenv garcon libexo libmenu libutil xfconf

View file

@ -0,0 +1,46 @@
--- ./libxfce4panel/xfce-panel-convenience.c.orig 2012-04-28 20:31:35.000000000 +0000
+++ ./libxfce4panel/xfce-panel-convenience.c 2013-04-06 21:01:14.000000000 +0000
@@ -158,7 +158,7 @@
gchar *name;
gchar *filename;
gint src_w, src_h;
- gdouble wratio, hratio;
+ gdouble ratio;
GdkPixbuf *dest;
GError *error = NULL;
gint size = MIN (dest_width, dest_height);
@@ -170,15 +170,13 @@
if (G_UNLIKELY (g_path_is_absolute (source)))
{
- pixbuf = gdk_pixbuf_new_from_file_at_scale (source, dest_width, dest_height, TRUE, &error);
+ pixbuf = gdk_pixbuf_new_from_file (source, &error);
if (G_UNLIKELY (pixbuf == NULL))
{
g_message ("Failed to load image \"%s\": %s",
source, error->message);
g_error_free (error);
}
-
- return pixbuf;
}
else
{
@@ -233,13 +231,11 @@
if (src_w > dest_width || src_h > dest_height)
{
/* calculate the new dimensions */
- wratio = (gdouble) src_w / (gdouble) size;
- hratio = (gdouble) src_h / (gdouble) size;
+ ratio = MIN ((gdouble) dest_width / (gdouble) src_w,
+ (gdouble) dest_height / (gdouble) src_h);
- if (hratio > wratio)
- dest_width = rint (src_w / hratio);
- else
- dest_height = rint (src_h / wratio);
+ dest_width = rint (src_w * ratio);
+ dest_height = rint (src_h * ratio);
dest = gdk_pixbuf_scale_simple (pixbuf,
MAX (dest_width, 1),