diff frontends/primitivus/chat.py @ 125:8d611eb9ae48

primitivus: contact list enhancement - primitivus: contact list now display groups and sexy name (instead of bare jid) - primitivus: contact list now show an alert when somebody want to contact you, and its chat window is not on the screen - primitivus: cursor is now visible when going to chat window (useful to go back in logs)
author Goffi <goffi@goffi.org>
date Mon, 12 Jul 2010 17:50:00 +0800
parents 961e0898271f
children 1b33b681ebd8
line wrap: on
line diff
--- a/frontends/primitivus/chat.py	Thu Jul 08 19:47:54 2010 +0800
+++ b/frontends/primitivus/chat.py	Mon Jul 12 17:50:00 2010 +0800
@@ -48,7 +48,14 @@
         return self.display_widget(size, focus).rows(size, focus)
 
     def render(self, size, focus=False):
-        return self.display_widget(size, focus).render(size, focus)
+        canvas = urwid.CompositeCanvas(self.display_widget(size, focus).render(size, focus))
+        if focus:
+            canvas.set_cursor(self.get_cursor_coords(size))
+        return canvas
+
+    def get_cursor_coords(self, size):
+        #(maxcol,) = size
+        return 0, 0
 
     def display_widget(self, size, focus):
         my_mess = (self.from_jid.resource == self.parent.nick) if self.parent.type == "group" else (self.from_jid.short == self.my_jid.short) #mymess = True if message comes from local user
@@ -134,7 +141,7 @@
 
 
     def __buildPresentList(self):
-        self.present_wid = custom_widgets.GenericList([],option_type = custom_widgets.UnselectableText)
+        self.present_wid = custom_widgets.GenericList([],option_type = custom_widgets.ClickableText)
         return self.present_wid
    
     def __appendPresentPanel(self):