Skip to content

Commit 3ace328

Browse files
committed
Scale interface graphs according to terminal size
1 parent b022631 commit 3ace328

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

nomadnet/ui/textui/Interfaces.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2218,8 +2218,12 @@ def __init__(self, parent, iface_name):
22182218

22192219
self.config_rows = []
22202220

2221-
self.history_length=60
2222-
RNS.log(f"Col/rows: {_get_cols_rows()}")
2221+
screen_cols, _ = _get_cols_rows()
2222+
margin = 22
2223+
if screen_cols >= 145:
2224+
self.history_length = screen_cols//2-margin
2225+
else:
2226+
self.history_length = screen_cols-margin
22232227

22242228
# get interface stats
22252229
interface_stats = self.parent.app.rns.get_interface_stats()

0 commit comments

Comments
 (0)