summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-12-10 14:49:21 -0800
committerH. Peter Anvin <hpa@zytor.com>2007-12-10 14:49:21 -0800
commit511c24537d4f9b73400ce27017094c2dad0fdcce (patch)
treef74a77dcde1b6a3cd12c9b007f05067ac664c0f8
parent91a157b9e0af564c65351e6d898b828cdea21af7 (diff)
downloadsyslinux-511c24537d4f9b73400ce27017094c2dad0fdcce.tar.gz
Separate attribute control for disabled menu itemssyslinux-3.54-pre1
"menu color disabled" for disabled menu items.
-rw-r--r--README.menu2
-rw-r--r--com32/modules/menumain.c10
2 files changed, 9 insertions, 3 deletions
diff --git a/README.menu b/README.menu
index c5c8b4c2..5fba0f2c 100644
--- a/README.menu
+++ b/README.menu
@@ -240,6 +240,7 @@ MENU COLOR element ansi foreground background shadow
hotkey Unselected hotkey
sel Selection bar
hotsel Selected hotkey
+ disabled Disabled menu item
scrollbar Scroll bar
tabmsg Press [Tab] message
cmdmark Command line marker
@@ -314,6 +315,7 @@ MENU COLOR element ansi foreground background shadow
menu color hotkey 1;37;44 #ffffffff #00000000 std
menu color sel 7;37;40 #e0000000 #20ff8000 all
menu color hotsel 1;7;37;40 #e0400000 #20ff8000 all
+ menu color disabled 1;30;44 #60cccccc #00000000 std
menu color scrollbar 30;44 #40000000 #00000000 std
menu color tabmsg 31;40 #90ffff00 #00000000 std
menu color cmdmark 1;36;40 #c000ffff #00000000 std
diff --git a/com32/modules/menumain.c b/com32/modules/menumain.c
index 23248a64..48685729 100644
--- a/com32/modules/menumain.c
+++ b/com32/modules/menumain.c
@@ -55,6 +55,7 @@
* 14 - timeout_msg Timeout message
* 15 - timeout Timeout counter
* 16 - help Current entry help text
+ * 17 - disabled Disabled menu item
*/
static const struct color_table default_color_table[] = {
@@ -75,6 +76,7 @@ static const struct color_table default_color_table[] = {
{ "timeout_msg", "37;40", 0x80ffffff, 0x00000000, SHADOW_NORMAL },
{ "timeout", "1;37;40", 0xc0ffffff, 0x00000000, SHADOW_NORMAL },
{ "help", "37;40", 0xc0ffffff, 0x00000000, SHADOW_NORMAL },
+ { "disabled", "1;30;44", 0x60cccccc, 0x00000000, SHADOW_NORMAL },
};
#define NCOLORS (sizeof default_color_table/sizeof(struct color_table))
@@ -264,16 +266,18 @@ static void
draw_row(int y, int sel, int top, int sbtop, int sbbot)
{
int i = (y-4-VSHIFT)+top;
+ int dis = (i < nentries) && menu_entries[i].disabled;
printf("\033[%d;%dH\1#1\016x\017%s ",
- y, MARGIN+1+HSHIFT, (i == sel) ? "\1#5" : "\1#3");
+ y, MARGIN+1+HSHIFT,
+ (i == sel) ? "\1#5" : dis ? "\2#17" : "\1#3");
if ( i >= nentries ) {
fputs(pad_line("", 0, WIDTH-2*MARGIN-4), stdout);
} else {
display_entry(&menu_entries[i],
- (i == sel) ? "\1#5" : "\1#3",
- (i == sel) ? "\1#6" : "\1#4",
+ (i == sel) ? "\1#5" : dis ? "\2#17" : "\1#3",
+ (i == sel) ? "\1#6" : dis ? "\2#17" : "\1#4",
WIDTH-2*MARGIN-4);
}