@@ -82,6 +82,11 @@ def update_widget(
82
82
self .button_suffix .set_text (suffix )
83
83
self ._w .set_attr_map ({None : text_color })
84
84
85
+ def update_widget_highlight (
86
+ self , highlight_style : str
87
+ ) -> None :
88
+ self .original_color = highlight_style
89
+
85
90
def activate (self , key : Any ) -> None :
86
91
self .controller .view .show_left_panel (visible = False )
87
92
self .controller .view .show_right_panel (visible = False )
@@ -223,6 +228,11 @@ def keypress(self, size: urwid_Size, key: str) -> Optional[str]:
223
228
self .model .controller .show_stream_info (self .stream_id )
224
229
return super ().keypress (size , key )
225
230
231
+ def mark_active (self ) -> None :
232
+ self .update_widget_highlight ("stream_active" )
233
+
234
+ def mark_inactive (self ) -> None :
235
+ self .update_widget_highlight ("header" )
226
236
227
237
class UserButton (TopButton ):
228
238
def __init__ (
@@ -418,6 +428,14 @@ def update_widget(self, caption: str, display_attr: Optional[str] = None) -> Non
418
428
# Set cursor position next to len(caption) to avoid the cursor.
419
429
icon = urwid .SelectableIcon (caption , cursor_position = len (caption ) + 1 )
420
430
self ._w = urwid .AttrMap (icon , display_attr , focus_map = "selected" )
431
+
432
+ def update_widget_highlight (
433
+ self , highlight : str
434
+ ) -> None :
435
+ """
436
+ Highlight the active stream/topic button
437
+ """
438
+ self .original_color = highlight
421
439
422
440
def handle_link (self , * _ : Any ) -> None :
423
441
"""
0 commit comments