diff options
author | Conor Curran <conor.curran@canonical.com> | 2010-02-15 17:27:16 +0000 |
---|---|---|
committer | Conor Curran <conor.curran@canonical.com> | 2010-02-15 17:27:16 +0000 |
commit | 7071d039cbad013b52628e06c20415148440fe54 (patch) | |
tree | 4c0da46dbc209ac097bc23acb7d5b52dafcdb6e7 /src | |
parent | 683d166080ad0be95e4c5374dfd6408472e24831 (diff) | |
download | ayatana-indicator-sound-7071d039cbad013b52628e06c20415148440fe54.tar.gz ayatana-indicator-sound-7071d039cbad013b52628e06c20415148440fe54.tar.bz2 ayatana-indicator-sound-7071d039cbad013b52628e06c20415148440fe54.zip |
set key events to listen to
Diffstat (limited to 'src')
-rw-r--r-- | src/indicator-sound.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/indicator-sound.c b/src/indicator-sound.c index 74c2ba4..eadd0d0 100644 --- a/src/indicator-sound.c +++ b/src/indicator-sound.c @@ -382,20 +382,23 @@ static gboolean new_slider_item(DbusmenuMenuitem * newitem, DbusmenuMenuitem * p dbusmenu_gtkclient_newitem_base(DBUSMENU_GTKCLIENT(client), newitem, menu_volume_slider, parent); g_signal_connect(G_OBJECT(newitem), DBUSMENU_MENUITEM_SIGNAL_PROPERTY_CHANGED, G_CALLBACK(slider_prop_change_cb), volume_slider); + // register slider changes listening on the range GtkWidget* slider = ido_scale_menu_item_get_scale((IdoScaleMenuItem*)volume_slider); - g_signal_connect(slider, "key_press_event", G_CALLBACK(key_press_cb), newitem); g_signal_connect(slider, "change-value", G_CALLBACK(user_change_value_event_cb), newitem); g_signal_connect(slider, "value-changed", G_CALLBACK(value_changed_event_cb), newitem); + // Set images on the ido 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); 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); -/* GtkRange* range = (GtkRange*)slider; */ -/* gtk_range_set_value(range, initial_volume_percent); */ + // register Key-press listening on the widget + g_signal_connect(volume_slider, "key_press_event", G_CALLBACK(key_press_cb), newitem); + gtk_widget_set_events (volume_slider, GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK); gtk_widget_show_all(volume_slider); + return TRUE; } |