From ec12bbd7bbfb3dd31dbd987ecff463542d54542f Mon Sep 17 00:00:00 2001 From: Samuel Mendoza-Jonas Date: Wed, 21 Jan 2015 15:25:15 +1100 Subject: ui/ncurses: Use sorted field navigation Changing the visual order of widgets will cause their associated fields to be out of order relative to the widgetset field array. Rather than manually resorting the array, use sorted navigation to move according to a field's visual positon Signed-off-by: Samuel Mendoza-Jonas --- ui/ncurses/nc-widgets.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ui/ncurses/nc-widgets.c') diff --git a/ui/ncurses/nc-widgets.c b/ui/ncurses/nc-widgets.c index 5c67d82..3daced1 100644 --- a/ui/ncurses/nc-widgets.c +++ b/ui/ncurses/nc-widgets.c @@ -1066,19 +1066,19 @@ bool widgetset_process_key(struct nc_widgetset *set, int key) tab = true; /* fall through */ case KEY_UP: - req = REQ_PREV_FIELD; + req = REQ_SPREV_FIELD; break; case '\t': tab = true; /* fall through */ case KEY_DOWN: - req = REQ_NEXT_FIELD; + req = REQ_SNEXT_FIELD; break; case KEY_PPAGE: - req = REQ_FIRST_FIELD; + req = REQ_SFIRST_FIELD; break; case KEY_NPAGE: - req = REQ_LAST_FIELD; + req = REQ_SLAST_FIELD; break; } -- cgit v1.2.1