|
@@ -35,8 +35,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
|
35
|
35
|
|
36
|
36
|
/* Colour pairs */
|
37
|
37
|
#define CPAIR_NORMAL 1
|
38
|
|
-#define CPAIR_LABEL 2
|
39
|
|
-#define CPAIR_EDITBOX 3
|
|
38
|
+#define CPAIR_EDIT 2
|
40
|
39
|
|
41
|
40
|
/* Screen layout */
|
42
|
41
|
#define USERNAME_LABEL_ROW 8
|
|
@@ -65,9 +64,8 @@ int login_ui ( void ) {
|
65
|
64
|
/* Initialise UI */
|
66
|
65
|
initscr();
|
67
|
66
|
start_color();
|
68
|
|
- init_pair ( CPAIR_NORMAL, COLOR_WHITE, COLOR_BLACK );
|
69
|
|
- init_pair ( CPAIR_LABEL, COLOR_WHITE, COLOR_BLACK );
|
70
|
|
- init_pair ( CPAIR_EDITBOX, COLOR_WHITE, COLOR_BLUE );
|
|
67
|
+ init_pair ( CPAIR_NORMAL, COLOR_WHITE, COLOR_BLUE );
|
|
68
|
+ init_pair ( CPAIR_EDIT, COLOR_BLACK, COLOR_CYAN );
|
71
|
69
|
init_editbox ( &username_box, username, sizeof ( username ), NULL,
|
72
|
70
|
USERNAME_ROW, EDITBOX_COL, EDITBOX_WIDTH, 0 );
|
73
|
71
|
init_editbox ( &password_box, password, sizeof ( password ), NULL,
|
|
@@ -75,11 +73,13 @@ int login_ui ( void ) {
|
75
|
73
|
EDITBOX_STARS );
|
76
|
74
|
|
77
|
75
|
/* Draw initial UI */
|
|
76
|
+ color_set ( CPAIR_NORMAL, NULL );
|
78
|
77
|
erase();
|
79
|
|
- color_set ( CPAIR_LABEL, NULL );
|
|
78
|
+ attron ( A_BOLD );
|
80
|
79
|
mvprintw ( USERNAME_LABEL_ROW, LABEL_COL, "Username:" );
|
81
|
80
|
mvprintw ( PASSWORD_LABEL_ROW, LABEL_COL, "Password:" );
|
82
|
|
- color_set ( CPAIR_EDITBOX, NULL );
|
|
81
|
+ attroff ( A_BOLD );
|
|
82
|
+ color_set ( CPAIR_EDIT, NULL );
|
83
|
83
|
draw_editbox ( &username_box );
|
84
|
84
|
draw_editbox ( &password_box );
|
85
|
85
|
|