From: Michael D. Lowis Date: Sat, 5 Jan 2019 19:06:43 +0000 (-0500) Subject: removed unused colors and updated to use FG color for cursor X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=c6a38cbe726633cb24477a7f223f4942ee8d7273;p=projs%2Ftide.git removed unused colors and updated to use FG color for cursor --- diff --git a/config.h b/config.h index ac52cbf..f0325c5 100644 --- a/config.h +++ b/config.h @@ -4,9 +4,9 @@ enum { Off = 0, On = 1 }; enum { /* Color Names */ - Red, Green, Yellow, Blue, Purple, Aqua, Orange, - EditBg, EditFg, EditSel, EditCsr, - TagsBg, TagsFg, TagsSel, TagsCsr, + Red, Purple, Orange, + EditBg, EditFg, EditSel, + TagsBg, TagsFg, TagsSel, ScrollBg, ScrollFg, VerBdr, HorBdr, ClrCount @@ -61,21 +61,15 @@ int WinWidth, WinHeight, ScrollWidth, Timeout, TabWidth, ScrollBy, #endif static int Palette[ClrCount] = { - [Red] = 0xd1160b, /* Red */ - [Green] = 0x1e7b3d, /* Green */ - [Blue] = 0x0c6cc0, /* Blue */ - [Yellow] = 0xfed910, /* Yellow ??? */ - [Purple] = 0x7878ba, /* Purple ??? */ - [Aqua] = 0x00695c, /* Aqua ??? */ - [Orange] = 0xf39812, /* Orange ??? */ + [Red] = 0xD1160B, /* Red */ + [Purple] = 0x7878BA, /* Purple */ + [Orange] = 0xF39812, /* Orange */ [EditBg] = 0xF0F0E5, /* Edit region background */ - [EditSel] = 0xDFDF99, /* Edit region selection */ [EditFg] = 0x000000, /* Edit region text */ - [EditCsr] = 0x000000, /* Edit region cursor */ + [EditSel] = 0xDFDF99, /* Edit region selection */ [TagsBg] = 0xE5F0F0, /* Tags region background */ - [TagsSel] = 0x99DFDF, /* Tags region selection */ [TagsFg] = 0x000000, /* Tags region text */ - [TagsCsr] = 0x000000, /* Tags region cursor */ + [TagsSel] = 0x99DFDF, /* Tags region selection */ [ScrollBg] = 0x909047, /* Scroll region background */ [ScrollFg] = 0xF0F0E5, /* Scroll region foreground */ [VerBdr] = 0x909047, /* Vertical border */ diff --git a/inc/draw.h b/inc/draw.h index adbf1ff..fd24354 100644 --- a/inc/draw.h +++ b/inc/draw.h @@ -7,5 +7,5 @@ void draw_rect(XConf* x, int color, int posx, int posy, int width, int height); void draw_statbox(XConf* x, int status); int draw_hrule(XConf* x, drawcsr* csr); void draw_view(XConf* x, View* view, XftFont* font, size_t nrows, drawcsr* csr, int bg, int fg, int sel, bool csrsync); -bool draw_csr(XConf* x, View* view, size_t fheight, int posx, int posy, bool csrdrawn); +bool draw_csr(XConf* x, View* view, int fg, size_t fheight, int posx, int posy, bool csrdrawn); void draw_scroll(XConf* x, drawcsr* csr, View* view, int divider); diff --git a/src/lib/draw.c b/src/lib/draw.c index fb1f9cb..94233f5 100644 --- a/src/lib/draw.c +++ b/src/lib/draw.c @@ -44,7 +44,7 @@ void draw_view(XConf* x, View* view, XftFont* font, size_t nrows, drawcsr* csr, if (buf_insel(&(view->buffer), row->cols[i].off)) draw_rect(x, sel, posx, y, row->cols[i].width, fheight); if (row->cols[i].off == view->buffer.selection.end) { - csr_drawn = draw_csr(x, view, fheight, posx, y, csr_drawn); + csr_drawn = draw_csr(x, view, fg, fheight, posx, y, csr_drawn); if (csrsync) { XWarpPointer(x->display, x->self, x->self, 0, 0, x->width, x->height, posx-4, y + fheight/2); csrsync = false; @@ -62,11 +62,11 @@ void draw_view(XConf* x, View* view, XftFont* font, size_t nrows, drawcsr* csr, free(specs); } -bool draw_csr(XConf* x, View* view, size_t fheight, int posx, int posy, bool csrdrawn) { +bool draw_csr(XConf* x, View* view, int fg, size_t fheight, int posx, int posy, bool csrdrawn) { if (!csrdrawn && !view_selsize(view)) { - draw_rect(x, EditCsr, posx-1, posy, 3, 3); - draw_rect(x, EditCsr, posx, posy, 1, fheight); - draw_rect(x, EditCsr, posx-1, posy+fheight-3, 3, 3); + draw_rect(x, fg, posx-1, posy, 3, 3); + draw_rect(x, fg, posx, posy, 1, fheight); + draw_rect(x, fg, posx-1, posy+fheight-3, 3, 3); csrdrawn = true; } return csrdrawn; diff --git a/src/pick.c b/src/pick.c index c605e55..947f3e5 100644 --- a/src/pick.c +++ b/src/pick.c @@ -177,9 +177,9 @@ static void redraw(XConf* x) { /* draw the query and the cursor to the query region */ int posx = 2 + glyphinfo.width + offset; - x11_draw_rect(x, Palette[TagsCsr], posx-1, 2, 3, 3); - x11_draw_rect(x, Palette[TagsCsr], posx, 2, 1, fheight); - x11_draw_rect(x, Palette[TagsCsr], posx-1, 2+fheight-3, 3, 3); + x11_draw_rect(x, Palette[TagsFg], posx-1, 2, 3, 3); + x11_draw_rect(x, Palette[TagsFg], posx, 2, 1, fheight); + x11_draw_rect(x, Palette[TagsFg], posx-1, 2+fheight-3, 3, 3); x11_draw_string(x, x->font, offset + 2, fheight, Palette[TagsFg], Query); /* draw the scored and sorted results */