mirror of https://github.com/ipxe/ipxe.git
[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>pull/6/head^2
parent
567b9bf9e7
commit
512ed2b921
|
@ -0,0 +1,32 @@
|
||||||
|
#ifndef CONFIG_COLOUR_H
|
||||||
|
#define CONFIG_COLOUR_H
|
||||||
|
|
||||||
|
/** @file
|
||||||
|
*
|
||||||
|
* Display colour configuration
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
FILE_LICENCE ( GPL2_OR_LATER );
|
||||||
|
|
||||||
|
#define COLOR_NORMAL_FG COLOR_WHITE
|
||||||
|
#define COLOR_NORMAL_BG COLOR_BLUE
|
||||||
|
|
||||||
|
#define COLOR_SELECT_FG COLOR_WHITE
|
||||||
|
#define COLOR_SELECT_BG COLOR_RED
|
||||||
|
|
||||||
|
#define COLOR_SEPARATOR_FG COLOR_CYAN
|
||||||
|
#define COLOR_SEPARATOR_BG COLOR_BLUE
|
||||||
|
|
||||||
|
#define COLOR_EDIT_FG COLOR_BLACK
|
||||||
|
#define COLOR_EDIT_BG COLOR_CYAN
|
||||||
|
|
||||||
|
#define COLOR_ALERT_FG COLOR_WHITE
|
||||||
|
#define COLOR_ALERT_BG COLOR_RED
|
||||||
|
|
||||||
|
#define COLOR_URL_FG COLOR_CYAN
|
||||||
|
#define COLOR_URL_BG COLOR_BLUE
|
||||||
|
|
||||||
|
#include <config/local/colour.h>
|
||||||
|
|
||||||
|
#endif /* CONFIG_COLOUR_H */
|
|
@ -32,6 +32,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
|
||||||
#include <ipxe/editbox.h>
|
#include <ipxe/editbox.h>
|
||||||
#include <ipxe/keys.h>
|
#include <ipxe/keys.h>
|
||||||
#include <ipxe/login_ui.h>
|
#include <ipxe/login_ui.h>
|
||||||
|
#include <config/colour.h>
|
||||||
|
|
||||||
/* Colour pairs */
|
/* Colour pairs */
|
||||||
#define CPAIR_NORMAL 1
|
#define CPAIR_NORMAL 1
|
||||||
|
@ -64,8 +65,8 @@ int login_ui ( void ) {
|
||||||
/* Initialise UI */
|
/* Initialise UI */
|
||||||
initscr();
|
initscr();
|
||||||
start_color();
|
start_color();
|
||||||
init_pair ( CPAIR_NORMAL, COLOR_WHITE, COLOR_BLUE );
|
init_pair ( CPAIR_NORMAL, COLOR_NORMAL_FG, COLOR_NORMAL_BG );
|
||||||
init_pair ( CPAIR_EDIT, COLOR_BLACK, COLOR_CYAN );
|
init_pair ( CPAIR_EDIT, COLOR_EDIT_FG, COLOR_EDIT_BG );
|
||||||
init_editbox ( &username_box, username, sizeof ( username ), NULL,
|
init_editbox ( &username_box, username, sizeof ( username ), NULL,
|
||||||
USERNAME_ROW, EDITBOX_COL, EDITBOX_WIDTH, 0 );
|
USERNAME_ROW, EDITBOX_COL, EDITBOX_WIDTH, 0 );
|
||||||
init_editbox ( &password_box, password, sizeof ( password ), NULL,
|
init_editbox ( &password_box, password, sizeof ( password ), NULL,
|
||||||
|
|
|
@ -31,6 +31,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
|
||||||
#include <ipxe/timer.h>
|
#include <ipxe/timer.h>
|
||||||
#include <ipxe/console.h>
|
#include <ipxe/console.h>
|
||||||
#include <ipxe/menu.h>
|
#include <ipxe/menu.h>
|
||||||
|
#include <config/colour.h>
|
||||||
|
|
||||||
/* Colour pairs */
|
/* Colour pairs */
|
||||||
#define CPAIR_NORMAL 1
|
#define CPAIR_NORMAL 1
|
||||||
|
@ -339,9 +340,9 @@ int show_menu ( struct menu *menu, unsigned int timeout_ms,
|
||||||
/* Initialise screen */
|
/* Initialise screen */
|
||||||
initscr();
|
initscr();
|
||||||
start_color();
|
start_color();
|
||||||
init_pair ( CPAIR_NORMAL, COLOR_WHITE, COLOR_BLUE );
|
init_pair ( CPAIR_NORMAL, COLOR_NORMAL_FG, COLOR_NORMAL_BG );
|
||||||
init_pair ( CPAIR_SELECT, COLOR_WHITE, COLOR_RED );
|
init_pair ( CPAIR_SELECT, COLOR_SELECT_FG, COLOR_SELECT_BG );
|
||||||
init_pair ( CPAIR_SEPARATOR, COLOR_CYAN, COLOR_BLUE );
|
init_pair ( CPAIR_SEPARATOR, COLOR_SEPARATOR_FG, COLOR_SEPARATOR_BG );
|
||||||
color_set ( CPAIR_NORMAL, NULL );
|
color_set ( CPAIR_NORMAL, NULL );
|
||||||
erase();
|
erase();
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
|
||||||
#include <ipxe/editbox.h>
|
#include <ipxe/editbox.h>
|
||||||
#include <ipxe/keys.h>
|
#include <ipxe/keys.h>
|
||||||
#include <ipxe/settings_ui.h>
|
#include <ipxe/settings_ui.h>
|
||||||
|
#include <config/colour.h>
|
||||||
|
|
||||||
/** @file
|
/** @file
|
||||||
*
|
*
|
||||||
|
@ -557,11 +558,11 @@ int settings_ui ( struct settings *settings ) {
|
||||||
|
|
||||||
initscr();
|
initscr();
|
||||||
start_color();
|
start_color();
|
||||||
init_pair ( CPAIR_NORMAL, COLOR_WHITE, COLOR_BLUE );
|
init_pair ( CPAIR_NORMAL, COLOR_NORMAL_FG, COLOR_NORMAL_BG );
|
||||||
init_pair ( CPAIR_SELECT, COLOR_WHITE, COLOR_RED );
|
init_pair ( CPAIR_SELECT, COLOR_SELECT_FG, COLOR_SELECT_BG );
|
||||||
init_pair ( CPAIR_EDIT, COLOR_BLACK, COLOR_CYAN );
|
init_pair ( CPAIR_EDIT, COLOR_EDIT_FG, COLOR_EDIT_BG );
|
||||||
init_pair ( CPAIR_ALERT, COLOR_WHITE, COLOR_RED );
|
init_pair ( CPAIR_ALERT, COLOR_ALERT_FG, COLOR_ALERT_BG );
|
||||||
init_pair ( CPAIR_URL, COLOR_CYAN, COLOR_BLUE );
|
init_pair ( CPAIR_URL, COLOR_URL_FG, COLOR_URL_BG );
|
||||||
color_set ( CPAIR_NORMAL, NULL );
|
color_set ( CPAIR_NORMAL, NULL );
|
||||||
erase();
|
erase();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue