X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=lib-ui%2Fsidebar.c;h=238a5dd1b34e12532b1af5b8db0fd650a960b060;hp=9f6e9cea483d50e26ad743bdf53ae80e3122c513;hb=f435868132e200bfa71ac155f037cf64bf5414ba;hpb=b23d5033080fe9f9fba038e3cf1e3ec2b0a0d33d diff --git a/lib-ui/sidebar.c b/lib-ui/sidebar.c index 9f6e9ce..238a5dd 100644 --- a/lib-ui/sidebar.c +++ b/lib-ui/sidebar.c @@ -12,10 +12,9 @@ * please see the file GPL in the top level source directory. */ -#include +#include #include -#include #include #include @@ -186,7 +185,6 @@ static int make_sidebar_entry (char* sbox, int idx, ssize_t len) { int shortened = 0, lencnt = 0; char no[STRING], entry[STRING]; - int l = m_strlen(ImapHomeNamespace); int l_m = m_strlen(Maildir); if (SidebarWidth > COLS) @@ -202,10 +200,6 @@ static int make_sidebar_entry (char* sbox, int idx, ssize_t len) m_strformat(no, len, SidebarWidth, SidebarNumberFormat, sidebar_number_format, idx, 0); lencnt = m_strlen(no); - if (l > 0 && m_strncmp(sbox, ImapHomeNamespace, l) == 0 && - m_strlen(sbox) > l) - sbox += l + 1; /* we're trimming the ImapHomeNamespace, the "+ 1" is for the separator */ - else if (l_m > 0 && m_strncmp(sbox, Maildir, l_m) == 0 && m_strlen(sbox) > l_m) { sbox += l_m; @@ -222,7 +216,7 @@ static int make_sidebar_entry (char* sbox, int idx, ssize_t len) snprintf(entry, sizeof(entry), "%*s", (int)len, no); memcpy(entry, sbox, MIN(len - 1, m_strlen(sbox))); - addnstr(entry, len); + waddnstr(stdscr, entry, len); if (shortened) p_delete(&sbox); @@ -274,15 +268,11 @@ void sidebar_draw_frames (void) { /* draw vertical delimiter */ SETCOLOR (MT_COLOR_SIDEBAR); for (i = 0; i < LINES-1; i++) { - move (i, SidebarWidth - delim_len); - if (option (OPTASCIICHARS)) - addstr (NONULL (SidebarDelim)); - else if (!option (OPTASCIICHARS) && !m_strcmp(SidebarDelim, "|")) - addch (ACS_VLINE); - else if ((Charset_is_utf8) && !m_strcmp(SidebarDelim, "|")) - addstr ("\342\224\202"); + wmove (stdscr, i, SidebarWidth - delim_len); + if (!m_strcmp(SidebarDelim, "|")) + waddch (stdscr, ACS_VLINE); else - addstr (NONULL (SidebarDelim)); + waddstr (stdscr, NONULL (SidebarDelim)); } /* fill "gaps" at top+bottom */ @@ -293,16 +283,16 @@ void sidebar_draw_frames (void) { * gap with spaces to get bg color */ if (option(OPTSTATUSONTOP) || option(OPTHELP)) { - move(0,i); - addch(' '); + wmove(stdscr, 0,i); + waddch(stdscr, ' '); } /* * if we don't have $status_on_top or we have $help, fill bottom * gap with spaces to get bg color */ if (!option(OPTSTATUSONTOP) || option(OPTHELP)) { - move(LINES-2,i); - addch(' '); + wmove(stdscr, LINES-2,i); + waddch(stdscr, ' '); } } SETCOLOR (MT_COLOR_NORMAL); @@ -368,7 +358,7 @@ int sidebar_draw (void) { else SETCOLOR (MT_COLOR_NORMAL); - move (line, 0); + wmove (stdscr, line, 0); line += make_sidebar_entry (tmp->path, i, SidebarWidth-delim_len); } @@ -377,8 +367,8 @@ int sidebar_draw (void) { /* fill with blanks to bottom */ memset(&blank, ' ', sizeof(blank)); for (; line < last_line; line++) { - move (line, 0); - addnstr (blank, SidebarWidth-delim_len); + wmove (stdscr, line, 0); + waddnstr (stdscr, blank, SidebarWidth-delim_len); } return 0; }