[hyena] Theming: Remove unneeded colors and methods



commit ca1af0493ac6c8a462cc2d18589c232cf7fd058c
Author: Bertrand Lorentz <bertrand lorentz gmail com>
Date:   Sun Jun 15 18:18:41 2014 +0200

    Theming: Remove unneeded colors and methods
    
    With all the changes in the ListView and other widgets, we don't need
    those methods and colors anymore.

 Hyena.Gui/Hyena.Gui.Theming/GtkTheme.cs |   10 ----------
 Hyena.Gui/Hyena.Gui.Theming/Theme.cs    |   25 +------------------------
 2 files changed, 1 insertions(+), 34 deletions(-)
---
diff --git a/Hyena.Gui/Hyena.Gui.Theming/GtkTheme.cs b/Hyena.Gui/Hyena.Gui.Theming/GtkTheme.cs
index ef87284..933e42a 100644
--- a/Hyena.Gui/Hyena.Gui.Theming/GtkTheme.cs
+++ b/Hyena.Gui/Hyena.Gui.Theming/GtkTheme.cs
@@ -34,7 +34,6 @@ namespace Hyena.Gui.Theming
 {
     public class GtkTheme : Theme
     {
-        private Cairo.Color rule_color;
         private Cairo.Color border_color;
 
         public GtkTheme (Widget widget) : base (widget)
@@ -52,8 +51,6 @@ namespace Hyena.Gui.Theming
         {
             base.OnColorsRefreshed ();
 
-            rule_color = CairoExtensions.ColorShade (ViewFill, 0.95);
-
             // On Windows we use Normal b/c Active incorrectly returns black (at least on XP)
             // TODO: Check if this is still needed with GTK 3
             border_color = CairoExtensions.GdkRGBAToCairoColor (Widget.StyleContext.GetBorderColor (
@@ -186,12 +183,5 @@ namespace Hyena.Gui.Theming
                 width - cr.LineWidth, height - cr.LineWidth, Context.Radius, corners, true);
             cr.Stroke ();
         }
-
-        public override void DrawRowRule (Cairo.Context cr, int x, int y, int width, int height)
-        {
-            cr.SetSourceColor (new Cairo.Color (rule_color.R, rule_color.G, rule_color.B, 
Context.FillAlpha));
-            cr.Rectangle (x, y, width, height);
-            cr.Fill ();
-        }
     }
 }
diff --git a/Hyena.Gui/Hyena.Gui.Theming/Theme.cs b/Hyena.Gui/Hyena.Gui.Theming/Theme.cs
index 458059b..b3bcd7c 100644
--- a/Hyena.Gui/Hyena.Gui.Theming/Theme.cs
+++ b/Hyena.Gui/Hyena.Gui.Theming/Theme.cs
@@ -41,12 +41,8 @@ namespace Hyena.Gui.Theming
         private static Cairo.Color black = new Cairo.Color (0, 0, 0);
         private Stack<ThemeContext> contexts = new Stack<ThemeContext> ();
 
-        private Cairo.Color selection_fill;
         private Cairo.Color selection_stroke;
 
-        private Cairo.Color view_fill;
-        private Cairo.Color view_fill_transparent;
-
         private Cairo.Color text_mid;
 
         public Widget Widget { get; private set; }
@@ -66,19 +62,14 @@ namespace Hyena.Gui.Theming
 
         protected virtual void OnColorsRefreshed ()
         {
-            selection_fill = CairoExtensions.GdkRGBAToCairoColor (Widget.StyleContext.GetBackgroundColor 
(StateFlags.Active));
-            selection_fill = CairoExtensions.ColorShade (selection_fill, 0.8);
             selection_stroke = CairoExtensions.GdkRGBAToCairoColor (Widget.StyleContext.GetBackgroundColor 
(StateFlags.Selected));
 
             Widget.StyleContext.Save ();
             Widget.StyleContext.AddClass ("entry");
-            view_fill = CairoExtensions.GdkRGBAToCairoColor (Widget.StyleContext.GetBackgroundColor 
(StateFlags.Normal));
+            var view_fill = CairoExtensions.GdkRGBAToCairoColor (Widget.StyleContext.GetBackgroundColor 
(StateFlags.Normal));
             var text_color = CairoExtensions.GdkRGBAToCairoColor (Widget.StyleContext.GetColor 
(StateFlags.Normal));
             Widget.StyleContext.Restore ();
 
-            view_fill_transparent = view_fill;
-            view_fill_transparent.A = 0;
-
             text_mid = CairoExtensions.AlphaBlend (view_fill, text_color, 0.5);
         }
 
@@ -149,20 +140,6 @@ namespace Hyena.Gui.Theming
 
         public abstract void DrawRowCursor (Cairo.Context cr, int x, int y, int width, int height, 
Cairo.Color color, CairoCorners corners);
 
-        public abstract void DrawRowRule (Cairo.Context cr, int x, int y, int width, int height);
-
-        public Cairo.Color ViewFill {
-            get { return view_fill; }
-        }
-
-        public Cairo.Color ViewFillTransparent {
-            get { return view_fill_transparent; }
-        }
-
-        public Cairo.Color SelectionFill {
-            get { return selection_fill; }
-        }
-
         public Cairo.Color SelectionStroke {
             get { return selection_stroke; }
         }


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