Skip to content

Commit 4064da1

Browse files
committed
core/views/run: Show transparency setting in About popup.
The Controller now accepts the transparency parameter from the configuration in run.py, storing it and passing it to the About popup as required. Tests updated.
1 parent 778d6dc commit 4064da1

File tree

5 files changed

+10
-3
lines changed

5 files changed

+10
-3
lines changed

tests/core/test_core.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ def controller(self, mocker: MockerFixture) -> Controller:
5151
self.autohide = True # FIXME Add tests for no-autohide
5252
self.notify_enabled = False
5353
self.exit_confirmation = True
54+
self.transparency_enabled = False
5455
self.maximum_footlinks = 3
5556
result = Controller(
5657
config_file=self.config_file,
@@ -64,6 +65,7 @@ def controller(self, mocker: MockerFixture) -> Controller:
6465
autohide=self.autohide,
6566
notify=self.notify_enabled,
6667
exit_confirmation=self.exit_confirmation,
68+
transparency=self.transparency_enabled,
6769
),
6870
)
6971
result.view.message_view = mocker.Mock() # set in View.__init__

tests/ui_tools/test_popups.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ def mock_external_classes(self, mocker: MockerFixture) -> None:
207207
autohide_enabled=False,
208208
maximum_footlinks=3,
209209
exit_confirmation_enabled=False,
210+
transparency_enabled=False,
210211
)
211212

212213
@pytest.mark.parametrize(
@@ -257,6 +258,7 @@ def test_feature_level_content(
257258
autohide_enabled=False,
258259
maximum_footlinks=3,
259260
exit_confirmation_enabled=False,
261+
transparency_enabled=False,
260262
)
261263

262264
assert len(about_view.feature_level_content) == (
@@ -293,6 +295,7 @@ def test_copied_content(self) -> None:
293295
Color depth: 256
294296
Notifications: disabled
295297
Exit confirmation: disabled
298+
Transparency: disabled
296299
297300
#### Detected Environment
298301
Platform: WSL

zulipterminal/cli/run.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -596,9 +596,6 @@ def print_setting(setting: str, data: SettingData, suffix: str = "") -> None:
596596
transparent_background=transparency_enabled,
597597
)
598598

599-
# Avoid passing this to the Controller
600-
boolean_settings.pop("transparency")
601-
602599
Controller(
603600
config_file=zuliprc_path,
604601
maximum_footlinks=maximum_footlinks,

zulipterminal/core.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ def __init__(
7070
color_depth: int,
7171
debug_path: Optional[str],
7272
in_explore_mode: bool,
73+
transparency: bool,
7374
autohide: bool,
7475
notify: bool,
7576
exit_confirmation: bool,
@@ -78,6 +79,7 @@ def __init__(
7879
self.theme = theme
7980
self.color_depth = color_depth
8081
self.in_explore_mode = in_explore_mode
82+
self.transparency_enabled = transparency
8183
self.autohide = autohide
8284
self.exit_confirmation = exit_confirmation
8385
self.notify_enabled = notify
@@ -310,6 +312,7 @@ def show_about(self) -> None:
310312
autohide_enabled=self.autohide,
311313
maximum_footlinks=self.maximum_footlinks,
312314
exit_confirmation_enabled=self.exit_confirmation,
315+
transparency_enabled=self.transparency_enabled,
313316
),
314317
"area:help",
315318
)

zulipterminal/ui_tools/views.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1091,6 +1091,7 @@ def __init__(
10911091
maximum_footlinks: int,
10921092
notify_enabled: bool,
10931093
exit_confirmation_enabled: bool,
1094+
transparency_enabled: bool,
10941095
) -> None:
10951096
self.feature_level_content = (
10961097
[("Feature level", str(server_feature_level))]
@@ -1113,6 +1114,7 @@ def __init__(
11131114
"Exit confirmation",
11141115
"enabled" if exit_confirmation_enabled else "disabled",
11151116
),
1117+
("Transparency", "enabled" if transparency_enabled else "disabled"),
11161118
],
11171119
),
11181120
(

0 commit comments

Comments
 (0)