Avoid redundant window resets in config menu

There's no need to reset windows unless the layout was changed. Move
wins_reset() to a separate branch to reflect this.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
Lukas Fleischer 2012-03-09 00:43:04 +01:00
parent 03ed480654
commit 7072c9c88a

View File

@ -1104,6 +1104,7 @@ custom_config_main (void)
_("Sorry, colors are not supported by your terminal\n" _("Sorry, colors are not supported by your terminal\n"
"(Press [ENTER] to continue)"); "(Press [ENTER] to continue)");
int ch; int ch;
int old_layout;
custom_config_bar (); custom_config_bar ();
while ((ch = wgetch (win[STA].p)) != 'q') while ((ch = wgetch (win[STA].p)) != 'q')
@ -1124,7 +1125,10 @@ custom_config_main (void)
break; break;
case 'L': case 'L':
case 'l': case 'l':
old_layout = wins_layout ();
custom_layout_config (); custom_layout_config ();
if (wins_layout () != old_layout)
wins_reset ();
break; break;
case 'G': case 'G':
case 'g': case 'g':
@ -1145,7 +1149,6 @@ custom_config_main (void)
default: default:
continue; continue;
} }
wins_reset ();
wins_update (FLAG_ALL); wins_update (FLAG_ALL);
wins_erase_status_bar (); wins_erase_status_bar ();
custom_config_bar (); custom_config_bar ();