summaryrefslogtreecommitdiff
path: root/menuconfig.py
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2018-05-10 14:33:28 +0200
committerUlf Magnusson <ulfalizer@gmail.com>2018-05-10 14:34:38 +0200
commit25d0b72510928acfc8dab2ae41f2f60fbfa0f382 (patch)
tree0fdd9583e04bf49a3a890ed738691d7565cae6f0 /menuconfig.py
parent0a037ccbaf2610adffa082cfeec334acdf3c23ce (diff)
menuconfig: Refactor resizing after fullscreen dialogs
Cleaner to do it in _menuconfig(), as it makes the fullscreen dialogs fully independent. Saves some code too.
Diffstat (limited to 'menuconfig.py')
-rwxr-xr-xmenuconfig.py19
1 files changed, 6 insertions, 13 deletions
diff --git a/menuconfig.py b/menuconfig.py
index 8b3ca40..2f4a6e4 100755
--- a/menuconfig.py
+++ b/menuconfig.py
@@ -463,9 +463,15 @@ def _menuconfig(stdscr):
elif c == "/":
_jump_to_dialog()
+ # The terminal might have been resized while the fullscreen jump-to
+ # dialog was open
+ _resize_main()
elif c == "?":
_info_dialog(_shown[_sel_node_i])
+ # The terminal might have been resized while the fullscreen info
+ # dialog was open
+ _resize_main()
elif c in ("a", "A"):
_toggle_show_all()
@@ -1395,21 +1401,14 @@ def _jump_to_dialog():
_jump_to(matches[sel_node_i])
_safe_curs_set(0)
- # Resize the main display before returning in case the terminal was
- # resized while the search dialog was open
- _resize_main()
return
if c == "\x1B": # \x1B = ESC
_safe_curs_set(0)
- _resize_main()
return
if c == curses.KEY_RESIZE:
- # No need to call _resize_main(), because the search window is
- # fullscreen.
-
# We adjust the scroll so that the selected node stays visible in
# the list when the terminal is resized, hence the 'scroll'
# assignment
@@ -1600,8 +1599,6 @@ def _info_dialog(node):
c = _get_wch_compat(text_win)
if c == curses.KEY_RESIZE:
- # No need to call _resize_main(), because the help window is
- # fullscreen
_resize_info_dialog(top_line_win, text_win, bot_sep_win, help_win)
elif c in (curses.KEY_DOWN, "j", "J"):
@@ -1628,10 +1625,6 @@ def _info_dialog(node):
"\x1B", # \x1B = ESC
"q", "Q", "h", "H"):
- # Resize the main display before returning in case the terminal was
- # resized while the help dialog was open
- _resize_main()
-
return
def _resize_info_dialog(top_line_win, text_win, bot_sep_win, help_win):