#endif
};
-#define HDR_XOFFSET 14
-#define TITLE_FMT "%14s" /* Used for Prompts, which are ASCII */
-#define W (COLS - HDR_XOFFSET - SidebarWidth)
+#define HDR_XOFFSET 14
+#define TITLE_FMT "%14s" /* Used for Prompts, which are ASCII */
+#define SW (option(OPTMBOXPANE)?SidebarWidth:0)
+#define W (COLS - HDR_XOFFSET - SW)
static char *Prompts[] = {
"From: ",
if ((WithCrypto & APPLICATION_PGP) && (WithCrypto & APPLICATION_SMIME)) {
if (!msg->security)
- mvaddstr (HDR_CRYPT, SidebarWidth, " Security: ");
+ mvaddstr (HDR_CRYPT, SW, " Security: ");
else if (msg->security & APPLICATION_SMIME)
- mvaddstr (HDR_CRYPT, SidebarWidth, " S/MIME: ");
+ mvaddstr (HDR_CRYPT, SW, " S/MIME: ");
else if (msg->security & APPLICATION_PGP)
- mvaddstr (HDR_CRYPT, SidebarWidth, " PGP: ");
+ mvaddstr (HDR_CRYPT, SW, " PGP: ");
}
else if ((WithCrypto & APPLICATION_SMIME))
- mvaddstr (HDR_CRYPT, SidebarWidth, " S/MIME: ");
+ mvaddstr (HDR_CRYPT, SW, " S/MIME: ");
else if ((WithCrypto & APPLICATION_PGP))
- mvaddstr (HDR_CRYPT, SidebarWidth, " PGP: ");
+ mvaddstr (HDR_CRYPT, SW, " PGP: ");
else
return;
}
clrtoeol ();
- move (HDR_CRYPTINFO, SidebarWidth);
+ move (HDR_CRYPTINFO, SW);
clrtoeol ();
if ((WithCrypto & APPLICATION_PGP)
&& msg->security & APPLICATION_PGP && msg->security & SIGN)
&& (msg->security & APPLICATION_SMIME)
&& (msg->security & ENCRYPT)
&& SmimeCryptAlg && *SmimeCryptAlg) {
- mvprintw (HDR_CRYPTINFO, SidebarWidth + 40, "%s%s", _("Encrypt with: "),
+ mvprintw (HDR_CRYPTINFO, SW + 40, "%s%s", _("Encrypt with: "),
NONULL (SmimeCryptAlg));
off = 20;
}
int c;
char *t;
- mvaddstr (HDR_MIX, SidebarWidth, " Mix: ");
+ mvaddstr (HDR_MIX, SW, " Mix: ");
if (!chain) {
addstr ("<no chain defined>");
if (t && t[0] == '0' && t[1] == '\0')
t = "<random>";
- if (c + str_len (t) + 2 >= COLS - SidebarWidth)
+ if (c + str_len (t) + 2 >= COLS - SW)
break;
addstr (NONULL (t));
buf[0] = 0;
rfc822_write_address (buf, sizeof (buf), addr, 1);
- mvprintw (line, SidebarWidth, TITLE_FMT, Prompts[line - 1]);
+ mvprintw (line, SW, TITLE_FMT, Prompts[line - 1]);
mutt_paddstr (W, buf);
}
#ifdef USE_NNTP
}
else {
- mvprintw (HDR_TO, SidebarWidth, TITLE_FMT, Prompts[HDR_NEWSGROUPS - 1]);
+ mvprintw (HDR_TO, SW, TITLE_FMT, Prompts[HDR_NEWSGROUPS - 1]);
mutt_paddstr (W, NONULL (msg->env->newsgroups));
- mvprintw (HDR_CC, SidebarWidth, TITLE_FMT, Prompts[HDR_FOLLOWUPTO - 1]);
+ mvprintw (HDR_CC, SW, TITLE_FMT, Prompts[HDR_FOLLOWUPTO - 1]);
mutt_paddstr (W, NONULL (msg->env->followup_to));
if (option (OPTXCOMMENTTO)) {
mvprintw (HDR_BCC, 0, TITLE_FMT, Prompts[HDR_XCOMMENTTO - 1]);
}
}
#endif
- mvprintw (HDR_SUBJECT, SidebarWidth, TITLE_FMT, Prompts[HDR_SUBJECT - 1]);
+ mvprintw (HDR_SUBJECT, SW, TITLE_FMT, Prompts[HDR_SUBJECT - 1]);
mutt_paddstr (W, NONULL (msg->env->subject));
draw_envelope_addr (HDR_REPLYTO, msg->env->reply_to);
- mvprintw (HDR_FCC, SidebarWidth, TITLE_FMT, Prompts[HDR_FCC - 1]);
+ mvprintw (HDR_FCC, SW, TITLE_FMT, Prompts[HDR_FCC - 1]);
mutt_paddstr (W, fcc);
if (WithCrypto)
#endif
SETCOLOR (MT_COLOR_STATUS);
- mvaddstr (HDR_ATTACH - 1, SidebarWidth, _("-- Attachments"));
+ mvaddstr (HDR_ATTACH - 1, SW, _("-- Attachments"));
BKGDSET (MT_COLOR_STATUS);
clrtoeol ();
/* redraw the expanded list so the user can see the result */
buf[0] = 0;
rfc822_write_address (buf, sizeof (buf), *addr, 1);
- move (line, HDR_XOFFSET + SidebarWidth);
+ move (line, HDR_XOFFSET + SW);
mutt_paddstr (W, buf);
return 0;
buf[0] = 0;
if (mutt_get_field ("Subject: ", buf, sizeof (buf), 0) == 0) {
str_replace (&msg->env->subject, buf);
- move (HDR_SUBJECT, HDR_XOFFSET + SidebarWidth);
+ move (HDR_SUBJECT, HDR_XOFFSET + SW);
clrtoeol ();
if (msg->env->subject)
mutt_paddstr (W, msg->env->subject);
if (mutt_get_field ("Fcc: ", buf, sizeof (buf), M_FILE | M_CLEAR) == 0) {
strfcpy (fcc, buf, _POSIX_PATH_MAX);
mutt_pretty_mailbox (fcc);
- move (HDR_FCC, HDR_XOFFSET + SidebarWidth);
+ move (HDR_FCC, HDR_XOFFSET + SW);
mutt_paddstr (W, fcc);
fccSet = 1;
}
#include <string.h>
#include <stdlib.h>
+#define SW (option(OPTMBOXPANE)?SidebarWidth:0)
+
extern int Charset_is_utf8; /* FIXME: bad modularisation */
extern size_t UngetCount;
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, SidebarWidth);
+ 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);
}
else {
attrset (menu->color (i));
}
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);
return;
}
- move (menu->oldcurrent + menu->offset - menu->top, SidebarWidth);
+ move (menu->oldcurrent + menu->offset - menu->top, SW);
SETCOLOR (MT_COLOR_NORMAL);
BKGDSET (MT_COLOR_NORMAL);
clrtoeol ();
menu_make_entry (buf, sizeof (buf), menu, menu->oldcurrent);
menu_pad_string (buf, sizeof (buf));
- move (menu->oldcurrent + menu->offset - menu->top, SidebarWidth + 3);
+ 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 it in the new location */
- move (menu->current + menu->offset - menu->top, SidebarWidth);
+ move (menu->current + menu->offset - menu->top, SW);
attrset (menu->color (menu->current));
ADDCOLOR (MT_COLOR_INDICATOR);
addstr ("->");
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);
{
char buf[STRING];
- move (menu->current + menu->offset - menu->top, SidebarWidth);
+ move (menu->current + menu->offset - menu->top, SW);
menu_make_entry (buf, sizeof (buf), menu, menu->current);
menu_pad_string (buf, sizeof (buf));
menu->oldcurrent = menu->current;
if (option (OPTARROWCURSOR))
- move (menu->current - menu->top + menu->offset, 2);
+ move (menu->current - menu->top + menu->offset, SW + 2);
else if (option (OPTBRAILLEFRIENDLY))
- move (menu->current - menu->top + menu->offset, 0);
+ move (menu->current - menu->top + menu->offset, SW);
else
move (menu->current - menu->top + menu->offset, COLS - 1);
#include <sys/types.h>
#include <utime.h>
+#define SW (option(OPTMBOXPANE)?SidebarWidth:0)
+
BODY *mutt_new_body (void)
{
BODY *p = (BODY *) mem_calloc (1, sizeof (BODY));
if (DrawFullLine || option (OPTSTATUSONTOP))
count = (COLS < destlen ? COLS : destlen);
else
- count =
- ((COLS - SidebarWidth) <
- destlen ? (COLS - SidebarWidth) : destlen);
+ count = ((COLS - SW) < destlen ? (COLS - SW) : destlen);
if (count > col) {
count -= col; /* how many columns left on this line */
mutt_FormatString (buf, sizeof (buf), src, callback, data, flags);
#define IsSendAttach(x) (x && (x)->bdy && !(x)->fp)
#define IsMsgAttach(x) (x && (x)->fp && (x)->bdy && (x)->bdy->hdr)
#define IsHeader(x) (x && (x)->hdr && !(x)->bdy)
+#define SW (option(OPTMBOXPANE)?SidebarWidth:0)
static const char *Not_available_in_this_menu =
N_("Not available in this menu.");
if (!(flags & (M_SHOWFLAT)))
wrap_cols -= WrapMargin;
- wrap_cols -= SidebarWidth;
+ wrap_cols -= SW;
if (wrap_cols <= 0)
wrap_cols = COLS;
if ((redraw & REDRAW_BODY) || topline != oldtopline) {
do {
- move (bodyoffset, SidebarWidth);
+ move (bodyoffset, SW);
curline = oldtopline = topline;
lines = 0;
force_redraw = 0;
&SearchRE) > 0)
lines++;
curline++;
- move (lines + bodyoffset, SidebarWidth);
+ move (lines + bodyoffset, SW);
redraw |= REDRAW_SIDEBAR;
}
last_offset = lineInfo[curline].offset;
addch ('~');
addch ('\n');
lines++;
- move (lines + bodyoffset, SidebarWidth);
+ move (lines + bodyoffset, SW);
}
/* We are going to update the pager status bar, so it isn't
* necessary to reset to normal color now. */
}
if (option(OPTSTATUSONTOP)) {
move(0,0);
+ } else {
+ move(LINES-2,SW);
}
- /*move (indexoffset + (option (OPTSTATUSONTOP) ? 0 : (InHelp?(LINES-2):(indexlen - 1))),
- option (OPTSTATUSONTOP) ? 0 : SidebarWidth);*/
- mutt_paddstr (COLS - 10 - (option(OPTSTATUSONTOP)?0:SidebarWidth), IsHeader (extra)
+ mutt_paddstr (COLS - 10 - (option(OPTSTATUSONTOP)?0:SW), IsHeader (extra)
|| IsMsgAttach (extra) ? buffer : banner);
addstr (" -- (");
/* print out the index status bar */
menu_status_line (buffer, sizeof (buffer), index, NONULL (Status));
move (indexoffset + (option (OPTSTATUSONTOP) ? 0 : (indexlen - 1)),
- option (OPTSTATUSONTOP) ? 0 : SidebarWidth);
+ option (OPTSTATUSONTOP) ? 0 : SW);
SETCOLOR (MT_COLOR_STATUS);
BKGDSET (MT_COLOR_STATUS);
- mutt_paddstr (COLS - (option (OPTSTATUSONTOP) ? 0 : SidebarWidth),
+ mutt_paddstr (COLS - (option (OPTSTATUSONTOP) ? 0 : SW),
buffer);
SETCOLOR (MT_COLOR_NORMAL);
BKGDSET (MT_COLOR_NORMAL);
static int known_lines = 0;
static short initialized = 0;
static short prev_show_value;
-static short saveSidebarWidth;
/* computes first entry to be shown */
void calc_boundaries (int menu)
CurBuffy = 0;
if (TopBuffy < 0 || TopBuffy >= Incoming->length)
TopBuffy = 0;
- /* correct known_lines if it has changed because of a window resize */
- /* if (known_lines != LINES)
- known_lines = LINES; */
- lines = LINES - 2 - (menu != MENU_PAGER || option (OPTSTATUSONTOP));
+ lines = LINES - 2 - (option (OPTSTATUSONTOP));
known_lines = lines;
if (option (OPTSIDEBARNEWMAILONLY)) {
int i = CurBuffy;
/* initialize first time */
if (!initialized) {
prev_show_value = option (OPTMBOXPANE);
- saveSidebarWidth = SidebarWidth;
- if (!option (OPTMBOXPANE)){
- SidebarWidth = 0;
+ if (!option (OPTMBOXPANE))
draw_devider = 1;
- }
initialized = 1;
}
/* save or restore the value SidebarWidth */
if (prev_show_value != option (OPTMBOXPANE)) {
- if (prev_show_value && !option (OPTMBOXPANE)) {
- saveSidebarWidth = SidebarWidth;
- SidebarWidth = 0;
- }
- else if (!prev_show_value && option (OPTMBOXPANE)) {
- SidebarWidth = saveSidebarWidth;
+ if (!prev_show_value && option (OPTMBOXPANE)) {
/* after toggle: force recounting of all mail */
buffy_check (2);
}