[banshee/a11y: 5/27] [a11y] Draw focused column header.



commit 3e08140ae2e866f7f451b6efb6732684196c8bcc
Author: Eitan Isaacson <eitan ascender com>
Date:   Wed Sep 30 09:48:48 2009 -0700

    [a11y] Draw focused column header.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=595299

 .../Hyena.Data.Gui/ListView/ListView_Rendering.cs  |    4 ++
 .../Hyena.Gui/Hyena.Gui.Theming/GtkTheme.cs        |   37 +++++++++++++++++++-
 src/Libraries/Hyena.Gui/Hyena.Gui.Theming/Theme.cs |    2 +
 3 files changed, 42 insertions(+), 1 deletions(-)
---
diff --git a/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Rendering.cs b/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Rendering.cs
index 5aa9e8d..b59bb16 100644
--- a/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Rendering.cs
+++ b/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Rendering.cs
@@ -160,6 +160,10 @@ namespace Hyena.Data.Gui
             if (ci < 0 || column_cache.Length <= ci)
                 return;
 
+            if (ci == Selection.FocusedColumnIndex && HasFocus && HeaderFocused) {
+                Theme.DrawColumnHeaderFocus (cairo_context, area);
+            }
+
             if (dragging) {
                 Theme.DrawColumnHighlight (cairo_context, area, 
                     CairoExtensions.ColorShade (Theme.Colors.GetWidgetColor (GtkColorClass.Dark, StateType.Normal), 0.9));
diff --git a/src/Libraries/Hyena.Gui/Hyena.Gui.Theming/GtkTheme.cs b/src/Libraries/Hyena.Gui/Hyena.Gui.Theming/GtkTheme.cs
index 401f781..368a1e8 100644
--- a/src/Libraries/Hyena.Gui/Hyena.Gui.Theming/GtkTheme.cs
+++ b/src/Libraries/Hyena.Gui/Hyena.Gui.Theming/GtkTheme.cs
@@ -186,7 +186,42 @@ namespace Hyena.Gui.Theming
             cr.Fill ();
             grad.Destroy ();
         }
-        
+
+        public override void DrawColumnHeaderFocus (Cairo.Context cr, Gdk.Rectangle alloc)
+        {
+            double top_offset = 2.0;
+            double right_offset = 2.0;
+
+            double margin = 0.5;
+            double line_width = 0.7;
+
+            Cairo.Color stroke_color = CairoExtensions.ColorShade (
+                Colors.GetWidgetColor (GtkColorClass.Background, StateType.Selected), 0.8);
+
+            stroke_color.A = 0.1;
+            cr.Color = stroke_color;
+
+            CairoExtensions.RoundedRectangle (cr,
+                alloc.X + margin + line_width + right_offset,
+                alloc.Y + margin + line_width + top_offset,
+                alloc.Width - (margin + line_width)*2.0 - right_offset,
+                alloc.Height - (margin + line_width)*2.0 - top_offset,
+                Context.Radius/2.0, CairoCorners.None);
+
+            cr.Fill();
+
+            stroke_color.A = 1.0;
+            cr.LineWidth = line_width;
+            cr.Color = stroke_color;
+            CairoExtensions.RoundedRectangle (cr,
+                alloc.X + margin + line_width + right_offset,
+                alloc.Y + margin + line_width + top_offset,
+                alloc.Width - (line_width + margin)*2.0 - right_offset,
+                alloc.Height - (line_width + margin)*2.0 - right_offset,
+                Context.Radius/2.0, CairoCorners.All);
+            cr.Stroke();
+        }
+
         public override void DrawHeaderSeparator (Cairo.Context cr, Gdk.Rectangle alloc, int x)
         {
             Cairo.Color gtk_background_color = Colors.GetWidgetColor (GtkColorClass.Background, StateType.Normal);
diff --git a/src/Libraries/Hyena.Gui/Hyena.Gui.Theming/Theme.cs b/src/Libraries/Hyena.Gui/Hyena.Gui.Theming/Theme.cs
index f870f4e..872cc12 100644
--- a/src/Libraries/Hyena.Gui/Hyena.Gui.Theming/Theme.cs
+++ b/src/Libraries/Hyena.Gui/Hyena.Gui.Theming/Theme.cs
@@ -115,6 +115,8 @@ namespace Hyena.Gui.Theming
         public abstract void DrawFrameBorder (Cairo.Context cr, Gdk.Rectangle alloc);
         
         public abstract void DrawHeaderBackground (Cairo.Context cr, Gdk.Rectangle alloc);
+
+        public abstract void DrawColumnHeaderFocus (Cairo.Context cr, Gdk.Rectangle alloc);
         
         public abstract void DrawHeaderSeparator(Cairo.Context cr, Gdk.Rectangle alloc, int x);
         



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