aboutsummaryrefslogtreecommitdiff
path: root/src/play-button.c
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2010-07-27 16:23:31 +0100
committerConor Curran <conor.curran@canonical.com>2010-07-27 16:23:31 +0100
commited4b8a59464b94aabf311d6ba7654c243d1218f4 (patch)
tree075bc2504e749a71dc52540adffd027547fe315a /src/play-button.c
parentc7316aef6047ef29ab71fbcd34d6932fb0e521ad (diff)
parent694340cf4123edee2d3c22173c1ac855a6b187f7 (diff)
downloadayatana-indicator-sound-ed4b8a59464b94aabf311d6ba7654c243d1218f4.tar.gz
ayatana-indicator-sound-ed4b8a59464b94aabf311d6ba7654c243d1218f4.tar.bz2
ayatana-indicator-sound-ed4b8a59464b94aabf311d6ba7654c243d1218f4.zip
ui fixes merged
Diffstat (limited to 'src/play-button.c')
-rw-r--r--src/play-button.c31
1 files changed, 21 insertions, 10 deletions
diff --git a/src/play-button.c b/src/play-button.c
index 1aeff12..cf8bc2f 100644
--- a/src/play-button.c
+++ b/src/play-button.c
@@ -85,16 +85,6 @@ G_DEFINE_TYPE (PlayButton, play_button, GTK_TYPE_DRAWING_AREA);
/// internal helper functions //////////////////////////////////////////////////
-/*static double
-_align (double val)
-{
- double fract = val - (int) val;
-
- if (fract != 0.5f)
- return (double) ((int) val + 0.5f);
- else
- return val;
-}*/
static inline void
_blurinner (guchar* pixel,
@@ -464,8 +454,29 @@ void
play_button_toggle_play_pause(GtkWidget* button, PlayButtonState update)
{
PlayButtonPrivate* priv = PLAY_BUTTON_GET_PRIVATE(button);
+ gboolean changed = priv->current_state != update;
priv->current_state = update;
g_debug("PlayButton::toggle play state : %i", priv->current_state);
+
+ if(changed == TRUE){
+ g_debug("Toggle play pause - changed of state detected");
+ cairo_t *cr;
+
+ cr = gdk_cairo_create (button->window);
+
+ GList* list = g_hash_table_lookup(priv->command_coordinates,
+ GINT_TO_POINTER(TRANSPORT_PLAY_PAUSE));
+
+ cairo_rectangle(cr,
+ GPOINTER_TO_INT(g_list_nth_data(list, 0)),
+ GPOINTER_TO_INT(g_list_nth_data(list, 1)),
+ GPOINTER_TO_INT(g_list_nth_data(list, 2)),
+ GPOINTER_TO_INT(g_list_nth_data(list, 3)));
+
+ cairo_clip(cr);
+ draw (button, cr);
+ cairo_destroy (cr);
+ }
}