[PATCH 5/7] ui/ncurses: Use sorted field navigation

Samuel Mendoza-Jonas sam.mj at au1.ibm.com
Wed Apr 1 11:41:04 AEDT 2015


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 <sam.mj at au1.ibm.com>
---
 ui/ncurses/nc-widgets.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/ui/ncurses/nc-widgets.c b/ui/ncurses/nc-widgets.c
index b28e405..fe08ac0 100644
--- a/ui/ncurses/nc-widgets.c
+++ b/ui/ncurses/nc-widgets.c
@@ -1067,19 +1067,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;
 	}
 
-- 
2.1.0



More information about the Petitboot mailing list