Skip to content

Commit 7b7d813

Browse files
committed
buttons: Change text_color to test_style.
Rename TopButton arg text_color to text_style to better align with what it actually represents.
1 parent 780c23d commit 7b7d813

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

zulipterminal/ui_tools/buttons.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def __init__(
2727
show_function: Callable[[], Any],
2828
width: int,
2929
prefix_character: Union[str, Tuple[Any, str]]='\N{BULLET}',
30-
text_color: Optional[str]=None,
30+
text_style: Optional[str]=None,
3131
count: int=0,
3232
count_style: Optional[str]=None,
3333
) -> None:
@@ -46,15 +46,15 @@ def __init__(
4646
# Space either side, at least one space between
4747
self.width_for_text_and_count = width - 3 - prefix_length
4848

49-
self.original_color = text_color
49+
self.original_color = text_style
5050
self.show_function = show_function
5151
super().__init__("")
52-
self.update_count(count, text_color)
52+
self.update_count(count, text_style)
5353
self.controller = controller
5454
urwid.connect_signal(self, 'click', self.activate)
5555

56-
def update_count(self, count: int, text_color: Optional[str]=None) -> None:
57-
new_color = self.original_color if text_color is None else text_color
56+
def update_count(self, count: int, text_style: Optional[str]=None) -> None:
57+
new_color = self.original_color if text_style is None else text_style
5858

5959
self.count = count
6060
if count == 0:
@@ -65,7 +65,7 @@ def update_count(self, count: int, text_color: Optional[str]=None) -> None:
6565
self.update_widget((self.count_style, count_text), new_color)
6666

6767
def update_widget(self, count_text: Tuple[Optional[str], str],
68-
text_color: Optional[str]) -> Any:
68+
text_style: Optional[str]) -> Any:
6969
# Note that we don't modify self._caption
7070
max_caption_length = (self.width_for_text_and_count
7171
- len(count_text[1]))
@@ -86,7 +86,7 @@ def update_widget(self, count_text: Tuple[Optional[str], str],
8686
f"{self.post_prefix_spacing}{caption}{num_extra_spaces * ' '} ",
8787
count_text],
8888
self.width_for_text_and_count + 5), # cursor location
89-
text_color,
89+
text_style,
9090
'selected')
9191

9292
def activate(self, key: Any) -> None:
@@ -258,7 +258,7 @@ def __init__(self, user: Dict[str, Any], controller: Any,
258258
show_function=self._narrow_with_compose,
259259
width=width,
260260
prefix_character=(color, state_marker),
261-
text_color=color,
261+
text_style=color,
262262
count=count,
263263
)
264264
if is_current_user:

0 commit comments

Comments
 (0)