[banshee/a11y: 7/27] [a11y] Make border bolder when in focus.



commit 84d7909d29a9957be78825773719b5b0bccbea4c
Author: Eitan Isaacson <eitan ascender com>
Date:   Thu Oct 1 16:46:24 2009 -0700

    [a11y] Make border bolder when in focus.

 .../Hyena.Data.Gui/ListView/ListView_Rendering.cs  |    8 ++++++--
 .../Hyena.Gui/Hyena.Gui.Theming/GtkTheme.cs        |   14 ++++++++++++--
 src/Libraries/Hyena.Gui/Hyena.Gui.Theming/Theme.cs |    2 ++
 3 files changed, 20 insertions(+), 4 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 88fa8bd..f97817a 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
@@ -102,8 +102,12 @@ namespace Hyena.Data.Gui
             if (header_visible && column_controller != null) {
                 PaintHeader (damage);
             }
-           
-            Theme.DrawFrameBorder (cairo_context, Allocation);
+
+            if (HasFocus)
+                Theme.DrawFrameBorderFocused (cairo_context, Allocation);
+            else
+                Theme.DrawFrameBorder (cairo_context, Allocation);
+
             if (Model != null) {
                 PaintRows(damage);
             }
diff --git a/src/Libraries/Hyena.Gui/Hyena.Gui.Theming/GtkTheme.cs b/src/Libraries/Hyena.Gui/Hyena.Gui.Theming/GtkTheme.cs
index 73aab20..028f2ed 100644
--- a/src/Libraries/Hyena.Gui/Hyena.Gui.Theming/GtkTheme.cs
+++ b/src/Libraries/Hyena.Gui/Hyena.Gui.Theming/GtkTheme.cs
@@ -143,9 +143,19 @@ namespace Hyena.Gui.Theming
         {
             cr.LineWidth = BorderWidth;
             cr.Color = border_color;
-            double offset = (double)BorderWidth / 2.0;
+            double offset = (double)cr.LineWidth / 2.0;
             CairoExtensions.RoundedRectangle (cr, alloc.X + offset, alloc.Y + offset,
-                alloc.Width - BorderWidth, alloc.Height - BorderWidth, Context.Radius, CairoCorners.All);
+                alloc.Width - cr.LineWidth, alloc.Height - cr.LineWidth, Context.Radius, CairoCorners.All);
+            cr.Stroke();
+        }
+
+        public override void DrawFrameBorderFocused (Cairo.Context cr, Gdk.Rectangle alloc)
+        {
+            cr.LineWidth = BorderWidth*1.5;
+            cr.Color = CairoExtensions.ColorShade (border_color, 0.8);
+            double offset = (double)cr.LineWidth / 2.0;
+            CairoExtensions.RoundedRectangle (cr, alloc.X + offset, alloc.Y + offset,
+                alloc.Width - cr.LineWidth, alloc.Height - cr.LineWidth, Context.Radius, CairoCorners.All);
             cr.Stroke();
         }
         
diff --git a/src/Libraries/Hyena.Gui/Hyena.Gui.Theming/Theme.cs b/src/Libraries/Hyena.Gui/Hyena.Gui.Theming/Theme.cs
index a34db23..a741e19 100644
--- a/src/Libraries/Hyena.Gui/Hyena.Gui.Theming/Theme.cs
+++ b/src/Libraries/Hyena.Gui/Hyena.Gui.Theming/Theme.cs
@@ -114,6 +114,8 @@ namespace Hyena.Gui.Theming
         
         public abstract void DrawFrameBorder (Cairo.Context cr, Gdk.Rectangle alloc);
         
+        public abstract void DrawFrameBorderFocused (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);



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