banshee r3766 - in trunk/banshee: . src/Libraries/Hyena.Gui/Hyena.Gui.Theatrics src/Libraries/Hyena.Gui/Hyena.Widgets



Author: scottp
Date: Fri Apr 11 09:41:37 2008
New Revision: 3766
URL: http://svn.gnome.org/viewvc/banshee?rev=3766&view=rev

Log:
* src/Libraries/Hyena.Gui/Hyena.Widgets/AnimatedBox.cs: Use bools
instead of the None enums (previously instituted to eliminate some
nullables.

* src/Libraries/Hyena.Gui/Hyena.Widgets/MenuButton.cs: Got rid of
OnRealized OnUnrealized overrides - we don't really need them.

* src/Libraries/Hyena.Gui/Hyena.Gui.Theatrics/Choreographer.cs: Got rid
of Easing and Blocking.None

Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Gui.Theatrics/Choreographer.cs
   trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Widgets/AnimatedBox.cs
   trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Widgets/MenuButton.cs

Modified: trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Gui.Theatrics/Choreographer.cs
==============================================================================
--- trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Gui.Theatrics/Choreographer.cs	(original)
+++ trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Gui.Theatrics/Choreographer.cs	Fri Apr 11 09:41:37 2008
@@ -33,14 +33,12 @@
 {
     public enum Blocking
     {
-        None,
         Upstage,
         Downstage
     }
     
     public enum Easing
     {
-        None,
         Linear,
         QuadraticIn,
         QuadraticOut,

Modified: trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Widgets/AnimatedBox.cs
==============================================================================
--- trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Widgets/AnimatedBox.cs	(original)
+++ trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Widgets/AnimatedBox.cs	Fri Apr 11 09:41:37 2008
@@ -61,6 +61,8 @@
         
         protected AnimatedBox ()
         {
+            WidgetFlags |= WidgetFlags.NoWindow;
+            
             stage.ActorStep += OnActorStep;
             stage.Iteration += OnIteration;
         }
@@ -228,45 +230,45 @@
         
         public new void Remove (Widget widget)
         {
-            RemoveCore (widget, 0, Easing.None, Blocking.None);
+            RemoveCore (widget, 0, 0, 0, false, false);
         }
         
         public void Remove (Widget widget, uint duration)
         {
-            RemoveCore (widget, duration, Easing.None, Blocking.None);
+            RemoveCore (widget, duration, 0, 0, false, false);
         }
         
         public void Remove (Widget widget, Easing easing)
         {
-            RemoveCore (widget, 0, easing, Blocking.None);
+            RemoveCore (widget, 0, easing, 0, true, false);
         }
         
         public void Remove (Widget widget, uint duration, Easing easing)
         {
-            RemoveCore (widget, duration, easing, Blocking.None);
+            RemoveCore (widget, duration, easing, 0, true, false);
         }
         
         public void Remove (Widget widget, Blocking blocking)
         {
-            RemoveCore (widget, 0, Easing.None, blocking);
+            RemoveCore (widget, 0, 0, blocking, false, true);
         }
         
         public void Remove (Widget widget, uint duration, Blocking blocking)
         {
-            RemoveCore (widget, duration, Easing.None, blocking);
+            RemoveCore (widget, duration, 0, blocking, false, true);
         }
         
         public void Remove (Widget widget, Easing easing, Blocking blocking)
         {
-            RemoveCore (widget, 0, easing, blocking);
+            RemoveCore (widget, 0, easing, blocking, true, true);
         }
         
         public void Remove (Widget widget, uint duration, Easing easing, Blocking blocking)
         {
-            RemoveCore (widget, duration, easing, blocking);
+            RemoveCore (widget, duration, easing, blocking, true, true);
         }
         
-        private void RemoveCore (Widget widget, uint duration, Easing easing, Blocking blocking)
+        private void RemoveCore (Widget widget, uint duration, Easing easing, Blocking blocking, bool use_easing, bool use_blocking)
         {
             if (widget == null) {
                 throw new ArgumentNullException ("widget");
@@ -284,26 +286,26 @@
                 throw new ArgumentException ("Cannot remove the specified widget because it has not been added to this container or it has already been removed.", "widget");
             }
             
-            RemoveCore (animated_widget, duration, easing, blocking);
+            RemoveCore (animated_widget, duration, easing, blocking, use_easing, use_blocking);
         }
         
         private void RemoveCore (AnimatedWidget widget)
         {
-            RemoveCore (widget, widget.Duration, widget.Easing, widget.Blocking);
+            RemoveCore (widget, widget.Duration, 0, 0, false, false);
         }
         
-        private void RemoveCore (AnimatedWidget widget, uint duration, Easing easing, Blocking blocking)
+        private void RemoveCore (AnimatedWidget widget, uint duration, Easing easing, Blocking blocking, bool use_easing, bool use_blocking)
         {
             lock (widget) {
                 if (duration > 0) {
                     widget.Duration = duration;
                 }
                 
-                if (easing != Easing.None) {
+                if (use_easing) {
                     widget.Easing = easing;
                 }
                 
-                if (blocking != Blocking.None) {
+                if (use_blocking) {
                     widget.Blocking = blocking;
                 }
             
@@ -359,13 +361,6 @@
             PackStart (widget, duration, easing, blocking);
         }
         
-        protected override void OnRealized ()
-        {
-            WidgetFlags |= WidgetFlags.Realized | WidgetFlags.NoWindow;
-            GdkWindow = Parent.GdkWindow;
-            base.OnRealized ();
-        }
-        
         protected override void ForAll (bool include_internals, Callback callback)
         {
             foreach (AnimatedWidget child in Widgets) {

Modified: trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Widgets/MenuButton.cs
==============================================================================
--- trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Widgets/MenuButton.cs	(original)
+++ trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Widgets/MenuButton.cs	Fri Apr 11 09:41:37 2008
@@ -43,6 +43,8 @@
         
         public MenuButton (Widget buttonWidget, Menu menu, bool showArrow)
         {
+            WidgetFlags |= WidgetFlags.NoWindow;
+            
             button_widget = buttonWidget;
             this.menu = menu;
             menu.Deactivated += delegate { button.Active = false; };
@@ -78,19 +80,6 @@
             get { return menu; }
         }
         
-        protected override void OnRealized ()
-        {
-            WidgetFlags |= WidgetFlags.Realized | WidgetFlags.NoWindow;
-            GdkWindow = Parent.GdkWindow;
-            base.OnRealized ();
-        }
-        
-        protected override void OnUnrealized ()
-        {
-            WidgetFlags ^= WidgetFlags.Realized;
-            base.OnUnrealized ();
-        }
-        
         protected override void OnSizeRequested (ref Requisition requisition)
         {
             requisition = size_widget.SizeRequest ();



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