aboutsummaryrefslogtreecommitdiff
path: root/src/indicator-sound.c
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2010-03-30 15:55:58 +0100
committerConor Curran <conor.curran@canonical.com>2010-03-30 15:55:58 +0100
commit0cd41569d5b70e29547a7faa72456f8d1b3d2042 (patch)
treed82c986c1606e3a375aa088ff8a78f44c504f65d /src/indicator-sound.c
parent1b3548bb61035a949fcb7a2043ed99789083728a (diff)
downloadayatana-indicator-sound-0cd41569d5b70e29547a7faa72456f8d1b3d2042.tar.gz
ayatana-indicator-sound-0cd41569d5b70e29547a7faa72456f8d1b3d2042.tar.bz2
ayatana-indicator-sound-0cd41569d5b70e29547a7faa72456f8d1b3d2042.zip
modified the animation so it should now be aligned with the spec
Diffstat (limited to 'src/indicator-sound.c')
-rw-r--r--src/indicator-sound.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/indicator-sound.c b/src/indicator-sound.c
index a67a0b0..9843bd3 100644
--- a/src/indicator-sound.c
+++ b/src/indicator-sound.c
@@ -125,11 +125,13 @@ static gboolean device_available;
static gboolean slider_in_direct_use;
static GtkIconSize design_team_size;
+static gint blocked_id;
static gint animation_id;
static GList * blocked_animation_list = NULL;
static GList * blocked_iter = NULL;
static void prepare_blocked_animation();
static gboolean fade_back_to_mute_image();
+static gboolean start_animation();
// Construction
static void
@@ -371,12 +373,12 @@ static void prepare_blocked_animation()
}
// sample 22 snapshots - range : 0-256
- for(i = 0; i < 23; i++)
+ for(i = 0; i < 51; i++)
{
gdk_pixbuf_composite(mute_buf, blocked_buf, 0, 0,
gdk_pixbuf_get_width(mute_buf),
gdk_pixbuf_get_height(mute_buf),
- 0, 0, 1, 1, GDK_INTERP_BILINEAR, MIN(255, i * 11));
+ 0, 0, 1, 1, GDK_INTERP_BILINEAR, MIN(255, i * 5));
blocked_animation_list = g_list_append(blocked_animation_list, gdk_pixbuf_copy(blocked_buf));
}
}
@@ -505,12 +507,19 @@ static void catch_signal_sink_input_while_muted(DBusGProxy * proxy, gboolean blo
if (block_value == 1 && animation_id == 0 && blocked_animation_list != NULL) {
gchar* image_name = g_hash_table_lookup(volume_states, GINT_TO_POINTER(STATE_MUTED_WHILE_INPUT));
indicator_image_helper_update(speaker_image, image_name);
-
- blocked_iter = blocked_animation_list;
- animation_id = g_timeout_add_seconds(1, fade_back_to_mute_image, NULL);
+ blocked_id = g_timeout_add_seconds(5, start_animation, NULL);
}
}
+static gboolean start_animation()
+{
+ blocked_iter = blocked_animation_list;
+ blocked_id = 0;
+ animation_id = g_timeout_add(50, fade_back_to_mute_image, NULL);
+ g_debug("exit from blocked hold\n");
+ return FALSE;
+}
+
static gboolean fade_back_to_mute_image()
{
if(blocked_iter != NULL)