diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-13 15:06:35 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-13 15:06:35 +0000 |
| commit | 5100b165ea37229cbdc9d2614ae0be248ddf3a30 (patch) | |
| tree | b387a0db5fba4bca623a63bef055ca4096488607 /src/cmd/acme/acme.c | |
| parent | f39a2407b6e6ace6af68e466bfa2f362b9a9dd36 (diff) | |
Diffstat (limited to 'src/cmd/acme/acme.c')
| -rw-r--r-- | src/cmd/acme/acme.c | 97 |
1 files changed, 46 insertions, 51 deletions
diff --git a/src/cmd/acme/acme.c b/src/cmd/acme/acme.c index bb774153..b4968fc0 100644 --- a/src/cmd/acme/acme.c +++ b/src/cmd/acme/acme.c @@ -1033,63 +1033,58 @@ Cursor2 boxcursor2 = { 0x00, 0x00, 0x00, 0x00} }; -void -iconinit(void) -{ - Rectangle r; - Image *tmp; - - if(tagcols[BACK] == nil) { - /* Blue */ - tagcols[BACK] = allocimagemix(display, DPalebluegreen, DWhite); - tagcols[HIGH] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, DPalegreygreen); - tagcols[BORD] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, DPurpleblue); - tagcols[TEXT] = display->black; - tagcols[HTEXT] = display->black; - - /* Yellow */ - textcols[BACK] = allocimagemix(display, DPaleyellow, DWhite); - textcols[HIGH] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, DDarkyellow); - textcols[BORD] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, DYellowgreen); - textcols[TEXT] = display->black; - textcols[HTEXT] = display->black; - } - - r = Rect(0, 0, Scrollwid, font->height+1); - if(button && eqrect(r, button->r)) - return; - - if(button){ - freeimage(button); - freeimage(modbutton); - freeimage(colbutton); - } - - button = allocimage(display, r, screen->chan, 0, DNofill); - draw(button, r, tagcols[BACK], nil, r.min); - border(button, r, ButtonBorder, tagcols[BORD], ZP); - - r = button->r; - modbutton = allocimage(display, r, screen->chan, 0, DNofill); - draw(modbutton, r, tagcols[BACK], nil, r.min); - border(modbutton, r, ButtonBorder, tagcols[BORD], ZP); - r = insetrect(r, ButtonBorder); - tmp = allocimage(display, Rect(0,0,1,1), screen->chan, 1, DMedblue); - draw(modbutton, r, tmp, nil, ZP); - freeimage(tmp); - - r = button->r; - colbutton = allocimage(display, r, screen->chan, 0, DPurpleblue); - - but2col = allocimage(display, r, screen->chan, 1, 0xAA0000FF); - but3col = allocimage(display, r, screen->chan, 1, 0x006600FF); -} /* * /dev/snarf updates when the file is closed, so we must open our own * fd here rather than use snarffd */ +void +iconinit(void) +{ + Rectangle r; + Image *tmp; + + /* Blue */ + tagcols[BACK] = display->white; + tagcols[HIGH] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0x72DEC2FF); + tagcols[BORD] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0x72DEC2FF); + tagcols[TEXT] = display->black; + tagcols[HTEXT] = display->white; + + /* Yellow */ + textcols[BACK] = allocimagemix(display, DWhite, DWhite); + textcols[HIGH] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0x72DEC2FF); + /* Halftone */ + textcols[BORD] = allocimage(display, Rect(0,0,2,2), CMAP8, 1, 0x000000FF); + draw(textcols[BORD], Rect(1,1,2,2), display->white, nil, ZP); + draw(textcols[BORD], Rect(0,0,1,1), display->white, nil, ZP); + textcols[TEXT] = display->black; + textcols[HTEXT] = display->black; + + if(button){ + freeimage(button); + freeimage(modbutton); + freeimage(colbutton); + } + /* Button */ + r = Rect(0, 0, Scrollwid, font->height+1); + button = allocimage(display, r, screen->chan, 0, DNofill); + draw(button, r, tagcols[BORD], nil, r.min); + r.max.x -= 4; + fillellipse(button, (Point){r.min.x + 5, r.min.y + 7}, 3, 3, display->white, ZP); + /* Mod Button */ + r = button->r; + modbutton = allocimage(display, r, screen->chan, 0, DNofill); + draw(modbutton, r, tagcols[BORD], nil, r.min); + r = insetrect(r, 2); + fillellipse(modbutton, (Point){r.min.x + 3, r.min.y + 5}, 3, 3, display->black, ZP); + r = button->r; + colbutton = allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0x72DEC2FF); + but2col = allocimage(display, r, screen->chan, 1, 0x000000FF); + but3col = allocimage(display, r, screen->chan, 1, 0x72DEC2FF); +} + /* rio truncates larges snarf buffers, so this avoids using the * service if the string is huge */ |