]> git.mdlowis.com Git - projs/tide.git/commitdiff
removed unused colors and updated to use FG color for cursor
authorMichael D. Lowis <mike@mdlowis.com>
Sat, 5 Jan 2019 19:06:43 +0000 (14:06 -0500)
committerMichael D. Lowis <mike@mdlowis.com>
Sat, 5 Jan 2019 19:06:43 +0000 (14:06 -0500)
config.h
inc/draw.h
src/lib/draw.c
src/pick.c

index ac52cbfc61a81ab85cceb6cc553d4236e2f74a3c..f0325c577c0e8298d01691821667dfae1f50a0d9 100644 (file)
--- 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 */
index adbf1ffed39d3e4b99d11de521eb69077e1d4ddc..fd243542bbdb522dee7595e6ee2fda749a004b3a 100644 (file)
@@ -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);
index fb1f9cb822fe5207afccc2e1bfe591f1c600a971..94233f5d640c71463e072c1364c06e2b57c4cac8 100644 (file)
@@ -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;
index c605e5585e13c928d909491b6d6d3bb001c79853..947f3e55c1f9f5b583b0834190514419bb30bfc2 100644 (file)
@@ -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 */