summaryrefslogtreecommitdiffstats
path: root/src/hci/tui
diff options
context:
space:
mode:
authorChristian Hesse2012-06-27 19:39:46 +0200
committerMichael Brown2012-06-27 19:40:17 +0200
commit512ed2b921e89a5e5208a7c6ddb9837b0d184a3e (patch)
tree00d7a4a1affc024b076e1f29fe52d98128e8ce06 /src/hci/tui
parent[ui] Change "login" colours to match other UIs (diff)
downloadipxe-512ed2b921e89a5e5208a7c6ddb9837b0d184a3e.tar.gz
ipxe-512ed2b921e89a5e5208a7c6ddb9837b0d184a3e.tar.xz
ipxe-512ed2b921e89a5e5208a7c6ddb9837b0d184a3e.zip
[ui] Allow colours to be configured via config/colour.h
Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/hci/tui')
-rw-r--r--src/hci/tui/login_ui.c5
-rw-r--r--src/hci/tui/menu_ui.c7
-rw-r--r--src/hci/tui/settings_ui.c11
3 files changed, 13 insertions, 10 deletions
diff --git a/src/hci/tui/login_ui.c b/src/hci/tui/login_ui.c
index 4143a607..c33cbcf2 100644
--- a/src/hci/tui/login_ui.c
+++ b/src/hci/tui/login_ui.c
@@ -32,6 +32,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
#include <ipxe/editbox.h>
#include <ipxe/keys.h>
#include <ipxe/login_ui.h>
+#include <config/colour.h>
/* Colour pairs */
#define CPAIR_NORMAL 1
@@ -64,8 +65,8 @@ int login_ui ( void ) {
/* Initialise UI */
initscr();
start_color();
- init_pair ( CPAIR_NORMAL, COLOR_WHITE, COLOR_BLUE );
- init_pair ( CPAIR_EDIT, COLOR_BLACK, COLOR_CYAN );
+ init_pair ( CPAIR_NORMAL, COLOR_NORMAL_FG, COLOR_NORMAL_BG );
+ init_pair ( CPAIR_EDIT, COLOR_EDIT_FG, COLOR_EDIT_BG );
init_editbox ( &username_box, username, sizeof ( username ), NULL,
USERNAME_ROW, EDITBOX_COL, EDITBOX_WIDTH, 0 );
init_editbox ( &password_box, password, sizeof ( password ), NULL,
diff --git a/src/hci/tui/menu_ui.c b/src/hci/tui/menu_ui.c
index 30d93ad2..61625622 100644
--- a/src/hci/tui/menu_ui.c
+++ b/src/hci/tui/menu_ui.c
@@ -31,6 +31,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
#include <ipxe/timer.h>
#include <ipxe/console.h>
#include <ipxe/menu.h>
+#include <config/colour.h>
/* Colour pairs */
#define CPAIR_NORMAL 1
@@ -339,9 +340,9 @@ int show_menu ( struct menu *menu, unsigned int timeout_ms,
/* Initialise screen */
initscr();
start_color();
- init_pair ( CPAIR_NORMAL, COLOR_WHITE, COLOR_BLUE );
- init_pair ( CPAIR_SELECT, COLOR_WHITE, COLOR_RED );
- init_pair ( CPAIR_SEPARATOR, COLOR_CYAN, COLOR_BLUE );
+ init_pair ( CPAIR_NORMAL, COLOR_NORMAL_FG, COLOR_NORMAL_BG );
+ init_pair ( CPAIR_SELECT, COLOR_SELECT_FG, COLOR_SELECT_BG );
+ init_pair ( CPAIR_SEPARATOR, COLOR_SEPARATOR_FG, COLOR_SEPARATOR_BG );
color_set ( CPAIR_NORMAL, NULL );
erase();
diff --git a/src/hci/tui/settings_ui.c b/src/hci/tui/settings_ui.c
index ed076101..258f0cf9 100644
--- a/src/hci/tui/settings_ui.c
+++ b/src/hci/tui/settings_ui.c
@@ -28,6 +28,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
#include <ipxe/editbox.h>
#include <ipxe/keys.h>
#include <ipxe/settings_ui.h>
+#include <config/colour.h>
/** @file
*
@@ -557,11 +558,11 @@ int settings_ui ( struct settings *settings ) {
initscr();
start_color();
- init_pair ( CPAIR_NORMAL, COLOR_WHITE, COLOR_BLUE );
- init_pair ( CPAIR_SELECT, COLOR_WHITE, COLOR_RED );
- init_pair ( CPAIR_EDIT, COLOR_BLACK, COLOR_CYAN );
- init_pair ( CPAIR_ALERT, COLOR_WHITE, COLOR_RED );
- init_pair ( CPAIR_URL, COLOR_CYAN, COLOR_BLUE );
+ init_pair ( CPAIR_NORMAL, COLOR_NORMAL_FG, COLOR_NORMAL_BG );
+ init_pair ( CPAIR_SELECT, COLOR_SELECT_FG, COLOR_SELECT_BG );
+ init_pair ( CPAIR_EDIT, COLOR_EDIT_FG, COLOR_EDIT_BG );
+ init_pair ( CPAIR_ALERT, COLOR_ALERT_FG, COLOR_ALERT_BG );
+ init_pair ( CPAIR_URL, COLOR_URL_FG, COLOR_URL_BG );
color_set ( CPAIR_NORMAL, NULL );
erase();