[gnome-chess] Stop using deprecated Gtk.Widget.get_state ()



commit 16d6c77cda167f385ba28e079ea38eb124cab585
Author: Robert Ancell <robert ancell canonical com>
Date:   Tue Oct 15 11:17:05 2013 +1300

    Stop using deprecated Gtk.Widget.get_state ()

 src/chess-view-3d.vala |    4 ++--
 src/gnome-chess.vala   |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/chess-view-3d.vala b/src/chess-view-3d.vala
index a857c1e..6bc6f91 100644
--- a/src/chess-view-3d.vala
+++ b/src/chess-view-3d.vala
@@ -262,8 +262,8 @@ private class ChessView3D : ChessView
 
         for (var i = 0; i < n_passes; i++)
         {
-            var bg = style.bg[get_state ()];
-            glClearColor (bg.red / 65535.0f, bg.green / 65535.0f, bg.blue / 65535.0f, 1.0f);
+            var bg = get_style_context ().get_background_color (get_state_flags ());
+            glClearColor ((float) bg.red, (float) bg.green, (float) bg.blue, 1.0f);
             glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
 
             glEnable (GL_DEPTH_TEST);
diff --git a/src/gnome-chess.vala b/src/gnome-chess.vala
index 1f70559..81d470d 100644
--- a/src/gnome-chess.vala
+++ b/src/gnome-chess.vala
@@ -1395,7 +1395,7 @@ public class Application : Gtk.Application
     {
         double alpha = 1.0;
 
-        if (widget.get_state () == Gtk.StateType.INSENSITIVE)
+        if ((widget.get_state_flags () & Gtk.StateFlags.INSENSITIVE) != 0)
             alpha = 0.5;
         c.set_source_rgba (bg[0], bg[1], bg[2], alpha);
         c.paint ();


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