@@ -763,19 +763,17 @@ def __init__(self, view: Any) -> None:
763
763
self .view = view
764
764
self .controller = view .controller
765
765
self .menu_v = self .menu_view ()
766
+ self .pm_v = self .pm_view ()
766
767
self .stream_v = self .streams_view ()
767
768
self .stream_panel = self .streams_panel (self .stream_v )
768
769
self .is_in_topic_view = False
769
- contents = [(4 , self .menu_v ), self .stream_panel ]
770
+ contents = [(3 , self .menu_v ), ( 2 , self . pm_v ), self .stream_panel ]
770
771
super ().__init__ (contents )
771
772
772
773
def menu_view (self ) -> Any :
773
774
count = self .model .unread_counts .get ("all_msg" , 0 )
774
775
self .view .home_button = HomeButton (controller = self .controller , count = count )
775
776
776
- count = self .model .unread_counts .get ("all_pms" , 0 )
777
- self .view .pm_button = PMButton (controller = self .controller , count = count )
778
-
779
777
self .view .mentioned_button = MentionedButton (
780
778
controller = self .controller ,
781
779
count = self .model .unread_counts ["all_mentions" ],
@@ -788,7 +786,6 @@ def menu_view(self) -> Any:
788
786
)
789
787
menu_btn_list = [
790
788
self .view .home_button ,
791
- self .view .pm_button ,
792
789
self .view .mentioned_button ,
793
790
self .view .starred_button ,
794
791
]
@@ -810,6 +807,16 @@ def streams_panel(self, submenu_view: Any) -> Any:
810
807
)
811
808
return w
812
809
810
+ def pm_view (self ) -> Any :
811
+ count = self .model .unread_counts .get ("all_pms" , 0 )
812
+ self .view .pm_button = PMButton (controller = self .controller , count = count )
813
+ self .view .pm_w = urwid .ListBox (
814
+ urwid .SimpleFocusListWalker (
815
+ [urwid .Divider (div_char = COLUMN_TITLE_BAR_LINE ), self .view .pm_button ]
816
+ )
817
+ )
818
+ return self .view .pm_w
819
+
813
820
def streams_view (self ) -> Any :
814
821
streams_btn_list = [
815
822
StreamButton (
@@ -889,12 +896,12 @@ def update_stream_view(self) -> None:
889
896
def show_stream_view (self ) -> None :
890
897
self .is_in_topic_view = False
891
898
self .stream_panel = self .streams_panel (self .stream_v )
892
- self .contents [1 ] = (self .stream_panel , self .options (height_type = "weight" ))
899
+ self .contents [2 ] = (self .stream_panel , self .options (height_type = "weight" ))
893
900
894
901
def show_topic_view (self , stream_button : Any ) -> None :
895
902
self .is_in_topic_view = True
896
903
self .stream_panel = self .streams_panel (self .topics_view (stream_button ))
897
- self .contents [1 ] = (
904
+ self .contents [2 ] = (
898
905
self .stream_panel ,
899
906
self .options (height_type = "weight" ),
900
907
)
@@ -903,7 +910,7 @@ def keypress(self, size: urwid_Size, key: str) -> Optional[str]:
903
910
if is_command_key ("SEARCH_STREAMS" , key ) or is_command_key (
904
911
"SEARCH_TOPICS" , key
905
912
):
906
- self .focus_position = 1
913
+ self .focus_position = 2
907
914
if self .is_in_topic_view :
908
915
self .view .topic_w .keypress (size , key )
909
916
else :
0 commit comments