[nautilus] places-sidebar: use a symbolic icon for eject
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] places-sidebar: use a symbolic icon for eject
- Date: Thu, 17 Feb 2011 16:30:08 +0000 (UTC)
commit 7131487c8bebbbad075b238ec03934a78cf233d9
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Tue Feb 15 10:44:15 2011 -0500
places-sidebar: use a symbolic icon for eject
src/nautilus-places-sidebar.c | 29 ++++++++++++++++++++---------
1 files changed, 20 insertions(+), 9 deletions(-)
---
diff --git a/src/nautilus-places-sidebar.c b/src/nautilus-places-sidebar.c
index 828b9d0..a9038e3 100644
--- a/src/nautilus-places-sidebar.c
+++ b/src/nautilus-places-sidebar.c
@@ -212,16 +212,26 @@ static GtkTreeModel *nautilus_shortcuts_model_filter_new (NautilusPlacesSidebar
G_DEFINE_TYPE (NautilusPlacesSidebar, nautilus_places_sidebar, GTK_TYPE_SCROLLED_WINDOW);
static GdkPixbuf *
-get_eject_icon (gboolean highlighted)
+get_eject_icon (NautilusPlacesSidebar *sidebar,
+ gboolean highlighted)
{
GdkPixbuf *eject;
- NautilusIconInfo *eject_icon_info;
+ GtkIconInfo *icon_info;
+ GIcon *icon;
int icon_size;
+ GtkIconTheme *icon_theme;
+ GtkStyleContext *style;
- icon_size = nautilus_get_icon_size_for_stock_size (GTK_ICON_SIZE_MENU);
+ icon_theme = gtk_icon_theme_get_default ();
+ icon_size = nautilus_get_icon_size_for_stock_size (GTK_ICON_SIZE_SMALL_TOOLBAR);
+ icon = g_themed_icon_new_with_default_fallbacks ("media-eject-symbolic");
+ icon_info = gtk_icon_theme_lookup_by_gicon (icon_theme, icon, icon_size, 0);
- eject_icon_info = nautilus_icon_info_lookup_from_name ("media-eject", icon_size);
- eject = nautilus_icon_info_get_pixbuf_at_size (eject_icon_info, icon_size);
+ style = gtk_widget_get_style_context (GTK_WIDGET (sidebar));
+ eject = gtk_icon_info_load_symbolic_for_context (icon_info,
+ style,
+ NULL,
+ NULL);
if (highlighted) {
GdkPixbuf *high;
@@ -230,7 +240,8 @@ get_eject_icon (gboolean highlighted)
eject = high;
}
- g_object_unref (eject_icon_info);
+ g_object_unref (icon);
+ gtk_icon_info_free (icon_info);
return eject;
}
@@ -354,7 +365,7 @@ add_place (NautilusPlacesSidebar *sidebar,
}
if (show_eject_button) {
- eject = get_eject_icon (FALSE);
+ eject = get_eject_icon (sidebar, FALSE);
} else {
eject = NULL;
}
@@ -2681,7 +2692,7 @@ update_eject_buttons (NautilusPlacesSidebar *sidebar,
gtk_list_store_set (sidebar->store,
&iter,
- PLACES_SIDEBAR_COLUMN_EJECT_ICON, get_eject_icon (FALSE),
+ PLACES_SIDEBAR_COLUMN_EJECT_ICON, get_eject_icon (sidebar, FALSE),
-1);
gtk_tree_model_filter_refilter (GTK_TREE_MODEL_FILTER (sidebar->filter_model));
@@ -2703,7 +2714,7 @@ update_eject_buttons (NautilusPlacesSidebar *sidebar,
path);
gtk_list_store_set (sidebar->store,
&iter,
- PLACES_SIDEBAR_COLUMN_EJECT_ICON, get_eject_icon (TRUE),
+ PLACES_SIDEBAR_COLUMN_EJECT_ICON, get_eject_icon (sidebar, TRUE),
-1);
gtk_tree_model_filter_refilter (GTK_TREE_MODEL_FILTER (sidebar->filter_model));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]