[gnome-games] Show error X in red



commit 9e00a1c02f45d93332f8d75c1fd8b8725e46bab6
Author: Robert Ancell <robert ancell gmail com>
Date:   Fri Apr 23 09:56:33 2010 +1000

    Show error X in red

 gnome-sudoku/src/lib/number_box.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gnome-sudoku/src/lib/number_box.py b/gnome-sudoku/src/lib/number_box.py
index d638e98..1e5db11 100644
--- a/gnome-sudoku/src/lib/number_box.py
+++ b/gnome-sudoku/src/lib/number_box.py
@@ -591,6 +591,7 @@ class NumberBox (gtk.Widget):
 class SudokuNumberBox (NumberBox):
 
     normal_color = None
+    error_color = (1.0, 0, 0)
     highlight_color = ERROR_HIGHLIGHT_COLOR
 
     def set_color (self, color):
@@ -602,7 +603,7 @@ class SudokuNumberBox (NumberBox):
 
     def set_error_highlight (self, val):
         if val:
-            self.set_text_color((1.0, 0, 0))
+            self.set_text_color(self.error_color)
         else:
             self.set_text_color(self.normal_color)
 
@@ -622,8 +623,10 @@ class SudokuNumberBox (NumberBox):
         if val:
             if not self.get_text():
                 self.set_text('X')
+                self.set_text_color(self.error_color)
         elif self.get_text() == 'X':
             self.set_text('')
+            self.set_text_color(self.normal_color)
         self.queue_draw()
 
 



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