diff options
author | Michael Brown <mcb30@ipxe.org> | 2013-12-07 21:00:09 +0000 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2013-12-09 15:34:14 +0000 |
commit | 259858950a32862f99b740a4e8cac2954ab34ba9 (patch) | |
tree | f12c1adae65b56ff28314b531760c29fe1bc5a59 /src/usr | |
parent | 7025f5c648aedf744690e9e04257d6dddc94919d (diff) | |
download | ipxe-259858950a32862f99b740a4e8cac2954ab34ba9.tar.gz |
[mucurses] Use centralised concept of colour pairs
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/usr')
-rw-r--r-- | src/usr/pxemenu.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/usr/pxemenu.c b/src/usr/pxemenu.c index c5cffd3d..b69905df 100644 --- a/src/usr/pxemenu.c +++ b/src/usr/pxemenu.c @@ -32,6 +32,7 @@ FILE_LICENCE ( GPL2_OR_LATER ); #include <ipxe/keys.h> #include <ipxe/timer.h> #include <ipxe/uri.h> +#include <ipxe/ansicol.h> #include <usr/dhcpmgmt.h> #include <usr/autoboot.h> @@ -41,10 +42,6 @@ FILE_LICENCE ( GPL2_OR_LATER ); * */ -/* Colour pairs */ -#define CPAIR_NORMAL 1 -#define CPAIR_SELECT 2 - /** A PXE boot menu item */ struct pxe_menu_item { /** Boot Server type */ @@ -204,7 +201,7 @@ static void pxe_menu_draw_item ( struct pxe_menu *menu, /* Draw row */ row = ( LINES - menu->num_items + index ); - color_set ( ( selected ? CPAIR_SELECT : CPAIR_NORMAL ), NULL ); + color_set ( ( selected ? CPAIR_PXE : CPAIR_DEFAULT ), NULL ); mvprintw ( row, 0, "%s", buf ); move ( row, 1 ); } @@ -224,9 +221,7 @@ static int pxe_menu_select ( struct pxe_menu *menu ) { /* Initialise UI */ initscr(); start_color(); - init_pair ( CPAIR_NORMAL, COLOR_WHITE, COLOR_BLACK ); - init_pair ( CPAIR_SELECT, COLOR_BLACK, COLOR_WHITE ); - color_set ( CPAIR_NORMAL, NULL ); + color_set ( CPAIR_DEFAULT, NULL ); /* Draw initial menu */ for ( i = 0 ; i < menu->num_items ; i++ ) |