MCPcopy Create free account
hub / github.com/EmbeddedRPC/erpc / _resize_main

Function _resize_main

scripts/kconfig/menuconfig.py:1034–1073  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1032
1033
1034def _resize_main():
1035 # Resizes the main display, with the list of symbols, etc., to fill the
1036 # terminal
1037
1038 global _menu_scroll
1039
1040 screen_height, screen_width = _stdscr.getmaxyx()
1041
1042 _path_win.resize(1, screen_width)
1043 _top_sep_win.resize(1, screen_width)
1044 _bot_sep_win.resize(1, screen_width)
1045
1046 help_win_height = _SHOW_HELP_HEIGHT if _show_help else \
1047 len(_MAIN_HELP_LINES)
1048
1049 menu_win_height = screen_height - help_win_height - 3
1050
1051 if menu_win_height >= 1:
1052 _menu_win.resize(menu_win_height, screen_width)
1053 _help_win.resize(help_win_height, screen_width)
1054
1055 _top_sep_win.mvwin(1, 0)
1056 _menu_win.mvwin(2, 0)
1057 _bot_sep_win.mvwin(2 + menu_win_height, 0)
1058 _help_win.mvwin(2 + menu_win_height + 1, 0)
1059 else:
1060 # Degenerate case. Give up on nice rendering and just prevent errors.
1061
1062 menu_win_height = 1
1063
1064 _menu_win.resize(1, screen_width)
1065 _help_win.resize(1, screen_width)
1066
1067 for win in _top_sep_win, _menu_win, _bot_sep_win, _help_win:
1068 win.mvwin(0, 0)
1069
1070 # Adjust the scroll so that the selected node is still within the window,
1071 # if needed
1072 if _sel_node_i - _menu_scroll >= menu_win_height:
1073 _menu_scroll = _sel_node_i - menu_win_height + 1
1074
1075
1076def _height(win):

Callers 4

_menuconfigFunction · 0.85
_initFunction · 0.85
_input_dialogFunction · 0.85
_key_dialogFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected