From 34a88259726b0a7dacc3affe6f37214f893c9ce3 Mon Sep 17 00:00:00 2001 From: nion Date: Thu, 14 Apr 2005 19:43:19 +0000 Subject: [PATCH] Nico Golde: - sidebar delimiter is only drawn at the start and if the sidebar_visibility changes git-svn-id: svn://svn.berlios.de/mutt-ng/trunk@265 e385b8ad-14ed-0310-8656-cc95a2468c6d --- sidebar.c | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) 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); -- 2.20.1