ref: 28f0259d48be125dd16b74ae81d0a23dc430a08a
dir: /libdraw-menucol/
mouse menu color patch diff -r d4af852fff2d sys/src/libdraw/emenuhit.c --- a/sys/src/libdraw/emenuhit.c Sat Aug 08 09:20:48 2015 +0200 +++ b/sys/src/libdraw/emenuhit.c Sat Aug 15 02:08:58 2015 +0300 @@ -27,13 +27,14 @@ menucolors(void) { /* Main tone is greenish, with negative selection */ - back = allocimagemix(display, DPalegreen, DWhite); - high = allocimage(display, Rect(0,0,1,1), CMAP8, 1, DDarkgreen); /* dark green */ - bord = allocimage(display, Rect(0,0,1,1), CMAP8, 1, DMedgreen); /* not as dark green */ - if(back==nil || high==nil || bord==nil) + text = allocimage(display, Rect(0,0,1,1), CMAP8, 1, 0x884400FF); + high = allocimage(display, Rect(0,0,1,1), CMAP8, 1, 0x884400FF); + bord = allocimage(display, Rect(0,0,1,1), CMAP8, 1, 0x440000FF); + if(text==nil || high==nil || bord==nil) goto Error; - text = display->black; + back = display->black; htext = back; + menutxt = high; return; Error: @@ -149,10 +150,7 @@ if(r.max.y < r.min.y+2) r.max.y = r.min.y+2; border(screen, r, 1, bord, ZP); - if(menutxt == 0) - menutxt = allocimage(display, Rect(0, 0, 1, 1), CMAP8, 1, DDarkgreen); - if(menutxt) - draw(screen, insetrect(r, 1), menutxt, nil, ZP); + draw(screen, insetrect(r, 1), menutxt, nil, ZP); } int diff -r d4af852fff2d sys/src/libdraw/menuhit.c --- a/sys/src/libdraw/menuhit.c Sat Aug 08 09:20:48 2015 +0200 +++ b/sys/src/libdraw/menuhit.c Sat Aug 15 02:08:58 2015 +0300 @@ -28,13 +28,14 @@ menucolors(void) { /* Main tone is greenish, with negative selection */ - back = allocimagemix(display, DPalegreen, DWhite); - high = allocimage(display, Rect(0,0,1,1), screen->chan, 1, DDarkgreen); /* dark green */ - bord = allocimage(display, Rect(0,0,1,1), screen->chan, 1, DMedgreen); /* not as dark green */ - if(back==nil || high==nil || bord==nil) + text = allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0x884400FF); + high = allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0x884400FF); + bord = allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0x440000FF); + if(text==nil || high==nil || bord==nil) goto Error; - text = display->black; + back = display->black; htext = back; + menutxt = high; return; Error: @@ -146,10 +147,7 @@ if(r.max.y < r.min.y+2) r.max.y = r.min.y+2; border(m, r, 1, bord, ZP); - if(menutxt == 0) - menutxt = allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, DDarkgreen); /* border color; BUG? */ - if(menutxt) - draw(m, insetrect(r, 1), menutxt, nil, ZP); + draw(m, insetrect(r, 1), menutxt, nil, ZP); } int