X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=lib-ui%2Fsidebar.c;h=b59a874765eca3b389870faf142e33045f5a4a93;hp=0ca8ce9cc38104709c26a1a30bc92cf8d1105f39;hb=3438f31945bb94bc4f4b9603ac47fcde03d5c073;hpb=eab27dfc9eb0f7b21b560f37ec28f48cfbfa9f40 diff --git a/lib-ui/sidebar.c b/lib-ui/sidebar.c index 0ca8ce9..b59a874 100644 --- a/lib-ui/sidebar.c +++ b/lib-ui/sidebar.c @@ -13,10 +13,9 @@ */ #include -#include - #include -#include + +#include #include "mutt.h" #include "charset.h" @@ -173,11 +172,6 @@ sidebar_number_format(char* dest, ssize_t destlen, return src; } -int sidebar_need_count(void) -{ - return ui_layout_sidebar_w() && !m_strisempty(SidebarNumberFormat); -} - /* print single item * returns: * 0 item was not printed ('cause of $sidebar_newmail_only) @@ -259,7 +253,6 @@ int sidebar_draw(void) { static short prev_show_value = -1; int x, y, line; - char blank[STRING]; WINDOW *sw; /* initialize first time */ @@ -275,43 +268,40 @@ int sidebar_draw(void) return 0; getmaxyx(sw, y, x); - memset(&blank, ' ', sizeof(blank)); - - wmove(sw, 0, 0); - WSETCOLOR(sw, MT_COLOR_STATUS); - waddnstr(sw, blank, x); + SETCOLOR(sw, MT_COLOR_SIDEBAR); + mvwhline(sw, 0, 0, ACS_HLINE, x - 1); + mvwaddch(sw, 0, x - 1, ACS_TTEE); line = 1; for (int i = calc_boundaries(); i < Incoming.len && line < y - 1; i++) { BUFFY *tmp = Incoming.arr[i]; if (i == CurBuffy) - WSETCOLOR(sw, MT_COLOR_INDICATOR); + SETCOLOR(sw, MT_COLOR_INDICATOR); else if (tmp->new > 0) - WSETCOLOR(sw, MT_COLOR_NEW); + SETCOLOR(sw, MT_COLOR_NEW); else if (tmp->msg_flagged > 0) - WSETCOLOR(sw, MT_COLOR_FLAGGED); + SETCOLOR(sw, MT_COLOR_FLAGGED); else - WSETCOLOR(sw, MT_COLOR_NORMAL); + SETCOLOR(sw, MT_COLOR_NORMAL); if (make_sidebar_entry(sw, tmp->path, i, x - 1)) { - WSETCOLOR(sw, MT_COLOR_SIDEBAR); + SETCOLOR(sw, MT_COLOR_SIDEBAR); waddch(sw, ACS_VLINE); line++; } } while (line < y - 1) { - WSETCOLOR(sw, MT_COLOR_NORMAL); - waddnstr(sw, blank, x - 1); - WSETCOLOR(sw, MT_COLOR_SIDEBAR); - waddch(sw, ACS_VLINE); - line++; + SETCOLOR(sw, MT_COLOR_NORMAL); + whline(sw, ' ', x - 1); + SETCOLOR(sw, MT_COLOR_SIDEBAR); + mvwaddch(sw, line++, x - 1, ACS_VLINE); } - WSETCOLOR(sw, MT_COLOR_STATUS); - waddnstr(sw, blank, x); - WSETCOLOR(sw, MT_COLOR_NORMAL); + SETCOLOR(sw, MT_COLOR_SIDEBAR); + mvwhline(sw, y - 1, 0, ACS_HLINE, x - 1); + mvwaddch(sw, y - 1, x - 1, ACS_BTEE); return 0; }