Skip to content

Commit 83e4377

Browse files
Rohitth007neiljp
authored andcommitted
button: Add muted style to stream prefix.
The previous commits enables the ability to change style of button prefix as well using prefix_markup. This makes the whole button look muted. Tests updated.
1 parent 6095afe commit 83e4377

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

tests/ui_tools/test_buttons.py

+2
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ def test_mark_muted(
195195

196196
stream_button.mark_muted()
197197

198+
assert stream_button.prefix_style == "muted"
198199
assert stream_button.label_style == "muted"
199200
assert stream_button.suffix_style == "muted"
200201
assert stream_button.suffix_text == MUTE_MARKER
@@ -209,6 +210,7 @@ def test_mark_unmuted(
209210

210211
stream_button.mark_unmuted(unread_count)
211212

213+
assert stream_button.prefix_style == stream_button.color
212214
assert stream_button.label_style is None
213215
assert stream_button.suffix_style == "unread_count"
214216
update_count.assert_called_once_with(unread_count)

zulipterminal/ui_tools/buttons.py

+2
Original file line numberDiff line numberDiff line change
@@ -221,13 +221,15 @@ def __init__(
221221
self.mark_muted()
222222

223223
def mark_muted(self) -> None:
224+
self.prefix_style = "muted"
224225
self.label_style = "muted"
225226
self.suffix_style = "muted"
226227
self.suffix_text = MUTE_MARKER
227228
self.update_widget()
228229
self.view.home_button.update_count(self.model.unread_counts["all_msg"])
229230

230231
def mark_unmuted(self, unread_count: int) -> None:
232+
self.prefix_style = self.color
231233
self.label_style = None
232234
self.suffix_style = "unread_count"
233235
self.update_count(unread_count)

0 commit comments

Comments
 (0)