16
16
from zulipterminal .helper import (
17
17
Message , asynch , edit_mode_captions , match_stream , match_user ,
18
18
)
19
- from zulipterminal .ui_tools .boxes import PanelSearchBox
19
+ from zulipterminal .ui_tools .boxes import MessageBox , PanelSearchBox
20
20
from zulipterminal .ui_tools .buttons import (
21
21
HomeButton , MentionedButton , MessageLinkButton , PMButton , StarredButton ,
22
22
StreamButton , TopicButton , UnreadPMButton , UserButton ,
@@ -1078,8 +1078,11 @@ def __init__(self, controller: Any, stream_id: int) -> None:
1078
1078
self .controller = controller
1079
1079
stream = controller .model .stream_dict [stream_id ]
1080
1080
title = '# {}' .format (stream ['name' ])
1081
- desc = stream ['description' ]
1082
- stream_info_content = [('' , [desc ]), ('Stream settings' , [])]
1081
+ rendered_desc = stream ['rendered_description' ]
1082
+
1083
+ stream_info_content = (
1084
+ [('Stream settings' , [])]
1085
+ ) # type: PopUpViewTableContent
1083
1086
popup_width , column_widths = self .calculate_table_widths (
1084
1087
stream_info_content , len (title ))
1085
1088
@@ -1095,12 +1098,23 @@ def __init__(self, controller: Any, stream_id: int) -> None:
1095
1098
urwid .connect_signal (pinned_setting , 'change' ,
1096
1099
self .toggle_pinned_status )
1097
1100
1101
+ self .markup_desc , * _ = MessageBox .transform_content (
1102
+ rendered_desc ,
1103
+ self .controller .model .server_url ,
1104
+ )
1105
+ desc = urwid .Text (self .markup_desc )
1106
+
1098
1107
# Manual because calculate_table_widths does not support checkboxes.
1099
1108
# Add 4 to checkbox label to accomodate the checkbox itself.
1100
1109
popup_width = max (popup_width , len (muted_setting .label ) + 4 ,
1101
- len (pinned_setting .label ) + 4 )
1110
+ len (pinned_setting .label ) + 4 , desc . pack ()[ 0 ] )
1102
1111
self .widgets = self .make_table_with_categories (stream_info_content ,
1103
1112
column_widths )
1113
+
1114
+ # Stream description.
1115
+ self .widgets .insert (0 , desc )
1116
+ self .widgets .insert (1 , urwid .Text ('' )) # Add a newline.
1117
+
1104
1118
self .widgets .append (muted_setting )
1105
1119
self .widgets .append (pinned_setting )
1106
1120
super ().__init__ (controller , self .widgets , 'STREAM_DESC' , popup_width ,
0 commit comments