finch/libgnt/pygnt/example/rss/gntrss-ui.py

changeset 19178
952bf9cb471d
parent 19176
487103c2e783
child 19179
b3e5a04d839f
--- a/finch/libgnt/pygnt/example/rss/gntrss-ui.py	Sun Jul 29 07:59:10 2007 +0000
+++ b/finch/libgnt/pygnt/example/rss/gntrss-ui.py	Sun Jul 29 10:37:10 2007 +0000
@@ -71,12 +71,15 @@
     if property.name == 'unread':
         if feeds.active != item.parent:
             return
+        flag = 0
+        if item == items.active:
+            flag = gnt.TEXT_FLAG_UNDERLINE
         if item.unread:
             item.parent.unread = item.parent.unread + 1
-            items.set_row_flags(item, gnt.TEXT_FLAG_BOLD)
+            items.set_row_flags(item, flag | gnt.TEXT_FLAG_BOLD)
         else:
             item.parent.unread = item.parent.unread - 1
-            items.set_row_flags(item, gnt.TEXT_FLAG_NORMAL)
+            items.set_row_flags(item, flag | gnt.TEXT_FLAG_NORMAL)
         item.parent.notify('unread')
 
 def add_feed_item(item):
@@ -158,6 +161,8 @@
     details.scroll(0)
     if item.unread:
         item.set_property('unread', False)
+    if old and old.unread:
+        old.set_property('unread', True)
 
 #
 # Look for action keys in the feed-item list.
@@ -170,9 +175,13 @@
     elif text == 'm':     # Mark the current item 'read'
         if current.unread:
             current.set_property('unread', False)
+        tree.perform_action_key('j')
     elif text == 'U':     # Mark the current item 'unread'
         if not current.unread:
             current.set_property('unread', True)
+    elif text == 'd':
+        current.remove()
+        tree.perform_action_key('j')
     else:
         return False
     return True

mercurial