[kupfer] objects: composed default icon for RunnableLeaf



commit 0ed488a7cc07d888b6df25fe7195941f8e760804
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date:   Sat Jan 9 03:15:34 2010 +0100

    objects: composed default icon for RunnableLeaf
    
    Assign a "nice" icon for RunnableLeaf to use as default. It is a
    GIcon, so in get_gicon, we check if the subclass has overridden only
    get_icon_name, and then we use that instead.

 kupfer/objects.py |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/kupfer/objects.py b/kupfer/objects.py
index e721ccc..9f7f138 100644
--- a/kupfer/objects.py
+++ b/kupfer/objects.py
@@ -1062,6 +1062,13 @@ class RunnableLeaf (Leaf):
 		raise NotImplementedError
 	def repr_key(self):
 		return ""
+	def get_gicon(self):
+		iname = self.get_icon_name()
+		if iname:
+			return icons.get_gicon_with_fallbacks(None, (iname, ))
+		return icons.ComposedIcon("kupfer-object", "gtk-execute")
+	def get_icon_name(self):
+		return ""
 
 class Do (Action):
 	"""Perform the action in a RunnableLeaf"""



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