banshee r3844 - in trunk/banshee: . src/Clients/Nereid src/Libraries/Hyena.Gui/Hyena.Widgets



Author: abock
Date: Tue Apr 29 19:21:36 2008
New Revision: 3844
URL: http://svn.gnome.org/viewvc/banshee?rev=3844&view=rev

Log:
2008-04-29  Aaron Bockover  <abock gnome org>

    * src/Libraries/Hyena.Gui/Hyena.Widgets/AnimatedImage.cs: When hidden,
    preserve the active state and pause the stage to prevent iterations and
    restore the active state/resume the stage (if active); the more correct
    fix for the cause of BGO #523646.

    * src/Libraries/Hyena.Gui/Hyena.Widgets/MessageBar.cs: Explicitly show/hide
    the animated image when the bar show/hides



Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Clients/Nereid/Nereid.mdp
   trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Widgets/AnimatedImage.cs
   trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Widgets/MessageBar.cs

Modified: trunk/banshee/src/Clients/Nereid/Nereid.mdp
==============================================================================
--- trunk/banshee/src/Clients/Nereid/Nereid.mdp	(original)
+++ trunk/banshee/src/Clients/Nereid/Nereid.mdp	Tue Apr 29 19:21:36 2008
@@ -3,7 +3,7 @@
     <Configuration name="Debug" ctype="DotNetProjectConfiguration">
       <Output directory="../../../bin" assemblyKeyFile="." assembly="Nereid" />
       <Build debugmode="True" target="Exe" />
-      <Execution runwithwarnings="True" consolepause="True" runtime="MsNet" clr-version="Net_2_0" />
+      <Execution runwithwarnings="True" externalconsole="True" consolepause="True" runtime="MsNet" clr-version="Net_2_0" />
       <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" mainclass="" generatexmldocumentation="False" win32Icon="." ctype="CSharpCompilerParameters" />
     </Configuration>
   </Configurations>

Modified: trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Widgets/AnimatedImage.cs
==============================================================================
--- trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Widgets/AnimatedImage.cs	(original)
+++ trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Widgets/AnimatedImage.cs	Tue Apr 29 19:21:36 2008
@@ -42,6 +42,7 @@
         private int frame_width;
         private int frame_height;
         private int max_frames;
+        private bool active_frozen;
         
         private SingleActorStage stage = new SingleActorStage ();
         
@@ -52,6 +53,25 @@
             stage.Actor.CanExpire = false;
         }
         
+        protected override void OnShown ()
+        {
+            base.OnShown ();
+            
+            if (active_frozen && !stage.Playing) {
+                stage.Play ();
+            }
+        }
+        
+        protected override void OnHidden ()
+        {
+            base.OnHidden ();
+            
+            active_frozen = Active;
+            if (stage.Playing) {
+                stage.Pause ();
+            }
+        }
+        
         public void Load ()
         {
             ExtractFrames ();
@@ -60,6 +80,10 @@
         
         private void OnIteration (object o, EventArgs args)
         {
+            if (!Visible) {
+                return;
+            }
+            
             if (frames == null || frames.Length == 0) {
                 return;
             } else if (frames.Length == 1) {
@@ -101,12 +125,19 @@
         }
         
         public bool Active {
-            get { return stage.Playing; }
+            get { return !Visible ? active_frozen : stage.Playing; }
             set { 
                 if (value) {
-                    stage.Play ();
+                    active_frozen = true;
+                    if (Visible) {
+                        stage.Play ();
+                    }
                 } else {
-                    stage.Pause ();
+                    active_frozen = false;
+                    if (stage.Playing) {
+                        stage.Pause ();
+                    }
+                    
                     if (inactive_pixbuf != null) {
                         base.Pixbuf = inactive_pixbuf;
                     } else if (frames != null && frames.Length > 1) {

Modified: trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Widgets/MessageBar.cs
==============================================================================
--- trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Widgets/MessageBar.cs	(original)
+++ trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Widgets/MessageBar.cs	Tue Apr 29 19:21:36 2008
@@ -64,7 +64,6 @@
                 image.FrameWidth = 22;
                 Spinning = false;
                 image.Load ();
-                image.Show ();
             } catch {
             }
             
@@ -97,6 +96,18 @@
             BorderWidth = 3;
         }
         
+        protected override void OnShown ()
+        {
+            base.OnShown ();
+            image.Show ();
+        }
+        
+        protected override void OnHidden ()
+        {
+            base.OnHidden ();
+            image.Hide ();
+        }
+        
         protected override void OnRealized ()
         {
             base.OnRealized ();



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]