From: Michael D. Lowis Date: Fri, 2 Mar 2018 02:05:27 +0000 (-0500) Subject: removed status region X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=ca47d927b0989a699ab3ea3713e139f85d6a82ea;p=projs%2Ftide.git removed status region --- diff --git a/inc/win.h b/inc/win.h index 6a4f5c7..d1cef57 100644 --- a/inc/win.h +++ b/inc/win.h @@ -7,12 +7,11 @@ enum { }; typedef enum { - STATUS = 0, - TAGS = 1, - EDIT = 2, - SCROLL = 3, - NREGIONS = 4, - FOCUSED = 4 + TAGS = 0, + EDIT = 1, + SCROLL = 2, + NREGIONS = 3, + FOCUSED = 3 } WinRegion; typedef struct { diff --git a/lib/win.c b/lib/win.c index 67f9bfd..55fc9e9 100644 --- a/lib/win.c +++ b/lib/win.c @@ -42,7 +42,6 @@ static void win_init(void (*errfn)(char*)) { view_init(&(Regions[i].view), NULL, errfn); x11_init(&Config); Font = x11_font_load(config_get_str(FontString)); - Regions[STATUS].clrnor = config_get_int(ClrStatusNor); Regions[SCROLL].clrnor = config_get_int(ClrScrollNor); Regions[TAGS].clrnor = config_get_int(ClrTagsNor); Regions[TAGS].clrsel = config_get_int(ClrTagsSel); @@ -195,7 +194,6 @@ static size_t gutter_size(void) { static void layout(int width, int height) { size_t fheight = x11_font_height(Font); size_t fwidth = x11_font_width(Font); - View* statview = win_view(STATUS); View* tagview = win_view(TAGS); View* editview = win_view(EDIT); @@ -209,11 +207,7 @@ static void layout(int width, int height) { Regions[i].height = fheight; } - /* place the status region */ - view_resize(statview, 1, Regions[STATUS].width / fwidth); - /* Place the tag region relative to status */ - Regions[TAGS].y = 5 + Regions[STATUS].y + Regions[STATUS].height; size_t maxtagrows = ((height - Regions[TAGS].y - 5) / 4) / fheight; size_t tagcols = Regions[TAGS].width / fwidth; size_t tagrows = view_limitrows(tagview, maxtagrows, tagcols); @@ -240,7 +234,6 @@ static void onredraw(int width, int height) { layout(width, height); onupdate(); // Let the user program update the status and other content - view_update(win_view(STATUS), Regions[STATUS].clrnor, Regions[STATUS].clrsel, &(Regions[STATUS].csrx), &(Regions[STATUS].csry)); view_update(win_view(TAGS), Regions[TAGS].clrnor, Regions[TAGS].clrsel, &(Regions[TAGS].csrx), &(Regions[TAGS].csry)); view_update(win_view(EDIT), Regions[EDIT].clrnor, Regions[EDIT].clrsel, &(Regions[EDIT].csrx), &(Regions[EDIT].csry)); onlayout(); // Let the user program update the scroll bar diff --git a/pick.c b/pick.c index eb9b95c..0400d22 100644 --- a/pick.c +++ b/pick.c @@ -222,12 +222,10 @@ static KeyBinding Bindings[] = { #ifndef TEST int main(int argc, char** argv) { - char* title = getenv("PICKTITLE"); load_choices(); if (vec_size(&Choices) > 1) { win_window("pick", true, onerror); win_setkeys(Bindings, NULL); - win_settext(STATUS, (title ? title : "pick")); if (argc >= 2) { for (char* str = argv[1]; *str; str++) buf_insert(win_buf(TAGS), false, Pos++, *str); diff --git a/tide.c b/tide.c index e2bf28f..64b40bc 100644 --- a/tide.c +++ b/tide.c @@ -486,28 +486,6 @@ void onfocus(bool focused) { } void onupdate(void) { - static char status_bytes[256]; - memset(status_bytes, 0, sizeof(status_bytes)); - char* status = status_bytes; - Buf* buf = win_buf(EDIT); - *(status++) = (buf->charset == BINARY ? 'B' : 'U'); - *(status++) = (buf->crlf ? 'C' : 'N'); - *(status++) = (buf->expand_tabs ? 'S' : 'T'); - *(status++) = (buf->copy_indent ? 'I' : 'i'); - *(status++) = (SearchDir < 0 ? '<' : '>'); - *(status++) = (buf->modified ? '*' : ' '); - *(status++) = ' '; - size_t remlen = sizeof(status_bytes) - strlen(status_bytes) - 1; - if (pty_active()) { - char* path = getcurrdir(); - strncat(status, path, remlen); - free(path); - } else { - char* path = (buf->path ? buf->path : "*scratch*"); - strncat(status, path, remlen); - } - win_settext(STATUS, status_bytes); - win_view(STATUS)->selection = (Sel){0,0,0}; } void onlayout(void) {