aboutsummaryrefslogtreecommitdiff
path: root/src/indicator-sound.c
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-03-10 23:07:22 -0600
committerTed Gould <ted@gould.cx>2010-03-10 23:07:22 -0600
commit21d52b5ed3206791d5a0b4adc907be75a9e5f668 (patch)
tree5d23bf6a2b7fc89de2d11b7c76a5dd7392045206 /src/indicator-sound.c
parent69c96d7e7fa903569073bd87069b2d9f6aeb3fa4 (diff)
downloadayatana-indicator-sound-21d52b5ed3206791d5a0b4adc907be75a9e5f668.tar.gz
ayatana-indicator-sound-21d52b5ed3206791d5a0b4adc907be75a9e5f668.tar.bz2
ayatana-indicator-sound-21d52b5ed3206791d5a0b4adc907be75a9e5f668.zip
Using GIcon for setting the icons on the IDO slider.
Diffstat (limited to 'src/indicator-sound.c')
-rw-r--r--src/indicator-sound.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/indicator-sound.c b/src/indicator-sound.c
index 0b92af8..2dc6bf3 100644
--- a/src/indicator-sound.c
+++ b/src/indicator-sound.c
@@ -225,12 +225,23 @@ static gboolean new_slider_item(DbusmenuMenuitem * newitem, DbusmenuMenuitem * p
// alternative callback mechanism which i could use again at some point.
/* g_signal_connect(slider, "change-value", G_CALLBACK(user_change_value_event_cb), newitem); */
- // Set images on the ido
+ /* Get the primary Image */
primary_image = ido_scale_menu_item_get_primary_image((IdoScaleMenuItem*)volume_slider);
- gtk_image_set_from_icon_name(GTK_IMAGE(primary_image), g_hash_table_lookup(volume_states, GINT_TO_POINTER(STATE_ZERO)), GTK_ICON_SIZE_MENU);
+
+ /* Build a GIcon for the theme fallbacks */
+ GIcon * primary_gicon = g_themed_icon_new_with_default_fallbacks(g_hash_table_lookup(volume_states, GINT_TO_POINTER(STATE_ZERO)));
+ gtk_image_set_from_gicon(GTK_IMAGE(primary_image), primary_gicon, GTK_ICON_SIZE_MENU);
+ g_object_unref(primary_gicon);
+
+ /* Get the secondary image */
GtkWidget* secondary_image = ido_scale_menu_item_get_secondary_image((IdoScaleMenuItem*)volume_slider);
- gtk_image_set_from_icon_name(GTK_IMAGE(secondary_image), g_hash_table_lookup(volume_states, GINT_TO_POINTER(STATE_HIGH)), GTK_ICON_SIZE_MENU);
+ /* Build a GIcon for fallbacks */
+ GIcon * secondary_gicon = g_themed_icon_new_with_default_fallbacks(g_hash_table_lookup(volume_states, GINT_TO_POINTER(STATE_HIGH)));
+ gtk_image_set_from_gicon(GTK_IMAGE(secondary_image), secondary_gicon, GTK_ICON_SIZE_MENU);
+ g_object_unref(secondary_gicon);
+
+ /* Make the widget visible to users */
gtk_widget_show_all(volume_slider);
return TRUE;