[hyena/gtk3] [gtk3] Revert GtkColors and GtkUtilities commit by mistake both need a big refactor to migrate old s



commit 925a0a9684c256dae4e3220791df918fc475266b
Author: Olivier Dufour <olivier duff gmail com>
Date:   Tue May 3 19:04:16 2011 +0200

    [gtk3] Revert GtkColors and GtkUtilities commit by mistake
    both need a big refactor to migrate old style system

 Hyena.Gui/Hyena.Gui.Theming/GtkColors.cs |   17 ++++++++++++-----
 Hyena.Gui/Hyena.Gui/GtkUtilities.cs      |    8 +++++---
 2 files changed, 17 insertions(+), 8 deletions(-)
---
diff --git a/Hyena.Gui/Hyena.Gui.Theming/GtkColors.cs b/Hyena.Gui/Hyena.Gui.Theming/GtkColors.cs
index 9da90fe..e278155 100644
--- a/Hyena.Gui/Hyena.Gui.Theming/GtkColors.cs
+++ b/Hyena.Gui/Hyena.Gui.Theming/GtkColors.cs
@@ -38,6 +38,7 @@ namespace Hyena.Gui.Theming
         Light,
         Dark,
         Text,
+        Mid,
         Border,
         Background,
         Foreground
@@ -114,7 +115,8 @@ namespace Hyena.Gui.Theming
 
             for (int c = 0, i = 0; c < cn; c++) {
                 for (int s = 0; s < sn; s++, i++) {
-                    Gdk.RGBA color = Gdk.RGBA.Zero;
+                    //Gdk.RGBA color = Gdk.RGBA.Zero;
+                    Gdk.Color color = Gdk.Color.Zero;
 
                     if (widget != null && widget.IsRealized) {
                         switch ((GtkColorClass)c) {
@@ -123,13 +125,18 @@ namespace Hyena.Gui.Theming
                             case GtkColorClass.Dark:       color = widget.Style.DarkColors[s];  break;
                             case GtkColorClass.Base:       color = widget.Style.BaseColors[s];  break;
                             case GtkColorClass.Text:       color = widget.Style.TextColors[s];  break;
-                            case GtkColorClass.Border:     widget.StyleContext.GetBorderColor (states[s], color); break;
-                            case GtkColorClass.Background: color = widget.StyleContext.GetBackgroundColor (states[s]); break;
-                            case GtkColorClass.Foreground: widget.StyleContext.GetColor (states[s], color); break;
+                            case GtkColorClass.Background:       color = widget.Style.Backgrounds[s];  break;
+                            case GtkColorClass.Foreground:       color = widget.Style.Foregrounds[s];  break;
+                            //case GtkColorClass.Border:     widget.StyleContext.GetBorderColor (states[s], color); break;
+                            //case GtkColorClass.Background: color = widget.StyleContext.GetBackgroundColor (states[s]); break;
+                            //case GtkColorClass.Foreground: widget.StyleContext.GetColor (states[s], color); break;
                         }
+                    } else {
+                        color = new Gdk.Color (0, 0, 0);
                     }
 
-                    gtk_colors[c * sn + s] = new Cairo.Color (color.Red, color.Green, color.Blue, color.Alpha);
+                    gtk_colors[c * sn + s] = CairoExtensions.GdkColorToCairoColor (color);
+                    //gtk_colors[c * sn + s] = new Cairo.Color (color.Red, color.Green, color.Blue, color.Alpha);
                 }
             }
 
diff --git a/Hyena.Gui/Hyena.Gui/GtkUtilities.cs b/Hyena.Gui/Hyena.Gui/GtkUtilities.cs
index 2fe635c..ab61abd 100644
--- a/Hyena.Gui/Hyena.Gui/GtkUtilities.cs
+++ b/Hyena.Gui/Hyena.Gui/GtkUtilities.cs
@@ -128,16 +128,18 @@ namespace Hyena.Gui
 
         public static void AdaptGtkRcStyle (Widget adaptee, GLib.GType adapter, string widgetPath, string classPath)
         {
-            StyleContext style = Gtk.Rc.GetStyleByPaths (adaptee.Settings, widgetPath, classPath, adapter);
+            Style style = Gtk.Rc.GetStyleByPaths (adaptee.Settings, widgetPath, classPath, adapter);
             if (style == null) {
                 return;
             }
 
-            foreach (StateFlags state in Enum.GetValues (typeof (StateFlags))) {
+            foreach (StateType state in Enum.GetValues (typeof (StateType))) {
                 adaptee.ModifyBase (state, style.Base (state));
                 adaptee.ModifyBg (state, style.Background (state));
-                adaptee.OverrideColor (state, style.Foreground (state));
+                adaptee.ModifyFg (state, style.Foreground (state));
                 adaptee.ModifyText (state, style.Text (state));
+                //adaptee.OverrideColor (state, style.Foreground (state));
+                //adaptee.ModifyText (state, style.Text (state));
             }
         }
 



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