changeset 97:8f5afab948a0

NotificationBar focus fix
author Goffi <goffi@goffi.org>
date Mon, 08 Sep 2014 15:42:25 +0200
parents 44fc94b0fe18
children 8bf5a35450f0
files urwid_satext/sat_widgets.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/urwid_satext/sat_widgets.py	Mon Sep 08 15:42:25 2014 +0200
+++ b/urwid_satext/sat_widgets.py	Mon Sep 08 15:42:25 2014 +0200
@@ -680,6 +680,8 @@
             self.progress.set_text('')
         else:
             self.progress.set_text(('notifs','%02i%%' % percentage))
+            if self.columns.focus != self.progress:
+                self.columns.focus_position = len(self.columns.contents)-1
         self._emit('change')
 
     def addPopUp(self, pop_up_widget):
@@ -708,6 +710,7 @@
             self.notifs.remove(found)
             self.message.set_text(('notifs',found[1]))
             self.__modQueue()
+            self.focus_possition = 1
         else:
             self.message.set_text('')
             self._emit('change')
@@ -729,7 +732,7 @@
         return not bool(self.notifs)
 
     def canHide(self):
-        """Return True if there is now important information to show"""
+        """Return True if there is no important information to show"""
         return self.isQueueEmpty() and not self.message.get_text() and not self.progress.get_text()