summaryrefslogtreecommitdiffstats
path: root/src/usr
diff options
context:
space:
mode:
authorMichael Brown2013-12-07 22:00:09 +0100
committerMichael Brown2013-12-09 16:34:14 +0100
commit259858950a32862f99b740a4e8cac2954ab34ba9 (patch)
treef12c1adae65b56ff28314b531760c29fe1bc5a59 /src/usr
parent[console] Add centralised concept of colours and colour pairs (diff)
downloadipxe-259858950a32862f99b740a4e8cac2954ab34ba9.tar.gz
ipxe-259858950a32862f99b740a4e8cac2954ab34ba9.tar.xz
ipxe-259858950a32862f99b740a4e8cac2954ab34ba9.zip
[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.c11
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++ )