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



Author: abock
Date: Thu Jan 31 00:18:41 2008
New Revision: 3106
URL: http://svn.gnome.org/viewvc/banshee?rev=3106&view=rev

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

    * src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceRowRenderer.cs:
    Use the list view theme engine to draw the highlight selection

    * src/Core/Hyena.Gui/Hyena.Data.Gui/ListViewGraphics.cs: Make it optional
    to draw the row selection fill



Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceRowRenderer.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 00:18:41 2008
@@ -91,9 +91,8 @@
                         background_area.Width - 2, background_area.Height - 2);
                 }
             } else if (path != null && path.Equals (view.HighlightedPath)) {
-                drawable.DrawRectangle (widget.Style.BackgroundGC (StateType.Selected), false,
-                    new Gdk.Rectangle (background_area.X + 1, background_area.Y + 1, 
-                        background_area.Width - 3, background_area.Height - 4));
+                    view.Graphics.DrawRowSelection (view.Cr, background_area.X + 1, background_area.Y + 1, 
+                        background_area.Width - 2, background_area.Height - 2, false);
             }
             
             int title_layout_width = 0, title_layout_height = 0;

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 00:18:41 2008
@@ -279,18 +279,26 @@
         
         public void DrawRowSelection(Cairo.Context cr, int x, int y, int width, int height)
         {
+            DrawRowSelection(cr, x, y, width, height, true);
+        }
+        
+        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);
             Cairo.Color selection_stroke = CairoExtensions.ColorShade(selection_color, 0.85);
-            Cairo.Color selection_fill_light = CairoExtensions.ColorShade(selection_color, 1.1);
-            Cairo.Color selection_fill_dark = CairoExtensions.ColorShade(selection_color, 0.90);
             
-            LinearGradient grad = new LinearGradient(x, y, x, y + height);
-            grad.AddColorStop(0, selection_fill_light);
-            grad.AddColorStop(1, selection_fill_dark);
-            
-            cr.Pattern = grad;
-            CairoExtensions.RoundedRectangle(cr, x, y, width, height, BorderRadius);
-            cr.Fill();
+            if (filled) {
+                Cairo.Color selection_fill_light = CairoExtensions.ColorShade(selection_color, 1.1);
+                Cairo.Color selection_fill_dark = CairoExtensions.ColorShade(selection_color, 0.90);
+                
+                LinearGradient grad = new LinearGradient(x, y, x, y + height);
+                grad.AddColorStop(0, selection_fill_light);
+                grad.AddColorStop(1, selection_fill_dark);
+                
+                cr.Pattern = grad;
+                CairoExtensions.RoundedRectangle(cr, x, y, width, height, BorderRadius);
+                cr.Fill();
+            }
             
             cr.LineWidth = 1.0;
             cr.Color = selection_stroke;



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