[hyena] TextBlock: Follow the overall widget state when rendering
- From: Bertrand Lorentz <blorentz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [hyena] TextBlock: Follow the overall widget state when rendering
- Date: Mon, 23 Jun 2014 14:13:52 +0000 (UTC)
commit 3e2604cf87e96666a90395b8c612c5f6018cbd16
Author: Bertrand Lorentz <bertrand lorentz gmail com>
Date: Mon Jun 23 16:10:10 2014 +0200
TextBlock: Follow the overall widget state when rendering
Make sure the text uses the right color, by setting and using the
correct StyleContext.State. This fixes the text color when the window is
not in the foreground (the "backdrop" state).
Hyena.Gui/Hyena.Gui.Canvas/TextBlock.cs | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/Hyena.Gui/Hyena.Gui.Canvas/TextBlock.cs b/Hyena.Gui/Hyena.Gui.Canvas/TextBlock.cs
index c3d5f39..6a85544 100644
--- a/Hyena.Gui/Hyena.Gui.Canvas/TextBlock.cs
+++ b/Hyena.Gui/Hyena.Gui.Canvas/TextBlock.cs
@@ -179,12 +179,13 @@ namespace Hyena.Gui.Canvas
var cr = context.Context;
context.StyleContext.Save ();
+ context.StyleContext.State |= context.State;
if (context.TextAsForeground) {
context.StyleContext.AddClass ("button");
} else {
context.StyleContext.AddClass ("entry");
}
- Foreground = new Brush (context.StyleContext.GetColor (context.State));
+ Foreground = new Brush (context.StyleContext.GetColor (context.StyleContext.State));
Brush foreground = Foreground;
if (!foreground.IsValid) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]