[RFC V2 PATCH 5/6] ui/ncurses: Use sorted field navigation

Samuel Mendoza-Jonas sam.mj at au1.ibm.com
Tue Jan 27 15:29:49 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 83ae785..e230219 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;
 	}
 
-- 
1.9.3



More information about the Petitboot mailing list