ayatana-commits team mailing list archive
-
ayatana-commits team
-
Mailing list archive
-
Message #01322
[Merge] lp:~cjcurran/indicator-sound/blocking_animation_second_attempt into lp:indicator-sound
Conor Curran has proposed merging lp:~cjcurran/indicator-sound/blocking_animation_second_attempt into lp:indicator-sound.
Requested reviews:
Cody Russell (bratsche)
--
https://code.launchpad.net/~cjcurran/indicator-sound/blocking_animation_second_attempt/+merge/22459
Your team ayatana-commits is subscribed to branch lp:indicator-sound.
=== modified file 'src/indicator-sound.c'
--- src/indicator-sound.c 2010-03-24 15:47:37 +0000
+++ src/indicator-sound.c 2010-03-30 15:00:37 +0000
@@ -125,11 +125,13 @@
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 @@
}
// 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 @@
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)
Follow ups