14
14
from zulipterminal .helper import (
15
15
Message , asynch , edit_mode_captions , match_stream , match_user ,
16
16
)
17
- from zulipterminal .ui_tools .boxes import PanelSearchBox
17
+ from zulipterminal .ui_tools .boxes import MessageBox , PanelSearchBox
18
18
from zulipterminal .ui_tools .buttons import (
19
19
HomeButton , MentionedButton , MessageLinkButton , PMButton , StarredButton ,
20
20
StreamButton , TopicButton , UnreadPMButton , UserButton ,
@@ -1047,8 +1047,11 @@ def __init__(self, controller: Any, stream_id: int) -> None:
1047
1047
self .controller = controller
1048
1048
stream = controller .model .stream_dict [stream_id ]
1049
1049
title = '# {}' .format (stream ['name' ])
1050
- desc = stream ['description' ]
1051
- stream_info_content = [('' , [desc ]), ('Stream settings' , [])]
1050
+ rendered_desc = stream ['rendered_description' ]
1051
+
1052
+ stream_info_content = (
1053
+ [('Stream settings' , [])]
1054
+ ) # type: PopUpViewTableContent
1052
1055
popup_width , column_widths = self .calculate_table_widths (
1053
1056
stream_info_content , len (title ))
1054
1057
@@ -1064,12 +1067,23 @@ def __init__(self, controller: Any, stream_id: int) -> None:
1064
1067
urwid .connect_signal (pinned_setting , 'change' ,
1065
1068
self .toggle_pinned_status )
1066
1069
1070
+ markup_desc , * _ = MessageBox .transform_content (
1071
+ rendered_desc ,
1072
+ self .controller .model .server_url ,
1073
+ )
1074
+ desc = urwid .Text (markup_desc )
1075
+
1067
1076
# Manual because calculate_table_widths does not support checkboxes.
1068
1077
# Add 4 to checkbox label to accomodate the checkbox itself.
1069
1078
popup_width = max (popup_width , len (muted_setting .label ) + 4 ,
1070
- len (pinned_setting .label ) + 4 )
1079
+ len (pinned_setting .label ) + 4 , desc . pack ()[ 0 ] )
1071
1080
self .widgets = self .make_table_with_categories (stream_info_content ,
1072
1081
column_widths )
1082
+
1083
+ # Stream description.
1084
+ self .widgets .insert (0 , desc )
1085
+ self .widgets .insert (1 , urwid .Text ('' )) # Add a newline.
1086
+
1073
1087
self .widgets .append (muted_setting )
1074
1088
self .widgets .append (pinned_setting )
1075
1089
super ().__init__ (controller , self .widgets , 'STREAM_DESC' , popup_width ,
0 commit comments