Skip to content

Commit 3998e58

Browse files
committed
mypy: Improve mouse_event signatures based on urwid docs.
1 parent 053838a commit 3998e58

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

zulipterminal/ui_tools/boxes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -646,8 +646,8 @@ def selectable(self) -> bool:
646646
# is designed to take focus.
647647
return True
648648

649-
def mouse_event(self, size: urwid_Size, event: Any, button: Any,
650-
col: int, row: int, focus: int) -> Union[bool, Any]:
649+
def mouse_event(self, size: urwid_Size, event: str, button: int,
650+
col: int, row: int, focus: bool) -> bool:
651651
if event == 'mouse press':
652652
if button == 1:
653653
self.keypress(size, 'enter')

zulipterminal/ui_tools/views.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def load_new_messages(self, anchor: int) -> None:
132132
self.new_loading = False
133133

134134
def mouse_event(self, size: urwid_Size, event: str, button: int, col: int,
135-
row: int, focus: Any) -> Any:
135+
row: int, focus: bool) -> bool:
136136
if event == 'mouse press':
137137
if button == 4:
138138
self.keypress(size, 'up')
@@ -280,7 +280,7 @@ def update_streams(self, search_box: Any, new_text: str) -> None:
280280
self.view.controller.update_screen()
281281

282282
def mouse_event(self, size: urwid_Size, event: str, button: int, col: int,
283-
row: int, focus: Any) -> Any:
283+
row: int, focus: bool) -> bool:
284284
if event == 'mouse press':
285285
if button == 4:
286286
self.keypress(size, 'up')
@@ -367,7 +367,7 @@ def update_topics_list(self, stream_id: int, topic_name: str,
367367
self.list_box.set_focus(0)
368368

369369
def mouse_event(self, size: urwid_Size, event: str, button: int, col: int,
370-
row: int, focus: Any) -> Any:
370+
row: int, focus: bool) -> bool:
371371
if event == 'mouse press':
372372
if button == 4:
373373
self.keypress(size, 'up')
@@ -406,7 +406,7 @@ def __init__(self, users_btn_list: List[Any]) -> None:
406406
super().__init__(self.log)
407407

408408
def mouse_event(self, size: urwid_Size, event: str, button: int, col: int,
409-
row: int, focus: Any) -> Any:
409+
row: int, focus: bool) -> bool:
410410
if event == 'mouse press':
411411
if button == 4:
412412
for _ in range(5):

0 commit comments

Comments
 (0)