aboutsummaryrefslogtreecommitdiff
path: root/src/play-button.c
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2010-09-06 19:30:48 +0100
committerConor Curran <conor.curran@canonical.com>2010-09-06 19:30:48 +0100
commit066b6a521cbda456ffb8f25ff01e1dd7d127fdd2 (patch)
tree5d7d675750daf600208fc24fa6f87e7794be2926 /src/play-button.c
parent1a664a07c80b0af9cd49d58335dda39df0d7785e (diff)
downloadayatana-indicator-sound-066b6a521cbda456ffb8f25ff01e1dd7d127fdd2.tar.gz
ayatana-indicator-sound-066b6a521cbda456ffb8f25ff01e1dd7d127fdd2.tar.bz2
ayatana-indicator-sound-066b6a521cbda456ffb8f25ff01e1dd7d127fdd2.zip
events from transport bar now are sent on button release
Diffstat (limited to 'src/play-button.c')
-rw-r--r--src/play-button.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/play-button.c b/src/play-button.c
index a2eaf2e..0c2a59a 100644
--- a/src/play-button.c
+++ b/src/play-button.c
@@ -409,11 +409,12 @@ play_button_react_to_button_press(GtkWidget* button, PlayButtonEvent command)
g_return_if_fail(IS_PLAY_BUTTON(button));
PlayButtonPrivate* priv = PLAY_BUTTON_GET_PRIVATE(button);
priv->current_command = command;
-
+
cairo_t *cr;
cr = gdk_cairo_create (button->window);
- GList* list = g_hash_table_lookup(priv->command_coordinates, GINT_TO_POINTER(command));
+ GList* list = g_hash_table_lookup(priv->command_coordinates,
+ GINT_TO_POINTER(priv->current_command));
cairo_rectangle(cr,
GPOINTER_TO_INT(g_list_nth_data(list, 0)),
GPOINTER_TO_INT(g_list_nth_data(list, 1)),
@@ -426,10 +427,12 @@ play_button_react_to_button_press(GtkWidget* button, PlayButtonEvent command)
void
-play_button_react_to_button_release(GtkWidget* button)
+play_button_react_to_button_release(GtkWidget* button, PlayButtonEvent command)
{
g_return_if_fail(IS_PLAY_BUTTON(button));
PlayButtonPrivate* priv = PLAY_BUTTON_GET_PRIVATE(button);
+ priv->current_command = command;
+
cairo_t *cr;
cr = gdk_cairo_create (button->window);
@@ -437,7 +440,7 @@ play_button_react_to_button_release(GtkWidget* button)
GINT_TO_POINTER(priv->current_command));
priv->current_command = TRANSPORT_NADA;
-
+
cairo_rectangle(cr,
GPOINTER_TO_INT(g_list_nth_data(list, 0)),
GPOINTER_TO_INT(g_list_nth_data(list, 1)),
@@ -456,6 +459,7 @@ play_button_toggle_play_pause(GtkWidget* button, PlayButtonState update)
PlayButtonPrivate* priv = PLAY_BUTTON_GET_PRIVATE(button);
priv->current_state = update;
g_debug("PlayButton::toggle play state : %i", priv->current_state);
+ gtk_widget_queue_draw (GTK_WIDGET(button));
}