@@ -773,19 +773,17 @@ def __init__(self, view: Any) -> None:
773
773
self .view = view
774
774
self .controller = view .controller
775
775
self .menu_v = self .menu_view ()
776
+ self .pm_v = self .pm_view ()
776
777
self .stream_v = self .streams_view ()
777
778
778
779
self .is_in_topic_view = False
779
- contents = [(4 , self .menu_v ), self .stream_v ]
780
+ contents = [(3 , self .menu_v ), ( 2 , self . pm_v ), self .stream_v ]
780
781
super ().__init__ (contents )
781
782
782
783
def menu_view (self ) -> Any :
783
784
count = self .model .unread_counts .get ("all_msg" , 0 )
784
785
self .view .home_button = HomeButton (controller = self .controller , count = count )
785
786
786
- count = self .model .unread_counts .get ("all_pms" , 0 )
787
- self .view .pm_button = PMButton (controller = self .controller , count = count )
788
-
789
787
self .view .mentioned_button = MentionedButton (
790
788
controller = self .controller ,
791
789
count = self .model .unread_counts ["all_mentions" ],
@@ -798,13 +796,22 @@ def menu_view(self) -> Any:
798
796
)
799
797
menu_btn_list = [
800
798
self .view .home_button ,
801
- self .view .pm_button ,
802
799
self .view .mentioned_button ,
803
800
self .view .starred_button ,
804
801
]
805
802
w = urwid .ListBox (urwid .SimpleFocusListWalker (menu_btn_list ))
806
803
return w
807
804
805
+ def pm_view (self ) -> Any :
806
+ count = self .model .unread_counts .get ("all_pms" , 0 )
807
+ self .view .pm_button = PMButton (controller = self .controller , count = count )
808
+ self .view .pm_w = urwid .ListBox (
809
+ urwid .SimpleFocusListWalker (
810
+ [urwid .Divider (div_char = COLUMN_TITLE_BAR_LINE ), self .view .pm_button ]
811
+ )
812
+ )
813
+ return self .view .pm_w
814
+
808
815
def streams_view (self ) -> Any :
809
816
streams_btn_list = [
810
817
StreamButton (
@@ -894,11 +901,11 @@ def update_stream_view(self) -> None:
894
901
895
902
def show_stream_view (self ) -> None :
896
903
self .is_in_topic_view = False
897
- self .contents [1 ] = (self .stream_v , self .options (height_type = "weight" ))
904
+ self .contents [2 ] = (self .stream_v , self .options (height_type = "weight" ))
898
905
899
906
def show_topic_view (self , stream_button : Any ) -> None :
900
907
self .is_in_topic_view = True
901
- self .contents [1 ] = (
908
+ self .contents [2 ] = (
902
909
self .topics_view (stream_button ),
903
910
self .options (height_type = "weight" ),
904
911
)
@@ -907,7 +914,7 @@ def keypress(self, size: urwid_Size, key: str) -> Optional[str]:
907
914
if is_command_key ("SEARCH_STREAMS" , key ) or is_command_key (
908
915
"SEARCH_TOPICS" , key
909
916
):
910
- self .focus_position = 1
917
+ self .focus_position = 2
911
918
if self .is_in_topic_view :
912
919
self .view .topic_w .keypress (size , key )
913
920
else :
0 commit comments