[hyena/gtk3] Fix StyleContext.GetColor usage



commit adfe8fe13b95c8bbc32c9dfa217228bac27c92a1
Author: Gabriel Burt <gabriel burt gmail com>
Date:   Mon May 9 14:57:24 2011 -0500

    Fix StyleContext.GetColor usage

 .../Hyena.Data.Gui/ListView/ListView_Header.cs     |    6 ++----
 Hyena.Gui/Hyena.Gui.Theming/GtkTheme.cs            |    3 +--
 Hyena.Gui/Hyena.Widgets/RatingEntry.cs             |    3 +--
 Hyena.Gui/Hyena.Widgets/SegmentedBar.cs            |    3 +--
 4 files changed, 5 insertions(+), 10 deletions(-)
---
diff --git a/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Header.cs b/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Header.cs
index 1a85b7e..b8bcf77 100644
--- a/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Header.cs
+++ b/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Header.cs
@@ -582,8 +582,7 @@ namespace Hyena.Data.Gui
             protected override void OnStyleUpdated ()
             {
                 base.OnStyleUpdated ();
-                Gdk.RGBA rgba;
-                StyleContext.GetColor (StateFlags.Selected, rgba);
+                Gdk.RGBA rgba = StyleContext.GetColor (StateFlags.Selected);
                 label.OverrideColor (StateFlags.Prelight, rgba);
             }
 
@@ -621,8 +620,7 @@ namespace Hyena.Data.Gui
             protected override void OnStyleUpdated ()
             {
                 base.OnStyleUpdated ();
-                Gdk.RGBA rgba;
-                StyleContext.GetColor (StateFlags.Selected, rgba);
+                Gdk.RGBA rgba = StyleContext.GetColor (StateFlags.Selected);
                 label.OverrideColor (StateFlags.Prelight, rgba);
             }
 
diff --git a/Hyena.Gui/Hyena.Gui.Theming/GtkTheme.cs b/Hyena.Gui/Hyena.Gui.Theming/GtkTheme.cs
index 21567f3..c2dfdfc 100644
--- a/Hyena.Gui/Hyena.Gui.Theming/GtkTheme.cs
+++ b/Hyena.Gui/Hyena.Gui.Theming/GtkTheme.cs
@@ -43,8 +43,7 @@ namespace Hyena.Gui.Theming
 
         public static Cairo.Color GetCairoTextMidColor (Widget widget)
         {
-            Gdk.RGBA color;
-            widget.StyleContext.GetColor (StateFlags.Normal, color);
+            Gdk.RGBA color = widget.StyleContext.GetColor (StateFlags.Normal);
             Cairo.Color text_color = new Cairo.Color (color.Red, color.Green, color.Blue, color.Alpha);
             color = widget.StyleContext.GetBackgroundColor (StateFlags.Normal);
             Cairo.Color background_color = new Cairo.Color (color.Red, color.Green, color.Blue, color.Alpha);
diff --git a/Hyena.Gui/Hyena.Widgets/RatingEntry.cs b/Hyena.Gui/Hyena.Widgets/RatingEntry.cs
index 1f02384..93ad69a 100644
--- a/Hyena.Gui/Hyena.Widgets/RatingEntry.cs
+++ b/Hyena.Gui/Hyena.Widgets/RatingEntry.cs
@@ -284,8 +284,7 @@ namespace Hyena.Widgets
                 //    this, "entry", Allocation.X, Allocation.Y + y_mid, Allocation.Width, renderer.Height);
             }
 
-            Gdk.RGBA rgba;
-            Parent.StyleContext.GetColor (StateFlags, rgba);
+            Gdk.RGBA rgba = Parent.StyleContext.GetColor (StateFlags);
 
             CairoHelper.TransformToWindow (cr, this, Window);
             renderer.Render (cr, Allocation,
diff --git a/Hyena.Gui/Hyena.Widgets/SegmentedBar.cs b/Hyena.Gui/Hyena.Widgets/SegmentedBar.cs
index a18ffd6..1d368a7 100644
--- a/Hyena.Gui/Hyena.Widgets/SegmentedBar.cs
+++ b/Hyena.Gui/Hyena.Widgets/SegmentedBar.cs
@@ -484,8 +484,7 @@ namespace Hyena.Widgets
             }
 
             Pango.Layout layout = null;
-            Gdk.RGBA rgba;
-            StyleContext.GetColor (StateFlags, rgba);
+            Gdk.RGBA rgba = StyleContext.GetColor (StateFlags);
             Color text_color = new Cairo.Color (rgba.Red, rgba.Green, rgba.Blue, rgba.Alpha);
             Color box_stroke_color = new Color (0, 0, 0, 0.6);
 



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