[kupfer] Make the icon set respond to style changes in GTK+



commit 81b74ce831aaeacfe479fb5438b29b616c7f6cd2
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date:   Fri Apr 1 00:00:35 2011 +0200

    Make the icon set respond to style changes in GTK+

 kupfer/plugin/asciiunicodeiconset.py |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/kupfer/plugin/asciiunicodeiconset.py b/kupfer/plugin/asciiunicodeiconset.py
index 85966e0..010375e 100644
--- a/kupfer/plugin/asciiunicodeiconset.py
+++ b/kupfer/plugin/asciiunicodeiconset.py
@@ -34,6 +34,14 @@ def text_color():
 
 class AsciiIconRenderer (object):
 	glyph_pixbuf_cache = {}
+	def __init__(self):
+		settings = gtk.settings_get_default()
+		settings.connect("notify::gtk-color-scheme", self._theme_change)
+
+	@classmethod
+	def _theme_change(cls, *ignored):
+		cls.glyph_pixbuf_cache.clear()
+
 	@classmethod
 	def pixbuf_for_name(cls, icon_name, size):
 		"""Return pixbuf at @size or None"""



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