示例#1
0
    def menu_view(self) -> Any:
        count = self.model.unread_counts.get('all_msg', 0)
        self.view.home_button = HomeButton(self.controller,
                                           count=count,
                                           width=self.width)

        count = self.model.unread_counts.get('all_pms', 0)
        self.view.pm_button = PMButton(self.controller,
                                       count=count,
                                       width=self.width)

        self.view.mentioned_button = MentionedButton(
            self.controller,
            width=self.width,
            count=self.model.unread_counts['all_mentions'])

        # Starred messages are by definition read already
        self.view.starred_button = StarredButton(self.controller,
                                                 width=self.width)

        menu_btn_list = [
            self.view.home_button,
            self.view.pm_button,
            self.view.mentioned_button,
            self.view.starred_button,
        ]
        w = urwid.ListBox(urwid.SimpleFocusListWalker(menu_btn_list))
        return w
示例#2
0
 def menu_view(self) -> None:
     menu_btn_list = [
         HomeButton(self.controller),
         PMButton(self.controller),
     ]
     w = urwid.ListBox(urwid.SimpleFocusListWalker(menu_btn_list))
     return w
示例#3
0
 def menu_view(self) -> Any:
     count = self.model.unread_counts.get('all_msg', 0)
     self.view.home_button = HomeButton(self.controller, count=count)
     count = self.model.unread_counts.get('all_pms', 0)
     self.view.pm_button = PMButton(self.controller, count=count)
     menu_btn_list = [
         self.view.home_button,
         self.view.pm_button,
     ]
     w = urwid.ListBox(urwid.SimpleFocusListWalker(menu_btn_list))
     return w