mutt/nion.sidebar-color.diff
2015-09-11 15:37:14 +00:00

71 lines
2.1 KiB
Diff

diff --git a/mutt-1.5.24/color.c b/mutt-1.5.24/color.c
--- a/mutt-1.5.24/color.c
+++ b/mutt-1.5.24/color.c
@@ -95,6 +95,7 @@ static const struct mapping_t Fields[] =
{ "index", MT_COLOR_INDEX },
{ "sidebar_new", MT_COLOR_NEW },
{ "sidebar_flagged", MT_COLOR_FLAGGED },
+ { "sidebar", MT_COLOR_SIDEBAR },
{ "prompt", MT_COLOR_PROMPT },
{ NULL, 0 }
};
@@ -145,6 +146,7 @@ void ci_start_color (void)
/* set some defaults */
ColorDefs[MT_COLOR_STATUS] = A_REVERSE;
+ ColorDefs[MT_COLOR_SIDEBAR] = A_REVERSE;
ColorDefs[MT_COLOR_INDICATOR] = A_REVERSE;
ColorDefs[MT_COLOR_SEARCH] = A_REVERSE;
ColorDefs[MT_COLOR_MARKERS] = A_REVERSE;
diff --git a/mutt-1.5.24/mutt_curses.h b/mutt-1.5.24/mutt_curses.h
--- a/mutt-1.5.24/mutt_curses.h
+++ b/mutt-1.5.24/mutt_curses.h
@@ -119,6 +119,7 @@ enum
MT_COLOR_ATTACHMENT,
MT_COLOR_SEARCH,
MT_COLOR_BOLD,
+ MT_COLOR_SIDEBAR,
MT_COLOR_UNDERLINE,
MT_COLOR_INDEX,
MT_COLOR_NEW,
diff --git a/mutt-1.5.24/sidebar.c b/mutt-1.5.24/sidebar.c
--- a/mutt-1.5.24/sidebar.c
+++ b/mutt-1.5.24/sidebar.c
@@ -250,13 +250,14 @@ int draw_sidebar(int menu) {
}
/* get attributes for divider */
- SETCOLOR(MT_COLOR_STATUS);
+ SETCOLOR(MT_COLOR_SIDEBAR);
#ifndef USE_SLANG_CURSES
attr_get(&attrs, &color_pair, 0);
#else
color_pair = attr_get();
#endif
SETCOLOR(MT_COLOR_NORMAL);
+ /* SETCOLOR(MT_COLOR_SIDEBAR); */
/* draw the divider */
@@ -266,10 +267,14 @@ int draw_sidebar(int menu) {
for ( ; lines < SidebarHeight; lines++ ) {
move(lines, SidebarWidth - delim_len);
- addstr(NONULL(SidebarDelim));
-#ifndef USE_SLANG_CURSES
- mvchgat(lines, SidebarWidth - delim_len, delim_len, 0, color_pair, NULL);
-#endif
+ if (option (OPTASCIICHARS))
+ addstr (NONULL (SidebarDelim));
+ else if (!option (OPTASCIICHARS) && !strcmp (NONULL(SidebarDelim), "|"))
+ addch (ACS_VLINE);
+ else if ((Charset_is_utf8) && !strcmp (NONULL(SidebarDelim), "|"))
+ addstr ("\342\224\202");
+ else
+ addstr (NONULL (SidebarDelim));
}
if ( Incoming == 0 ) return 0;