From 68426d08023b6264b911e059881068762f3cf5a1 Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Thu, 10 May 2018 14:09:34 -0400 Subject: [PATCH] filled out palette based on colors from scheakur vim color scheme. Implemented first pass at a status box that changes colors based on status of the buffer --- colors.html | 39 +++++++++++++++++++++++++++++++++++++++ config.mk | 2 +- lib/config.c | 14 +++++++------- lib/x11.c | 12 ++++++++++-- 4 files changed, 57 insertions(+), 10 deletions(-) create mode 100644 colors.html diff --git a/colors.html b/colors.html new file mode 100644 index 0000000..6326288 --- /dev/null +++ b/colors.html @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config.mk b/config.mk index 16a1cff..b46121f 100644 --- a/config.mk +++ b/config.mk @@ -16,7 +16,7 @@ INCS += -I/usr/include/freetype2 # Compiler Setup CC = cc CFLAGS = -g --std=c99 -MMD $(INCS) -CFLAGS += -Wall -Werror +#CFLAGS += -Wall -Werror # Linker Setup LD = $(CC) diff --git a/lib/config.c b/lib/config.c index eb5678c..38a1502 100644 --- a/lib/config.c +++ b/lib/config.c @@ -32,13 +32,13 @@ int /* Integer config options */ DosLineFeed = OFF; int Palette[ClrCount] = { - [Red] = 0x772222, // Red - [Green] = 0x227722, // Green - [Blue] = 0x222277, // Blue - [Yellow] = 0x000000, // Yellow ??? - [Purple] = 0x000000, // Purple ??? - [Aqua] = 0x000000, // Aqua ??? - [Orange] = 0x000000, // Orange ??? + [Red] = 0xd1160b, // Red + [Green] = 0x1e7b3d, // Green + [Blue] = 0x0c6cc0, // Blue + [Yellow] = 0xfed910, // Yellow ??? + [Purple] = 0x7878ba, // Purple ??? + [Aqua] = 0x00695c, // Aqua ??? + [Orange] = 0xf39812, // Orange ??? [EditBg] = 0xF0F0E5, // Edit region background [EditSel] = 0xDFDF99, // Edit region selection [EditFg] = 0x000000, // Edit region text diff --git a/lib/x11.c b/lib/x11.c index 64d3001..e2613b5 100644 --- a/lib/x11.c +++ b/lib/x11.c @@ -274,6 +274,13 @@ static void draw_rect(int color, int x, int y, int width, int height) { XftColorFree(X.display, X.visual, X.colormap, &clr); } +static void draw_statbox(drawcsr* csr) { + View* view = win_view(EDIT); + int statclr = Orange; //(view->buffer.modified ? Purple : TagsBg); + draw_rect(VerBdr, ScrollWidth, 0, 1, X.height/4); + draw_rect(statclr, 0, 0, ScrollWidth, X.height/4); +} + static void draw_view(int i, size_t nrows, drawcsr* csr, int bg, int fg, int sel) { size_t fheight = X.font->height; size_t csrx = SIZE_MAX, csry = SIZE_MAX; @@ -313,10 +320,9 @@ static void draw_view(int i, size_t nrows, drawcsr* csr, int bg, int fg, int sel } static void draw_hrule(drawcsr* csr) { - draw_rect(HorBdr, csr->x, csr->y + 1, csr->w, 1); + draw_rect(HorBdr, 0, csr->y + 1, X.width, 1); Divider = csr->y; csr->y += 2; - csr->x += ScrollWidth + 1; } static void draw_scroll(drawcsr* csr) { @@ -490,6 +496,8 @@ static void xupdate(Job* job) { size_t editrows = maxrows - tagrows; /* draw the regions to the window */ drawcsr csr = { .w = X.width, .h = X.height }; + csr.x += ScrollWidth + 1; + draw_statbox(&csr); draw_view(TAGS, tagrows, &csr, TagsBg, TagsFg, TagsSel); draw_hrule(&csr); draw_view(EDIT, editrows, &csr, EditBg, EditFg, EditSel); -- 2.49.0