[banshee/gtk3] [widget] Fix StreamPositionLabel widget for gtk3



commit 2f4edcaf3c845426e20b3be0ae78cc03b8418887
Author: Olivier Dufour <olivier duff gmail com>
Date:   Sun Jul 3 17:47:01 2011 +0200

    [widget] Fix StreamPositionLabel widget for gtk3

 .../Banshee.Widgets/StreamPositionLabel.cs         |   22 +++++++++++--------
 1 files changed, 13 insertions(+), 9 deletions(-)
---
diff --git a/src/Core/Banshee.Widgets/Banshee.Widgets/StreamPositionLabel.cs b/src/Core/Banshee.Widgets/Banshee.Widgets/StreamPositionLabel.cs
index dbf63f7..7ad70c4 100644
--- a/src/Core/Banshee.Widgets/Banshee.Widgets/StreamPositionLabel.cs
+++ b/src/Core/Banshee.Widgets/Banshee.Widgets/StreamPositionLabel.cs
@@ -122,12 +122,16 @@ namespace Banshee.Widgets
                 bar_width -= 2 * Style.XThickness;
                 render_bar = true;
 
-                Gtk.Style.PaintBox (Style, GdkWindow, StateType.Normal, ShadowType.In, evnt.Area, this, null,
+                StyleContext.RenderBackground (cr,
+                    Allocation.X, Allocation.Y, Allocation.Width, Allocation.Height);
+                StyleContext.RenderFrame (cr,
                     Allocation.X, Allocation.Y, Allocation.Width, Allocation.Height);
 
                 if (bar_width > 0) {
-                    Gtk.Style.PaintBox (Style, GdkWindow, StateType.Selected, ShadowType.EtchedOut,
-                        evnt.Area, this, "bar",
+                    StyleContext.RenderBackground (cr,
+                        Allocation.X + Style.XThickness, Allocation.Y + Style.YThickness,
+                        bar_width, Allocation.Height - 2 * Style.YThickness);
+                    StyleContext.RenderFrame (cr,
                         Allocation.X + Style.XThickness, Allocation.Y + Style.YThickness,
                         bar_width, Allocation.Height - 2 * Style.YThickness);
                 }
@@ -138,18 +142,18 @@ namespace Banshee.Widgets
 
             int x = Allocation.X + ((Allocation.Width - width) / 2);
             int y = Allocation.Y + ((Allocation.Height - height) / 2);
-            Gdk.Rectangle rect = evnt.Area;
+            Gdk.Rectangle rect = Allocation;
 
             if (render_bar) {
                 width = bar_width + Style.XThickness;
-                rect = new Gdk.Rectangle (evnt.Area.X, evnt.Area.Y, width, evnt.Area.Height);
-                Gtk.Style.PaintLayout (Style, GdkWindow, StateType.Selected, true, rect, this, null, x, y, layout);
+                rect = new Gdk.Rectangle (Allocation.X, Allocation.Y, width, Allocation.Height);
+                StyleContext.RenderLayout (cr, x, y, layout);
 
                 rect.X += rect.Width;
-                rect.Width = evnt.Area.Width - rect.Width;
+                rect.Width = Allocation.Width - rect.Width;
             }
-
-            Gtk.Style.PaintLayout (Style, GdkWindow, StateType.Normal, false, rect, this, null, x, y, layout);
+//Set state to stateflags normal?
+            StyleContext.RenderLayout (cr, x, y, layout);
 
             return true;
         }



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