diff options
author | Christian Neumair <cneumair@gnome.org> | 2008-03-30 13:14:09 +0000 |
---|---|---|
committer | Christian Neumair <cneumair@src.gnome.org> | 2008-03-30 13:14:09 +0000 |
commit | 41c0dfc19752a3df4d8c69c376aa3b42fb5c8311 (patch) | |
tree | d56a4f50491efa60c5178c20b12273f6c6bddb35 | |
parent | cb709405ab1dc47544a64b7da6f79e9a2eec5609 (diff) | |
download | nautilus-41c0dfc19752a3df4d8c69c376aa3b42fb5c8311.tar.gz |
Use icon name for window instead of pixbuf, if available (#519041).
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).
svn path=/branches/gnome-2-22/; revision=14006
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | src/file-manager/fm-properties-window.c | 37 |
2 files changed, 31 insertions, 13 deletions
@@ -1,3 +1,10 @@ +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). + 2008-03-29 Christian Neumair <cneumair@gnome.org> * src/nautilus-bookmarks-window.c (create_bookmarks_window), diff --git a/src/file-manager/fm-properties-window.c b/src/file-manager/fm-properties-window.c index 43f6925cf..c8fad63e5 100644 --- a/src/file-manager/fm-properties-window.c +++ b/src/file-manager/fm-properties-window.c @@ -397,10 +397,11 @@ add_prompt_and_separator (GtkVBox *vbox, const char *prompt_text) 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 @@ get_pixbuf_for_properties_window (FMPropertiesWindow *window) 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 @@ create_image_widget (FMPropertiesWindow *window, 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); |