rpms/control-center/devel fix-appearance-capplet.patch, NONE, 1.1 control-center.spec, 1.452, 1.453

Matthias Clasen mclasen at fedoraproject.org
Thu Jul 9 15:43:14 UTC 2009


Author: mclasen

Update of /cvs/pkgs/rpms/control-center/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv9701

Modified Files:
	control-center.spec 
Added Files:
	fix-appearance-capplet.patch 
Log Message:
improve rendering in appearance capplet


fix-appearance-capplet.patch:

--- NEW FILE fix-appearance-capplet.patch ---
diff --git a/capplets/common/theme-thumbnail.c b/capplets/common/theme-thumbnail.c
index 440b25a..0814b62 100644
--- a/capplets/common/theme-thumbnail.c
+++ b/capplets/common/theme-thumbnail.c
@@ -164,43 +164,35 @@ static GdkPixbuf *
 create_folder_icon (char *icon_theme_name)
 {
   GtkIconTheme *icon_theme;
-  GdkPixbuf *folder_icon = NULL, *retval;
+  GdkPixbuf *folder_icon = NULL;
   GtkIconInfo *folder_icon_info;
-  const gchar *filename;
   gchar *example_icon_name;
+  const gchar *icon_names[5];
+  gint i;
 
   icon_theme = gtk_icon_theme_new ();
   gtk_icon_theme_set_custom_theme (icon_theme, icon_theme_name);
 
-  folder_icon_info = NULL;
+ i = 0;
   /* Get the Example icon name in the theme if specified */
   example_icon_name = gtk_icon_theme_get_example_icon_name (icon_theme);
   if (example_icon_name != NULL)
-    folder_icon_info = gtk_icon_theme_lookup_icon (icon_theme, example_icon_name, 48, GTK_ICON_LOOKUP_FORCE_SVG);
-  g_free (example_icon_name);
-
-  /* If an Example is not specified, fall back to using the folder icons in
-     the order of Icon Nameing Spec, "gnome-fs-directory", and "folder" */
-  if (folder_icon_info == NULL)
-    folder_icon_info = gtk_icon_theme_lookup_icon (icon_theme, "x-directory-normal", 48, GTK_ICON_LOOKUP_FORCE_SVG);
-  if (folder_icon_info == NULL)
-    folder_icon_info = gtk_icon_theme_lookup_icon (icon_theme, "gnome-fs-directory", 48, GTK_ICON_LOOKUP_FORCE_SVG);
-  if (folder_icon_info == NULL)
-    folder_icon_info = gtk_icon_theme_lookup_icon (icon_theme, "folder", 48, GTK_ICON_LOOKUP_FORCE_SVG);
-
-  g_object_unref (icon_theme);
+    icon_names[i++] = example_icon_name;
+  icon_names[i++] = "x-directory-normal";
+  icon_names[i++] = "gnome-fs-directory";
+  icon_names[i++] = "folder";
+  icon_names[i++] = NULL;
 
+  folder_icon_info = gtk_icon_theme_choose_icon (icon_theme, icon_names, 48, GTK_ICON_LOOKUP_FORCE_SIZE);
   if (folder_icon_info != NULL)
-  {
-    filename = gtk_icon_info_get_filename (folder_icon_info);
-
-    if (filename != NULL)
     {
-      folder_icon = gdk_pixbuf_new_from_file (filename, NULL);
+      g_print ("got info %s\n", gtk_icon_info_get_filename (folder_icon_info));
+      folder_icon = gtk_icon_info_load_icon (folder_icon_info, NULL);
+      gtk_icon_info_free (folder_icon_info);
     }
 
-    gtk_icon_info_free (folder_icon_info);
-  }
+  g_object_unref (icon_theme);
+  g_free (example_icon_name);
 
   /* render the icon to the thumbnail */
   if (folder_icon == NULL)
@@ -216,25 +208,7 @@ create_folder_icon (char *icon_theme_name)
     gtk_widget_destroy (dummy);
   }
 
-  /* Some icons don't come back at the requested dimensions, so we need to scale
-   * them. The width is usually the largest dimension for icons that come at
-   * irregular sizes, so use this to calculate the scale factor
-   */
-  if (gdk_pixbuf_get_width (folder_icon) != ICON_THUMBNAIL_SIZE) {
-    int width, height;
-    gdouble scale;
-
-    scale = ((double) ICON_THUMBNAIL_SIZE) / gdk_pixbuf_get_width (folder_icon);
-    width = ICON_THUMBNAIL_SIZE;
-    height = scale * gdk_pixbuf_get_height (folder_icon);
-
-    retval = gdk_pixbuf_scale_simple (folder_icon, width, height, GDK_INTERP_BILINEAR);
-    g_object_unref (folder_icon);
-  } else {
-    retval = folder_icon;
-  }
-
-  return retval;
+  return folder_icon;
 }
 
 static GdkPixbuf *


Index: control-center.spec
===================================================================
RCS file: /cvs/pkgs/rpms/control-center/devel/control-center.spec,v
retrieving revision 1.452
retrieving revision 1.453
diff -u -p -r1.452 -r1.453
--- control-center.spec	1 Jul 2009 18:01:40 -0000	1.452
+++ control-center.spec	9 Jul 2009 15:43:14 -0000	1.453
@@ -23,7 +23,7 @@
 Summary: Utilities to configure the GNOME desktop
 Name: control-center
 Version: 2.27.3
-Release: 1%{?dist}
+Release: 2%{?dist}
 Epoch: 1
 License: GPLv2+ and GFDL
 Group: User Interface/Desktops
@@ -61,6 +61,9 @@ Patch37: polkit1.patch
 # http://bugzilla.gnome.org/show_bug.cgi?id=587355
 Patch42: gnomekbd.patch
 
+# http://bugzilla.gnome.org/show_bug.cgi?id=588166
+Patch43: fix-appearance-capplet.patch
+
 # call the Fedora/RHEL graphical passwd changing apps
 Patch95: gnome-control-center-2.25.2-passwd.patch
 Patch96: gnome-control-center-2.25.2-gecos.patch
@@ -184,6 +187,7 @@ utilities.
 %patch34 -p0 -b .new-icons
 %patch35 -p1 -b .support-touchpads
 %patch42 -p1 -b .gnomekbd
+%patch43 -p1 -b .fix-appearance-capplet
 
 pushd capplets/about-me
 mv *png icons/
@@ -361,6 +365,9 @@ fi
 %dir %{_datadir}/gnome-control-center/keybindings
 
 %changelog
+* Thu Jul  9 2009 Matthias Clasen <mclasen at redhat.com> - 2.27.3-2
+- Improve theme rendering in the appearance capplet
+
 * Tue Jun 30 2009 Matthias Clasen <mclasen at redhat.com> - 2.27.3-1
 - Update to 2.27.3
 




More information about the scm-commits mailing list