[gnome-games/gnome-3-0] sodoku: gi port, state/focus tracking work
- From: Thomas Hindoe Paaboel Andersen <thomashpa src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/gnome-3-0] sodoku: gi port, state/focus tracking work
- Date: Fri, 20 May 2011 21:16:57 +0000 (UTC)
commit 677b8ebfee01ae47eb40bd690dd2a1aae012df42
Author: John Stowers <john stowers gmail com>
Date: Sun May 1 12:05:45 2011 +1200
sodoku: gi port, state/focus tracking work
gnome-sudoku/src/lib/number_box.py | 18 +++++++-----------
1 files changed, 7 insertions(+), 11 deletions(-)
---
diff --git a/gnome-sudoku/src/lib/number_box.py b/gnome-sudoku/src/lib/number_box.py
index c482028..6f20036 100644
--- a/gnome-sudoku/src/lib/number_box.py
+++ b/gnome-sudoku/src/lib/number_box.py
@@ -125,6 +125,7 @@ class NumberBox (Gtk.DrawingArea):
self._top_note_layout.set_font_description(self.note_font)
self._bottom_note_layout = Pango.Layout(self.create_pango_context())
self._bottom_note_layout.set_font_description(self.note_font)
+ self._base_stateflags = Gtk.StateFlags.NORMAL
self.top_note_list = []
self.bottom_note_list = []
self.tinfo = tracker_info.TrackerInfo()
@@ -147,19 +148,19 @@ class NumberBox (Gtk.DrawingArea):
def pointer_enter_cb (self, *args):
if not self.is_focus():
- self.set_state(Gtk.StateFlags.PRELIGHT)
+ self.set_state_flags(Gtk.StateFlags.PRELIGHT, False)
def pointer_leave_cb (self, *args):
- self.set_state(self.base_state)
+ self.set_state_flags(self._base_stateflags, True)
self._toggle_box_drawing_(False)
def focus_in_cb (self, *args):
- self.set_state(Gtk.StateFlags.SELECTED)
- self.base_state = Gtk.StateFlags.SELECTED
+ self.set_state_flags(Gtk.StateFlags.SELECTED, True)
+ self._base_stateflags = Gtk.StateFlags.SELECTED
def focus_out_cb (self, *args):
- self.set_state(Gtk.StateFlags.NORMAL)
- self.base_state = Gtk.StateFlags.NORMAL
+ self.set_state_flags(Gtk.StateFlags.NORMAL, True)
+ self._base_stateflags = Gtk.StateFlags.NORMAL
self.destroy_npicker()
def destroy_npicker (self):
@@ -546,11 +547,6 @@ class NumberBox (Gtk.DrawingArea):
if self.draw_boxes and self.is_focus():
self.draw_note_area_highlight_box(cr, style_ctx)
- def is_focus(self):
- print "FIXME: is_focus always 0 (%s). state flags not updated (%s)" % (
- Gtk.DrawingArea.is_focus(self), self.get_state_flags())
- return True
-
def draw_background_color (self, cr, style_ctx, w, h):
if self.read_only:
if self.custom_background_color:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]