comparison urwid_satext/sat_widgets.py @ 97:8f5afab948a0

NotificationBar focus fix
author Goffi <goffi@goffi.org>
date Mon, 08 Sep 2014 15:42:25 +0200
parents 44fc94b0fe18
children 8bf5a35450f0
comparison
equal deleted inserted replaced
96:44fc94b0fe18 97:8f5afab948a0
678 """Define the progression to show on the right side of the bar""" 678 """Define the progression to show on the right side of the bar"""
679 if percentage == None: 679 if percentage == None:
680 self.progress.set_text('') 680 self.progress.set_text('')
681 else: 681 else:
682 self.progress.set_text(('notifs','%02i%%' % percentage)) 682 self.progress.set_text(('notifs','%02i%%' % percentage))
683 if self.columns.focus != self.progress:
684 self.columns.focus_position = len(self.columns.contents)-1
683 self._emit('change') 685 self._emit('change')
684 686
685 def addPopUp(self, pop_up_widget): 687 def addPopUp(self, pop_up_widget):
686 """Add a popup to the waiting queue""" 688 """Add a popup to the waiting queue"""
687 self.notifs.append(('popup',pop_up_widget)) 689 self.notifs.append(('popup',pop_up_widget))
706 break 708 break
707 if found: 709 if found:
708 self.notifs.remove(found) 710 self.notifs.remove(found)
709 self.message.set_text(('notifs',found[1])) 711 self.message.set_text(('notifs',found[1]))
710 self.__modQueue() 712 self.__modQueue()
713 self.focus_possition = 1
711 else: 714 else:
712 self.message.set_text('') 715 self.message.set_text('')
713 self._emit('change') 716 self._emit('change')
714 717
715 def getNextPopup(self): 718 def getNextPopup(self):
727 730
728 def isQueueEmpty(self): 731 def isQueueEmpty(self):
729 return not bool(self.notifs) 732 return not bool(self.notifs)
730 733
731 def canHide(self): 734 def canHide(self):
732 """Return True if there is now important information to show""" 735 """Return True if there is no important information to show"""
733 return self.isQueueEmpty() and not self.message.get_text() and not self.progress.get_text() 736 return self.isQueueEmpty() and not self.message.get_text() and not self.progress.get_text()
734 737
735 738
736 class MenuBox(urwid.WidgetWrap): 739 class MenuBox(urwid.WidgetWrap):
737 """Show menu items of a category in a box""" 740 """Show menu items of a category in a box"""