From 7f7e3688f3285ea803a5579b240cff54958e16e2 Mon Sep 17 00:00:00 2001 From: Jeremy Kerr Date: Fri, 13 Dec 2013 10:09:06 +0800 Subject: ui/ncurses: do all config screen updates in config_screen_post We call _post when the config screen is to be displayed, so do all drawing here. This means we get the same drawing code on both init and update. Signed-off-by: Jeremy Kerr --- ui/ncurses/nc-config.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'ui/ncurses/nc-config.c') diff --git a/ui/ncurses/nc-config.c b/ui/ncurses/nc-config.c index 74105f1..9cc6a29 100644 --- a/ui/ncurses/nc-config.c +++ b/ui/ncurses/nc-config.c @@ -131,6 +131,8 @@ static int config_screen_post(struct nc_scr *scr) struct config_screen *screen = config_screen_from_scr(scr); widgetset_post(screen->widgetset); nc_scr_frame_draw(scr); + redrawwin(scr->main_ncw); + wrefresh(screen->scr.main_ncw); pad_refresh(screen); return 0; } @@ -580,8 +582,7 @@ static void config_screen_widget_focus(struct nc_widget *widget, void *arg) pad_refresh(screen); } - -void config_screen_update(struct config_screen *screen, +static void config_screen_draw(struct config_screen *screen, const struct config *config, const struct system_info *sysinfo) { @@ -626,7 +627,13 @@ void config_screen_update(struct config_screen *screen, if (repost) widgetset_post(screen->widgetset); +} +void config_screen_update(struct config_screen *screen, + const struct config *config, + const struct system_info *sysinfo) +{ + config_screen_draw(screen, config, sysinfo); pad_refresh(screen); } @@ -666,9 +673,7 @@ struct config_screen *config_screen_init(struct cui *cui, scrollok(screen->scr.sub_ncw, true); - config_screen_update(screen, config, sysinfo); - - wrefresh(screen->scr.main_ncw); + config_screen_draw(screen, config, sysinfo); return screen; } -- cgit v1.2.1