|
12 | 12 | import zulip
|
13 | 13 | from typing_extensions import Literal
|
14 | 14 |
|
| 15 | +from zulipterminal.config.keys import primary_key_for_command |
15 | 16 | from zulipterminal.config.themes import ThemeSpec
|
16 | 17 | from zulipterminal.helper import Message, asynch
|
17 | 18 | from zulipterminal.model import Model
|
18 | 19 | from zulipterminal.ui import Screen, View
|
| 20 | +from zulipterminal.ui_tools.boxes import MessageBox |
19 | 21 | from zulipterminal.ui_tools.utils import create_msg_box_list
|
20 | 22 | from zulipterminal.ui_tools.views import (
|
21 |
| - AboutView, EditHistoryView, EditModeView, HelpView, MsgInfoView, |
22 |
| - NoticeView, PopUpConfirmationView, StreamInfoView, StreamMembersView, |
| 23 | + AboutView, EditHistoryView, EditModeView, FullMsgView, HelpView, |
| 24 | + MsgInfoView, NoticeView, PopUpConfirmationView, StreamInfoView, |
| 25 | + StreamMembersView, |
23 | 26 | )
|
24 | 27 | from zulipterminal.version import ZT_VERSION
|
25 | 28 |
|
@@ -235,6 +238,26 @@ def show_about(self) -> None:
|
235 | 238 | 'area:help'
|
236 | 239 | )
|
237 | 240 |
|
| 241 | + def show_full_msg( |
| 242 | + self, message: Message, |
| 243 | + message_links: 'OrderedDict[str, Tuple[str, int, bool]]', |
| 244 | + time_mentions: List[Tuple[str, str]], |
| 245 | + ) -> None: |
| 246 | + msg_box = MessageBox(message, self.model, None) |
| 247 | + if not msg_box.need_recipient_header(): |
| 248 | + msg_box.widget_list.insert(0, msg_box.top_header_bar(msg_box)) |
| 249 | + |
| 250 | + header = msg_box.widget_list[:2] |
| 251 | + help_txt = ('Press {} to cycle b/w raw and rendered message' |
| 252 | + .format(primary_key_for_command('CYCLE_COMPOSE_FOCUS'))) |
| 253 | + header.append(urwid.Text(('area:help', help_txt), align='center')) |
| 254 | + content = msg_box.widget_list[2].original_widget[-1] |
| 255 | + self.show_pop_up( |
| 256 | + FullMsgView(self, message, message_links, time_mentions, content, |
| 257 | + 'Full message view (up/down scrolls)'), |
| 258 | + 'area:msg', urwid.Pile(header) |
| 259 | + ) |
| 260 | + |
238 | 261 | def show_edit_history(
|
239 | 262 | self, message: Message,
|
240 | 263 | message_links: 'OrderedDict[str, Tuple[str, int, bool]]',
|
|
0 commit comments