OSDN Git Service

Selected text colors follow the focus in ThreadView.
authorAiwota Programmer <aiwotaprog@tetteke.tk>
Sun, 3 May 2009 11:09:35 +0000 (20:09 +0900)
committerAiwota Programmer <aiwotaprog@tetteke.tk>
Sun, 3 May 2009 11:09:35 +0000 (20:09 +0900)
src/FukuiNoNamari/thread_view.py

index c07dc26..d7b0b43 100644 (file)
@@ -218,8 +218,12 @@ class ElementText:
     def draw(self, drawingarea, y_offset, pango_layout,
              selection=False, start_index=0, end_index=0xffffff):
 
     def draw(self, drawingarea, y_offset, pango_layout,
              selection=False, start_index=0, end_index=0xffffff):
 
-        selection_fg = drawingarea.style.text[gtk.STATE_SELECTED]
-        selection_bg = drawingarea.style.base[gtk.STATE_SELECTED]
+        if drawingarea.get_property("has-focus"):
+            selection_fg = drawingarea.style.text[gtk.STATE_SELECTED]
+            selection_bg = drawingarea.style.base[gtk.STATE_SELECTED]
+        else:
+            selection_fg = drawingarea.style.text[gtk.STATE_ACTIVE]
+            selection_bg = drawingarea.style.base[gtk.STATE_ACTIVE]
 
         for line in self.line_list:
 
 
         for line in self.line_list: