diff options
author | Sebastien Bacher <seb128@ubuntu.com> | 2010-09-08 12:24:23 +0200 |
---|---|---|
committer | Sebastien Bacher <seb128@ubuntu.com> | 2010-09-08 12:24:23 +0200 |
commit | b347212eb1cb41fb9739a9873b0ff8eb8abb4b77 (patch) | |
tree | 3c9cb3c86b5668c2c03155c60a041f6cc85d28ba /src/play-button.c | |
parent | 80e5ad4f83a8b1218133761de11d433a7854041e (diff) | |
download | ayatana-indicator-sound-b347212eb1cb41fb9739a9873b0ff8eb8abb4b77.tar.gz ayatana-indicator-sound-b347212eb1cb41fb9739a9873b0ff8eb8abb4b77.tar.bz2 ayatana-indicator-sound-b347212eb1cb41fb9739a9873b0ff8eb8abb4b77.zip |
Import upstream version 0.4.2
Diffstat (limited to 'src/play-button.c')
-rw-r--r-- | src/play-button.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/play-button.c b/src/play-button.c index a2eaf2e..ccc23cb 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,19 @@ 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); + if(priv->current_command == TRANSPORT_NADA){ + g_debug("returning from the playbutton release because my previous command was nada"); + return; + } + else if(priv->current_command != TRANSPORT_NADA && + command != TRANSPORT_NADA){ + priv->current_command = command; + } + cairo_t *cr; cr = gdk_cairo_create (button->window); @@ -437,7 +447,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 +466,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)); } @@ -955,7 +966,6 @@ draw (GtkWidget* button, cairo_t *cr) } - /** * play_button_new: * @returns: a new #PlayButton. |