From 39290c1c6d71e6d103cab88b87210c0e674b27d9 Mon Sep 17 00:00:00 2001 From: Swarnim114 Date: Thu, 25 Jul 2024 18:17:23 +0530 Subject: [PATCH] about_popup: Terminal size added in about popup. Fixes #1536 --- zulipterminal/core.py | 2 ++ zulipterminal/ui_tools/views.py | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/zulipterminal/core.py b/zulipterminal/core.py index a23b1596f1..bfae1a1adc 100644 --- a/zulipterminal/core.py +++ b/zulipterminal/core.py @@ -301,6 +301,7 @@ def popup_with_message(self, text: str, width: int) -> None: self.show_pop_up(NoticeView(self, text, width, "NOTICE"), "area:error") def show_about(self) -> None: + screen = self.loop.screen self.show_pop_up( AboutView( self, @@ -315,6 +316,7 @@ def show_about(self) -> None: maximum_footlinks=self.maximum_footlinks, exit_confirmation_enabled=self.exit_confirmation, transparency_enabled=self.transparency_enabled, + screen=screen, ), "area:help", ) diff --git a/zulipterminal/ui_tools/views.py b/zulipterminal/ui_tools/views.py index 6d01a82566..d5d4ac5dc5 100644 --- a/zulipterminal/ui_tools/views.py +++ b/zulipterminal/ui_tools/views.py @@ -1092,6 +1092,7 @@ def __init__( notify_enabled: bool, exit_confirmation_enabled: bool, transparency_enabled: bool, + screen: urwid.raw_display.Screen, ) -> None: self.feature_level_content = ( [("Feature level", str(server_feature_level))] @@ -1099,6 +1100,8 @@ def __init__( else [] ) + terminal_size = screen.get_cols_rows() + contents = [ ("Application", [("Zulip Terminal", zt_version)]), ("Server", [("Version", server_version)] + self.feature_level_content), @@ -1119,7 +1122,11 @@ def __init__( ), ( "Detected Environment", - [("Platform", PLATFORM), ("Python", detected_python_in_full())], + [ + ("Platform", PLATFORM), + ("Python", detected_python_in_full()), + ("Current terminal size", f"{terminal_size[0]}x{terminal_size[1]}"), + ], ), ] @@ -1137,7 +1144,6 @@ def __init__( popup_width, column_widths = self.calculate_table_widths(contents, len(title)) widgets = self.make_table_with_categories(contents, column_widths) - super().__init__(controller, widgets, "ABOUT", popup_width, title) def keypress(self, size: urwid_Size, key: str) -> str: