[hyena] Theming: Remove DrawListBackground methods
- From: Bertrand Lorentz <blorentz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [hyena] Theming: Remove DrawListBackground methods
- Date: Sat, 14 Jun 2014 18:48:43 +0000 (UTC)
commit bbb94ffe1a727c05329e2bda939a745b38ce86da
Author: Bertrand Lorentz <bertrand lorentz gmail com>
Date: Sat Jun 14 19:36:18 2014 +0200
Theming: Remove DrawListBackground methods
They are not used anymore, except in the Theme test module. Update that
test to use StyleContext, like the ListView does.
Hyena.Gui/Hyena.Gui.Theming/GtkTheme.cs | 8 --------
Hyena.Gui/Hyena.Gui.Theming/Theme.cs | 16 ----------------
Hyena.Gui/Hyena.Gui.Theming/ThemeTestModule.cs | 5 ++++-
3 files changed, 4 insertions(+), 25 deletions(-)
---
diff --git a/Hyena.Gui/Hyena.Gui.Theming/GtkTheme.cs b/Hyena.Gui/Hyena.Gui.Theming/GtkTheme.cs
index fefff3d..d27f779 100644
--- a/Hyena.Gui/Hyena.Gui.Theming/GtkTheme.cs
+++ b/Hyena.Gui/Hyena.Gui.Theming/GtkTheme.cs
@@ -184,14 +184,6 @@ namespace Hyena.Gui.Theming
}
}
- public override void DrawListBackground (Context cr, Gdk.Rectangle alloc, Color color)
- {
- color.A = Context.FillAlpha;
- cr.SetSourceColor (color);
- cr.Rectangle (alloc.X, alloc.Y, alloc.Width, alloc.Height);
- cr.Fill ();
- }
-
public override void DrawRowCursor (Cairo.Context cr, int x, int y, int width, int height,
Cairo.Color color, CairoCorners corners)
{
diff --git a/Hyena.Gui/Hyena.Gui.Theming/Theme.cs b/Hyena.Gui/Hyena.Gui.Theming/Theme.cs
index fab8a70..f9c007d 100644
--- a/Hyena.Gui/Hyena.Gui.Theming/Theme.cs
+++ b/Hyena.Gui/Hyena.Gui.Theming/Theme.cs
@@ -134,22 +134,6 @@ namespace Hyena.Gui.Theming
public abstract void DrawFrameBorder (Cairo.Context cr, Gdk.Rectangle alloc);
- public void DrawListBackground (Cairo.Context cr, Gdk.Rectangle alloc, bool baseColor)
- {
- Cairo.Color fill_color;
- if (baseColor) {
- Widget.StyleContext.Save ();
- Widget.StyleContext.AddClass ("entry");
- fill_color = CairoExtensions.GdkRGBAToCairoColor (Widget.StyleContext.GetBackgroundColor
(StateFlags.Normal));
- Widget.StyleContext.Restore ();
- } else {
- fill_color = CairoExtensions.GdkRGBAToCairoColor (Widget.StyleContext.GetBackgroundColor
(StateFlags.Normal));
- }
- DrawListBackground (cr, alloc, fill_color);
- }
-
- public abstract void DrawListBackground (Cairo.Context cr, Gdk.Rectangle alloc, Cairo.Color color);
-
public void DrawColumnHighlight (Cairo.Context cr, double cellWidth, double cellHeight)
{
Gdk.Rectangle alloc = new Gdk.Rectangle ();
diff --git a/Hyena.Gui/Hyena.Gui.Theming/ThemeTestModule.cs b/Hyena.Gui/Hyena.Gui.Theming/ThemeTestModule.cs
index 7452520..9c59be2 100644
--- a/Hyena.Gui/Hyena.Gui.Theming/ThemeTestModule.cs
+++ b/Hyena.Gui/Hyena.Gui.Theming/ThemeTestModule.cs
@@ -89,8 +89,11 @@ namespace Hyena.Gui.Theming
Height = Allocation.Height
};
- theme.DrawListBackground (cr, alloc, true);
+ StyleContext.Save ();
+ StyleContext.AddClass ("view");
+ StyleContext.RenderBackground (cr, alloc.X, alloc.Y, alloc.Width, alloc.Height);
theme.DrawFrameBorder (cr, alloc);
+ StyleContext.Restore ();
return true;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]