From dca7a325576ac89d56910a8ef668d6f66eba7371 Mon Sep 17 00:00:00 2001
From: Lukas Fleischer <calcurse@cryptocrack.de>
Date: Mon, 23 Feb 2015 14:02:03 +0100
Subject: Support resize in all configuration menus

Add missing resize support in the configuration main menu and in the key
bindings menu.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
---
 src/custom.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

(limited to 'src')

diff --git a/src/custom.c b/src/custom.c
index 94290bc..b0cbee2 100644
--- a/src/custom.c
+++ b/src/custom.c
@@ -1032,6 +1032,26 @@ void custom_keys_config(void)
 			wins_scrollwin_delete(&kwin);
 			return;
 		}
+
+		if (resize) {
+			resize = 0;
+			wins_reset_noupdate();
+			nbdisplayed = ((notify_bar() ? row - 3 : row - 2) -
+					LABELLINES) / LINESPERKEY;
+			lastrow = firstrow + nbdisplayed - 1;
+			wins_scrollwin_resize(&kwin, 0, 0,
+					notify_bar() ? row - 3 : row - 2, col);
+			wins_scrollwin_draw_deco(&kwin, 0);
+			delwin(win[STA].p);
+			win[STA].p = newwin(win[STA].h, win[STA].w, win[STA].y,
+					win[STA].x);
+			keypad(win[STA].p, TRUE);
+			if (notify_bar()) {
+				notify_reinit_bar();
+				notify_update_bar();
+			}
+		}
+
 		custom_keys_config_bar();
 		werase(kwin.inner);
 		nbrowelm =
@@ -1104,6 +1124,11 @@ void custom_config_main(void)
 			break;
 		}
 
+		if (resize) {
+			resize = 0;
+			wins_reset();
+		}
+
 		wins_set_bindings(bindings, ARRAY_SIZE(bindings));
 		wins_update_border(FLAG_ALL);
 		wins_update_panels(FLAG_ALL);
-- 
cgit v1.2.3-70-g09d2