[hyena/gtk3] ListView: Add missing calls to StyleContext.Save () and Restore ()



commit 0f631c78d8b79c5f5cf03a9ac18cfe72b9b9b375
Author: Bertrand Lorentz <bertrand lorentz gmail com>
Date:   Mon Jul 25 22:32:32 2011 +0200

    ListView: Add missing calls to StyleContext.Save () and Restore ()
    
    Also remove a call to StyleContext.AddRegion before painting the header.
    I'm not sure we need to set regions for the header, and if we do, it
    should be done inside the PaintHeader method.

 .../Hyena.Data.Gui/ListView/ListView_Rendering.cs  |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Rendering.cs b/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Rendering.cs
index a9225f9..ee941fe 100644
--- a/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Rendering.cs
+++ b/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Rendering.cs
@@ -131,6 +131,7 @@ namespace Hyena.Data.Gui
                 OnMeasure ();
             }
             // treview style
+            StyleContext.Save ();
             StyleContext.AddClass ("view");
 
             StyleContext.RenderBackground (cr, Allocation.X, Allocation.Y, Allocation.Width, Allocation.Height);
@@ -138,10 +139,7 @@ namespace Hyena.Data.Gui
             // FIXME: ViewLayout will never be null in the future but we'll need
             // to deterministically render a header somehow...
             if (header_visible && ViewLayout == null && column_controller != null) {
-                StyleContext.AddRegion ("column-header", RegionFlags.First);
-                //TODO check flags
                 PaintHeader (cr);
-                StyleContext.RemoveRegion ("column-header");
             }
 
 
@@ -158,6 +156,7 @@ namespace Hyena.Data.Gui
             StyleContext.RenderFrame (cr, Allocation.X, Allocation.Y, Allocation.Width, Allocation.Height);
 
             PaintDraggingColumn (cr);
+            StyleContext.Restore ();
 
             return true;
         }



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