Skip to content

Commit 3ad94bc

Browse files
committed
Refactor dynamic plugin max size computation in the __display_right method
1 parent d5f8418 commit 3ad94bc

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

Diff for: glances/outputs/glances_curses.py

+11-3
Original file line numberDiff line numberDiff line change
@@ -803,13 +803,21 @@ def __display_right(self, stat_display):
803803
for p in self._right_sidebar():
804804
if (hasattr(self.args, 'enable_' + p) or hasattr(self.args, 'disable_' + p)) and p in stat_display:
805805
self.new_line()
806-
if p == 'processlist':
806+
if p in ['processlist', 'programlist']:
807+
p_index = self._right_sidebar().index(p) + 1
807808
self.display_plugin(
808-
stat_display['processlist'],
809+
stat_display[p],
809810
display_optional=(self.term_window.getmaxyx()[1] > 102),
810811
display_additional=(not MACOS),
811812
max_y=(
812-
self.term_window.getmaxyx()[0] - self.get_stats_display_height(stat_display['alert']) - 2
813+
self.term_window.getmaxyx()[0]
814+
- sum(
815+
[
816+
self.get_stats_display_height(stat_display[i])
817+
for i in self._right_sidebar()[p_index:]
818+
]
819+
)
820+
- 2
813821
),
814822
)
815823
else:

0 commit comments

Comments
 (0)