Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[menu] Adapt user interface to fit display size
Signed-off-by: Michael Brown <mcb30@ipxe.org>
  • Loading branch information
mcb30 committed Dec 6, 2013
1 parent 0344dc0 commit f795925
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/hci/tui/menu_ui.c
Expand Up @@ -40,19 +40,19 @@ FILE_LICENCE ( GPL2_OR_LATER );
#define CPAIR_SEPARATOR 3

/* Screen layout */
#define TITLE_ROW 1
#define MENU_ROW 3
#define MENU_COL 1
#define MENU_ROWS 18
#define MENU_COLS 78
#define MENU_PAD 2
#define TITLE_ROW 1U
#define MENU_ROW 3U
#define MENU_COL 1U
#define MENU_ROWS ( LINES - 2U - MENU_ROW )
#define MENU_COLS ( COLS - 2U )
#define MENU_PAD 2U

/** A menu user interface */
struct menu_ui {
/** Menu */
struct menu *menu;
/** Number of menu items */
int count;
unsigned int count;
/** Currently selected item */
int selected;
/** First visible item */
Expand Down Expand Up @@ -269,7 +269,7 @@ static int menu_loop ( struct menu_ui *ui, struct menu_item **selected ) {
if ( ui->selected < 0 ) {
ui->selected = 0;
move = +1;
} else if ( ui->selected >= ui->count ) {
} else if ( ui->selected >= ( int ) ui->count ) {
ui->selected = ( ui->count - 1 );
move = -1;
}
Expand Down

0 comments on commit f795925

Please sign in to comment.