[hyena/gtk3] ComplexMenuItem: Use the "menuitem" class for proper theming



commit 0a6cd676c360618b886aae20b83a6b8abc3e044a
Author: Olivier Dufour <olivier duff gmail com>
Date:   Sat Jul 9 14:33:05 2011 +0200

    ComplexMenuItem: Use the "menuitem" class for proper theming
    
    Signed-off-by: Bertrand Lorentz <bertrand lorentz gmail com>

 Hyena.Gui/Hyena.Widgets/ComplexMenuItem.cs |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/Hyena.Gui/Hyena.Widgets/ComplexMenuItem.cs b/Hyena.Gui/Hyena.Widgets/ComplexMenuItem.cs
index 308dd6f..370c586 100644
--- a/Hyena.Gui/Hyena.Widgets/ComplexMenuItem.cs
+++ b/Hyena.Gui/Hyena.Widgets/ComplexMenuItem.cs
@@ -81,12 +81,12 @@ namespace Hyena.Widgets
                 width = Allocation.Width;
                 height = Allocation.Height;
 
-                //ShadowType shadow_type = (ShadowType)StyleGetProperty("selected-shadow-type");
+                StyleContext.Save ();
+                StyleContext.AddClass ("menuitem");
                 StyleContext.State = StateFlags.Prelight | StateFlags.Selected;
                 StyleContext.RenderFrame (args.Cr, x, y, width, height);
                 StyleContext.RenderBackground (args.Cr, x, y, width, height);
-                //Gtk.Style.PaintBox(Style, args.Cr, StateType.Prelight, shadow_type,
-                //    widget, "menuitem", x, y, width, height);
+                StyleContext.Restore ();
             } else {
 
                 args.Cr.Save ();
@@ -109,11 +109,13 @@ namespace Hyena.Widgets
                 y = Parent.Allocation.Y - widget.Allocation.Y;
                 width = Parent.Allocation.Width;
                 height = Parent.Allocation.Height;
+                
+                StyleContext.Save ();
+                StyleContext.AddClass ("menuitem");
                 StyleContext.State = StateFlags.Normal;
                 StyleContext.RenderFrame (args.Cr, x, y, width, height);
                 StyleContext.RenderBackground (args.Cr, x, y, width, height);
-                //Gtk.Style.PaintBox(Style, args.Cr, StateType.Normal, ShadowType.Out,
-                //    widget, "menu", x, y, width, height);
+                StyleContext.Restore ();
             }
         }
 



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