2005-01-22 Vincent Pelletier <subdino2004@yahoo.fr>
* normal/menu.c (TERM_WIDTH): Macro redefined. (TERM_TOP_BORDER_Y): Likewise. (draw_border): Replaced while-loop by a for-loop. Make the number of lines consistent with the number of lines displayed in print_entries. Added a margin below the rectangle. (print_entry): Make the entry fit in the rectangle. (print_entries): Display the scroll arrows next to the right border.
This commit is contained in:
parent
78026bce9c
commit
776bd7808d
2 changed files with 24 additions and 17 deletions
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,14 @@
|
||||||
|
2005-01-22 Vincent Pelletier <subdino2004@yahoo.fr>
|
||||||
|
|
||||||
|
* normal/menu.c (TERM_WIDTH): Macro redefined.
|
||||||
|
(TERM_TOP_BORDER_Y): Likewise.
|
||||||
|
(draw_border): Replaced while-loop by a for-loop. Make the number
|
||||||
|
of lines consistent with the number of lines displayed in
|
||||||
|
print_entries. Added a margin below the rectangle.
|
||||||
|
(print_entry): Make the entry fit in the rectangle.
|
||||||
|
(print_entries): Display the scroll arrows next to the right
|
||||||
|
border.
|
||||||
|
|
||||||
2005-01-21 Marco Gerards <metgerards@student.han.nl>
|
2005-01-21 Marco Gerards <metgerards@student.han.nl>
|
||||||
|
|
||||||
* fs/minix.c (grub_minix_find_file): Reserve more space for
|
* fs/minix.c (grub_minix_find_file): Reserve more space for
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
#define DISP_LR 0x251B
|
#define DISP_LR 0x251B
|
||||||
|
|
||||||
/* FIXME: These should be dynamically obtained from a terminal. */
|
/* FIXME: These should be dynamically obtained from a terminal. */
|
||||||
#define TERM_WIDTH (80 - 1)
|
#define TERM_WIDTH 80
|
||||||
#define TERM_HEIGHT 25
|
#define TERM_HEIGHT 25
|
||||||
|
|
||||||
/* The number of lines of "GRUB version..." at the top. */
|
/* The number of lines of "GRUB version..." at the top. */
|
||||||
|
@ -51,7 +51,7 @@
|
||||||
#define TERM_SCROLL_WIDTH 1
|
#define TERM_SCROLL_WIDTH 1
|
||||||
|
|
||||||
/* The Y position of the top border. */
|
/* The Y position of the top border. */
|
||||||
#define TERM_TOP_BORDER_Y (TERM_MARGIN + TERM_HEIGHT + TERM_MARGIN)
|
#define TERM_TOP_BORDER_Y (TERM_MARGIN + TERM_INFO_HEIGHT + TERM_MARGIN)
|
||||||
|
|
||||||
/* The X position of the left border. */
|
/* The X position of the left border. */
|
||||||
#define TERM_LEFT_BORDER_X TERM_MARGIN
|
#define TERM_LEFT_BORDER_X TERM_MARGIN
|
||||||
|
@ -98,27 +98,23 @@ draw_border (void)
|
||||||
grub_putcode (DISP_HLINE);
|
grub_putcode (DISP_HLINE);
|
||||||
grub_putcode (DISP_UR);
|
grub_putcode (DISP_UR);
|
||||||
|
|
||||||
i = 1;
|
for (i = 0; i < (unsigned) TERM_NUM_ENTRIES; i++)
|
||||||
while (1)
|
|
||||||
{
|
{
|
||||||
grub_gotoxy (TERM_MARGIN, TERM_TOP_BORDER_Y + i);
|
grub_gotoxy (TERM_MARGIN, TERM_TOP_BORDER_Y + i + 1);
|
||||||
|
|
||||||
if (i > (unsigned) TERM_NUM_ENTRIES)
|
|
||||||
break;
|
|
||||||
|
|
||||||
grub_putcode (DISP_VLINE);
|
grub_putcode (DISP_VLINE);
|
||||||
grub_gotoxy (TERM_MARGIN + TERM_BORDER_WIDTH - 1, TERM_TOP_BORDER_Y + i);
|
grub_gotoxy (TERM_MARGIN + TERM_BORDER_WIDTH - 1, TERM_TOP_BORDER_Y + i + 1);
|
||||||
grub_putcode (DISP_VLINE);
|
grub_putcode (DISP_VLINE);
|
||||||
|
|
||||||
i++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
grub_gotoxy (TERM_MARGIN, TERM_TOP_BORDER_Y + TERM_NUM_ENTRIES + 1);
|
||||||
grub_putcode (DISP_LL);
|
grub_putcode (DISP_LL);
|
||||||
for (i = 0; i < TERM_BORDER_WIDTH - 2; i++)
|
for (i = 0; i < TERM_BORDER_WIDTH - 2; i++)
|
||||||
grub_putcode (DISP_HLINE);
|
grub_putcode (DISP_HLINE);
|
||||||
grub_putcode (DISP_LR);
|
grub_putcode (DISP_LR);
|
||||||
|
|
||||||
grub_setcolorstate (GRUB_TERM_COLOR_STANDARD);
|
grub_setcolorstate (GRUB_TERM_COLOR_STANDARD);
|
||||||
|
|
||||||
|
grub_gotoxy (TERM_MARGIN, TERM_TOP_BORDER_Y + TERM_NUM_ENTRIES + TERM_MARGIN + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -172,12 +168,12 @@ print_entry (int y, int highlight, grub_menu_entry_t entry)
|
||||||
grub_gotoxy (TERM_LEFT_BORDER_X + TERM_MARGIN, y);
|
grub_gotoxy (TERM_LEFT_BORDER_X + TERM_MARGIN, y);
|
||||||
grub_putchar (' ');
|
grub_putchar (' ');
|
||||||
for (x = TERM_LEFT_BORDER_X + TERM_MARGIN + 1;
|
for (x = TERM_LEFT_BORDER_X + TERM_MARGIN + 1;
|
||||||
x < TERM_LEFT_BORDER_X + TERM_BORDER_WIDTH - 1;
|
x < TERM_LEFT_BORDER_X + TERM_BORDER_WIDTH - TERM_MARGIN;
|
||||||
x++)
|
x++)
|
||||||
{
|
{
|
||||||
if (*title && x <= TERM_LEFT_BORDER_X + TERM_ENTRY_WIDTH + 1)
|
if (*title && x <= TERM_LEFT_BORDER_X + TERM_BORDER_WIDTH - TERM_MARGIN - 1)
|
||||||
{
|
{
|
||||||
if (x == TERM_LEFT_BORDER_X + TERM_ENTRY_WIDTH + 1)
|
if (x == TERM_LEFT_BORDER_X + TERM_BORDER_WIDTH - TERM_MARGIN - 1)
|
||||||
grub_putcode (DISP_RIGHT);
|
grub_putcode (DISP_RIGHT);
|
||||||
else
|
else
|
||||||
grub_putchar (*title++);
|
grub_putchar (*title++);
|
||||||
|
@ -196,7 +192,7 @@ print_entries (grub_menu_t menu, int first, int offset)
|
||||||
grub_menu_entry_t e;
|
grub_menu_entry_t e;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
grub_gotoxy (TERM_LEFT_BORDER_X + TERM_BORDER_WIDTH + TERM_MARGIN,
|
grub_gotoxy (TERM_LEFT_BORDER_X + TERM_BORDER_WIDTH,
|
||||||
TERM_FIRST_ENTRY_Y);
|
TERM_FIRST_ENTRY_Y);
|
||||||
|
|
||||||
if (first)
|
if (first)
|
||||||
|
@ -213,7 +209,7 @@ print_entries (grub_menu_t menu, int first, int offset)
|
||||||
e = e->next;
|
e = e->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
grub_gotoxy (TERM_LEFT_BORDER_X + TERM_BORDER_WIDTH + TERM_MARGIN,
|
grub_gotoxy (TERM_LEFT_BORDER_X + TERM_BORDER_WIDTH,
|
||||||
TERM_TOP_BORDER_Y + TERM_NUM_ENTRIES);
|
TERM_TOP_BORDER_Y + TERM_NUM_ENTRIES);
|
||||||
|
|
||||||
if (e)
|
if (e)
|
||||||
|
|
Loading…
Reference in a new issue