static void menu_pad_string (char *s, size_t n)
{
- int shift = option (OPTARROWCURSOR) ? 3 : 0;
- int cols;
+ int cols = COLS - SW;
char *tmpbuf = p_new(char, n);
- cols = COLS - SW - shift;
mutt_format_string (tmpbuf, n, cols, cols, 0, ' ', s, m_strlen(s), 1);
tmpbuf[n - 1] = 0;
snprintf (s, n, "%s", tmpbuf); /* overkill */
menu_make_entry (buf, sizeof (buf), menu, i);
menu_pad_string (buf, sizeof (buf));
- if (option (OPTARROWCURSOR)) {
- attrset (menu->color (i));
- CLEARLINE_WIN (i - menu->top + menu->offset);
+ attrset (menu->color (i));
- if (i == menu->current) {
- attrset (menu->color (i));
- ADDCOLOR (MT_COLOR_INDICATOR);
- BKGDSET (MT_COLOR_INDICATOR);
- addstr ("->");
- attrset (menu->color (i));
- addch (' ');
- }
- else {
- attrset (menu->color (i));
- move (i - menu->top + menu->offset, SW);
- addstr (" ");
- }
-
- print_enriched_string (menu->color (i), (unsigned char *) buf, 1);
- SETCOLOR (MT_COLOR_NORMAL);
- BKGDSET (MT_COLOR_NORMAL);
+ if (i == menu->current) {
+ ADDCOLOR (MT_COLOR_INDICATOR);
+ BKGDSET (MT_COLOR_INDICATOR);
}
- else {
- attrset (menu->color (i));
-
- if (i == menu->current) {
- ADDCOLOR (MT_COLOR_INDICATOR);
- BKGDSET (MT_COLOR_INDICATOR);
- }
- CLEARLINE_WIN (i - menu->top + menu->offset);
+ CLEARLINE_WIN (i - menu->top + menu->offset);
- move (i - menu->top + menu->offset, SW);
- print_enriched_string (menu->color (i), (unsigned char *) buf,
- i != menu->current);
- SETCOLOR (MT_COLOR_NORMAL);
- BKGDSET (MT_COLOR_NORMAL);
- }
- }
- else
+ move (i - menu->top + menu->offset, SW);
+ print_enriched_string (menu->color (i), (unsigned char *) buf,
+ i != menu->current);
+ SETCOLOR (MT_COLOR_NORMAL);
+ BKGDSET (MT_COLOR_NORMAL);
+ } else {
CLEARLINE_WIN (i - menu->top + menu->offset);
+ }
}
sidebar_draw ();
SETCOLOR (MT_COLOR_NORMAL);
BKGDSET (MT_COLOR_NORMAL);
- if (option (OPTARROWCURSOR)) {
- /* clear the pointer */
- attrset (menu->color (menu->oldcurrent));
- addstr (" ");
+ /* erase the current indicator */
+ attrset (menu->color (menu->oldcurrent));
+ clrtoeol ();
+ menu_make_entry (buf, sizeof (buf), menu, menu->oldcurrent);
+ menu_pad_string (buf, sizeof (buf));
+ print_enriched_string (menu->color (menu->oldcurrent),
+ (unsigned char *) buf, 1);
- if (menu->redraw & REDRAW_MOTION_RESYNCH) {
- clrtoeol ();
- menu_make_entry (buf, sizeof (buf), menu, menu->oldcurrent);
- menu_pad_string (buf, sizeof (buf));
- move (menu->oldcurrent + menu->offset - menu->top, SW + 3);
- print_enriched_string (menu->color (menu->oldcurrent),
- (unsigned char *) buf, 1);
- SETCOLOR (MT_COLOR_NORMAL);
- }
+ /* now draw the new one to reflect the change */
+ menu_make_entry (buf, sizeof (buf), menu, menu->current);
+ menu_pad_string (buf, sizeof (buf));
+ attrset (menu->color (menu->current));
+ ADDCOLOR (MT_COLOR_INDICATOR);
+ BKGDSET (MT_COLOR_INDICATOR);
+ CLEARLINE_WIN (menu->current - menu->top + menu->offset);
+ move (menu->current + menu->offset - menu->top, SW);
+ print_enriched_string (menu->color (menu->current), (unsigned char *) buf,
+ 0);
+ SETCOLOR (MT_COLOR_NORMAL);
+ BKGDSET (MT_COLOR_NORMAL);
- /* now draw it in the new location */
- move (menu->current + menu->offset - menu->top, SW);
- attrset (menu->color (menu->current));
- ADDCOLOR (MT_COLOR_INDICATOR);
- addstr ("->");
- SETCOLOR (MT_COLOR_NORMAL);
- }
- else {
- /* erase the current indicator */
- attrset (menu->color (menu->oldcurrent));
- clrtoeol ();
- menu_make_entry (buf, sizeof (buf), menu, menu->oldcurrent);
- menu_pad_string (buf, sizeof (buf));
- print_enriched_string (menu->color (menu->oldcurrent),
- (unsigned char *) buf, 1);
-
- /* now draw the new one to reflect the change */
- menu_make_entry (buf, sizeof (buf), menu, menu->current);
- menu_pad_string (buf, sizeof (buf));
- attrset (menu->color (menu->current));
- ADDCOLOR (MT_COLOR_INDICATOR);
- BKGDSET (MT_COLOR_INDICATOR);
- CLEARLINE_WIN (menu->current - menu->top + menu->offset);
- move (menu->current + menu->offset - menu->top, SW);
- print_enriched_string (menu->color (menu->current), (unsigned char *) buf,
- 0);
- SETCOLOR (MT_COLOR_NORMAL);
- BKGDSET (MT_COLOR_NORMAL);
- }
menu->redraw &= REDRAW_STATUS;
}
menu_make_entry (buf, sizeof (buf), menu, menu->current);
menu_pad_string (buf, sizeof (buf));
- if (option (OPTARROWCURSOR)) {
- int attr = menu->color (menu->current);
+ attrset (menu->color (menu->current));
+ ADDCOLOR (MT_COLOR_INDICATOR);
+ BKGDSET (MT_COLOR_INDICATOR);
+ clrtoeol ();
+ print_enriched_string (menu->color (menu->current), (unsigned char *) buf,
+ 0);
+ SETCOLOR (MT_COLOR_NORMAL);
+ BKGDSET (MT_COLOR_NORMAL);
- attrset (attr);
- clrtoeol ();
- attrset (menu->color (menu->current));
- ADDCOLOR (MT_COLOR_INDICATOR);
- addstr ("->");
- attrset (attr);
- addch (' ');
- menu_pad_string (buf, sizeof (buf));
- print_enriched_string (menu->color (menu->current), (unsigned char *) buf,
- 1);
- SETCOLOR (MT_COLOR_NORMAL);
- }
- else {
- attrset (menu->color (menu->current));
- ADDCOLOR (MT_COLOR_INDICATOR);
- BKGDSET (MT_COLOR_INDICATOR);
- clrtoeol ();
- print_enriched_string (menu->color (menu->current), (unsigned char *) buf,
- 0);
- SETCOLOR (MT_COLOR_NORMAL);
- BKGDSET (MT_COLOR_NORMAL);
- }
menu->redraw &= REDRAW_STATUS;
}
menu->oldcurrent = menu->current;
- if (option (OPTARROWCURSOR))
- move (menu->current - menu->top + menu->offset, SW + 2);
- else if (option (OPTBRAILLEFRIENDLY))
+ if (option (OPTBRAILLEFRIENDLY))
move (menu->current - menu->top + menu->offset, SW);
else
move (menu->current - menu->top + menu->offset, COLS - 1);