X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=sidebar.c;h=a1a3b5b077039dd1c2d44948b58ceb7b406b53a3;hp=40a0fee3343e2007d75fc99c1e2f094b2f7cae9a;hb=34a88259726b0a7dacc3affe6f37214f893c9ce3;hpb=b2a6a9673e124c222f921650a6f0025b64ab2145 diff --git a/sidebar.c b/sidebar.c index 40a0fee..a1a3b5b 100644 --- a/sidebar.c +++ b/sidebar.c @@ -216,6 +216,7 @@ int sidebar_draw (int menu) { int lines = option (OPTHELP) ? 1 : 0; + int draw_devider=1; BUFFY *tmp; int i = 0; short delim_len = safe_strlen (SidebarDelim); @@ -224,8 +225,10 @@ int sidebar_draw (int menu) if (!initialized) { prev_show_value = option (OPTMBOXPANE); saveSidebarWidth = SidebarWidth; - if (!option (OPTMBOXPANE)) + if (!option (OPTMBOXPANE)){ SidebarWidth = 0; + draw_devider = 1; + } initialized = 1; } @@ -253,21 +256,23 @@ int sidebar_draw (int menu) if (SidebarWidth == 0 || !option (OPTMBOXPANE)) return 0; - - /* draw the divider */ - SETCOLOR (MT_COLOR_SIDEBAR); - for (lines = 1; - lines < LINES - 1 - (menu != MENU_PAGER || option (OPTSTATUSONTOP)); - lines++) { - move (lines, SidebarWidth - delim_len); - if (option (OPTASCIICHARS)) - addstr (NONULL (SidebarDelim)); - else if (!option (OPTASCIICHARS) && !safe_strcmp (SidebarDelim, "|")) - addch (ACS_VLINE); - else if ((Charset_is_utf8) && !safe_strcmp (SidebarDelim, "|")) - addstr ("\342\224\202"); - else - addstr (NONULL (SidebarDelim)); + /* draw devider only if necessary (if the sidebar becomes visible e.g.)*/ + if (draw_devider == 1){ + /* draw the divider */ + SETCOLOR (MT_COLOR_SIDEBAR); + for (lines = 1; + lines < LINES - 1 - (menu != MENU_PAGER || option (OPTSTATUSONTOP)); + lines++) { + move (lines, SidebarWidth - delim_len); + if (option (OPTASCIICHARS)) + addstr (NONULL (SidebarDelim)); + else if (!option (OPTASCIICHARS) && !safe_strcmp (SidebarDelim, "|")) + addch (ACS_VLINE); + else if ((Charset_is_utf8) && !safe_strcmp (SidebarDelim, "|")) + addstr ("\342\224\202"); + else + addstr (NONULL (SidebarDelim)); + } } SETCOLOR (MT_COLOR_NORMAL);