banshee r3111 - in trunk/banshee: . src/Core/Banshee.ThickClient/Banshee.Sources.Gui src/Core/Hyena.Gui/Hyena.Data.Gui



Author: abock
Date: Thu Jan 31 04:34:40 2008
New Revision: 3111
URL: http://svn.gnome.org/viewvc/banshee?rev=3111&view=rev

Log:
2008-01-30  Aaron Bockover  <abock gnome org>

    * src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceRowRenderer.cs:
    Make the notification highlight extra sexy with some fade in and out

    * src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceView.cs:
    Set the stage duration to 1.5s

    * src/Core/Hyena.Gui/Hyena.Data.Gui/ListViewGraphics.cs: DrawRowSelection
    has a few new overrides including taking a color



Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceRowRenderer.cs
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceView.cs
   trunk/banshee/src/Core/Hyena.Gui/Hyena.Data.Gui/ListViewGraphics.cs

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceRowRenderer.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceRowRenderer.cs	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceRowRenderer.cs	Thu Jan 31 04:34:40 2008
@@ -100,11 +100,17 @@
                 TreeIter iter;
                 if (view.Model.GetIter (out iter, path) && view.NotifyStage.Contains (iter)) {
                     Actor<TreeIter> actor = view.NotifyStage[iter];
-                    Cairo.Color color = view.Graphics.GetWidgetColor (GtkColorClass.Background, StateType.Selected);
-                    color.A = 1.0 - actor.Percent; 
+                    Cairo.Color color = view.Graphics.GetWidgetColor (GtkColorClass.Background, StateType.Active);
                     
-                    view.Graphics.DrawFlatRowHighlight (view.Cr, background_area.X + 1, background_area.Y + 1, 
-                        background_area.Width - 2, background_area.Height - 2, color);
+                    double s = 0.2;
+                    double p = actor.Percent;
+                    
+                    color.A = p <= s 
+                        ? p * (1.0 / s)
+                        : 1.0 - (p + s) * (p - s);
+                        
+                    view.Graphics.DrawRowSelection (view.Cr, background_area.X + 1, background_area.Y + 1, 
+                        background_area.Width - 2, background_area.Height - 2, true, true, color);
                 }
             }
             

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceView.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceView.cs	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceView.cs	Thu Jan 31 04:34:40 2008
@@ -56,7 +56,7 @@
         private Cairo.Context cr;
         
         private uint user_update_timeout_id = 0;
-        private Stage<TreeIter> notify_stage = new Stage<TreeIter> ();
+        private Stage<TreeIter> notify_stage = new Stage<TreeIter> (1500);
         
         private TreeStore store;
         private TreeViewColumn focus_column;

Modified: trunk/banshee/src/Core/Hyena.Gui/Hyena.Data.Gui/ListViewGraphics.cs
==============================================================================
--- trunk/banshee/src/Core/Hyena.Gui/Hyena.Data.Gui/ListViewGraphics.cs	(original)
+++ trunk/banshee/src/Core/Hyena.Gui/Hyena.Data.Gui/ListViewGraphics.cs	Thu Jan 31 04:34:40 2008
@@ -284,13 +284,24 @@
         
         public void DrawRowSelection(Cairo.Context cr, int x, int y, int width, int height, bool filled)
         {
-            Cairo.Color selection_color = GetWidgetColor(GtkColorClass.Background, StateType.Selected);
+            DrawRowSelection(cr, x, y, width, height, filled, true, 
+                GetWidgetColor(GtkColorClass.Background, StateType.Selected));
+        }
+        
+        public void DrawRowSelection(Cairo.Context cr, int x, int y, int width, int height, 
+            bool filled, bool stroked, Cairo.Color color)
+        {
+            Cairo.Color selection_color = color;
             Cairo.Color selection_stroke = CairoExtensions.ColorShade(selection_color, 0.85);
+            selection_stroke.A = color.A;
             
             if (filled) {
                 Cairo.Color selection_fill_light = CairoExtensions.ColorShade(selection_color, 1.1);
                 Cairo.Color selection_fill_dark = CairoExtensions.ColorShade(selection_color, 0.90);
                 
+                selection_fill_light.A = color.A;
+                selection_fill_dark.A = color.A;
+                
                 LinearGradient grad = new LinearGradient(x, y, x, y + height);
                 grad.AddColorStop(0, selection_fill_light);
                 grad.AddColorStop(1, selection_fill_dark);
@@ -300,19 +311,14 @@
                 cr.Fill();
             }
             
-            cr.LineWidth = 1.0;
-            cr.Color = selection_stroke;
-            CairoExtensions.RoundedRectangle(cr, x + 0.5, y + 0.5, width - 1, height - 1, BorderRadius);
-            cr.Stroke();
+            if (stroked) {
+                cr.LineWidth = 1.0;
+                cr.Color = selection_stroke;
+                CairoExtensions.RoundedRectangle(cr, x + 0.5, y + 0.5, width - 1, height - 1, BorderRadius);
+                cr.Stroke();
+            }
         }
         
-        public void DrawFlatRowHighlight(Cairo.Context cr, int x, int y, int width, int height, Cairo.Color color)
-        {
-            cr.Color = color;
-            CairoExtensions.RoundedRectangle(cr, x, y, width, height, BorderRadius);
-            cr.Fill();
-        }
-                
         public void DrawRowRule(Cairo.Context cr, int x, int y, int width, int height)
         {
             cr.Color = rule_color;



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