nautilus r14006 - in branches/gnome-2-22: . src/file-manager
- From: cneumair svn gnome org
- To: svn-commits-list gnome org
- Subject: nautilus r14006 - in branches/gnome-2-22: . src/file-manager
- Date: Sun, 30 Mar 2008 14:14:09 +0100 (BST)
Author: cneumair
Date: Sun Mar 30 14:14:09 2008
New Revision: 14006
URL: http://svn.gnome.org/viewvc/nautilus?rev=14006&view=rev
Log:
2008-03-30 Christian Neumair <cneumair gnome org>
* src/file-manager/fm-properties-window.c
(get_image_for_properties_window), (update_properties_window_icon),
(create_image_widget):
Use icon name for window instead of pixbuf, if available (#519041).
Modified:
branches/gnome-2-22/ChangeLog
branches/gnome-2-22/src/file-manager/fm-properties-window.c
Modified: branches/gnome-2-22/src/file-manager/fm-properties-window.c
==============================================================================
--- branches/gnome-2-22/src/file-manager/fm-properties-window.c (original)
+++ branches/gnome-2-22/src/file-manager/fm-properties-window.c Sun Mar 30 14:14:09 2008
@@ -397,10 +397,11 @@
gtk_box_pack_end (GTK_BOX (vbox), separator_line, TRUE, TRUE, 2*ROW_PAD);
}
-static GdkPixbuf *
-get_pixbuf_for_properties_window (FMPropertiesWindow *window)
+static void
+get_image_for_properties_window (FMPropertiesWindow *window,
+ char **icon_name,
+ GdkPixbuf **icon_pixbuf)
{
- GdkPixbuf *pixbuf;
NautilusIconInfo *icon, *new_icon;
GList *l;
@@ -427,28 +428,39 @@
if (!icon) {
icon = nautilus_icon_info_lookup_from_name ("text-x-generic", NAUTILUS_ICON_SIZE_STANDARD);
}
-
- pixbuf = nautilus_icon_info_get_pixbuf_at_size (icon, NAUTILUS_ICON_SIZE_STANDARD);
- g_object_unref (icon);
- return pixbuf;
+ if (icon_name != NULL) {
+ *icon_name = g_strdup (nautilus_icon_info_get_used_name (icon));
+ }
+
+ if (icon_pixbuf != NULL) {
+ *icon_pixbuf = nautilus_icon_info_get_pixbuf_at_size (icon, NAUTILUS_ICON_SIZE_STANDARD);
+ }
+
+ g_object_unref (icon);
}
static void
update_properties_window_icon (GtkImage *image)
{
- GdkPixbuf *pixbuf;
FMPropertiesWindow *window;
+ GdkPixbuf *pixbuf;
+ char *name;
window = g_object_get_data (G_OBJECT (image), "properties_window");
- pixbuf = get_pixbuf_for_properties_window (window);
+ get_image_for_properties_window (window, &name, &pixbuf);
+
+ if (name != NULL) {
+ gtk_window_set_icon_name (GTK_WINDOW (window), name);
+ } else {
+ gtk_window_set_icon (GTK_WINDOW (window), pixbuf);
+ }
gtk_image_set_from_pixbuf (image, pixbuf);
- gtk_window_set_icon (GTK_WINDOW (window), pixbuf);
-
+ g_free (name);
g_object_unref (pixbuf);
}
@@ -557,8 +569,7 @@
GtkWidget *image;
GdkPixbuf *pixbuf;
- pixbuf = get_pixbuf_for_properties_window (window);
-
+ get_image_for_properties_window (window, NULL, &pixbuf);
image = gtk_image_new ();
gtk_widget_show (image);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]