WHERE char *PrintCmd;
WHERE char *QueryCmd;
WHERE char *Realname;
-WHERE char *SidebarDelim;
WHERE char *SidebarNumberFormat;
WHERE char *SidebarBoundary;
WHERE char *SignOffString;
** of the message you are replying to into the edit buffer.
** The ``$$weed'' setting applies.
*/
- {"help", DT_BOOL, R_BOTH, OPTHELP, "yes" },
- /*
- ** .pp
- ** When \fIset\fP, help lines describing the bindings for the major functions
- ** provided by each menu are displayed on the first line of the screen.
- ** .pp
- ** \fBNote:\fP The binding will not be displayed correctly if the
- ** function is bound to a sequence rather than a single keystroke. Also,
- ** the help line may not be updated if a binding is changed while Madmutt is
- ** running. Since this variable is primarily aimed at new users, neither
- ** of these should present a major problem.
- */
{"hidden_host", DT_BOOL, R_NONE, OPTHIDDENHOST, "no" },
/*
** .pp
** variable specifies the characters at which to split a folder name into
** ``hierarchy items.''
*/
- {"sidebar_delim", DT_STR, R_BOTH, UL &SidebarDelim, "|"},
- /*
- ** .pp
- ** This specifies the delimiter between the sidebar (if visible) and
- ** other screens.
- */
{"sidebar_visible", DT_BOOL, R_BOTH, OPTMBOXPANE, "no" },
/*
** .pp
enter.c
hdrline.c
history.c
+ layout.c
menu.c
query.c
sidebar.c
#include <lib-ui/lib-ui.h>
-#include <termios.h>
-#ifdef HAVE_SYS_IOCTL_H
-# include <sys/ioctl.h>
-#elif defined(HAVE_IOCTL_H)
-# include <ioctl.h>
-#endif
#include <langinfo.h>
+#include <termios.h>
#include <lib-lua/lib-lua.h>
#include <lib-sys/unix.h>
static ssize_t UngetBufLen = 0;
static event_t *KeyEvent;
-void mutt_refresh (void)
-{
- /* don't refresh when we are waiting for a child. */
- if (option (OPTKEEPQUIET))
- return;
-
- /* don't refresh in the middle of macros unless necessary */
- if (UngetCount && !option (OPTFORCEREFRESH))
- return;
-
- /* else */
- wrefresh (stdscr);
-}
-
-void mutt_need_hard_redraw (void)
-{
- keypad (stdscr, TRUE);
- clearok (stdscr, TRUE);
- set_option (OPTNEEDREDRAW);
-}
-
event_t mutt_getch (void)
{
int ch;
meta(stdscr, TRUE);
}
-void curses_install(void)
-{
- SETCOLOR(MT_COLOR_NORMAL);
- wclear(stdscr);
- mutt_error = mutt_curses_error;
- mutt_message = mutt_curses_message;
-}
-
-void mutt_endwin (const char *msg)
-{
- if (!option (OPTNOCURSES)) {
- CLEARLINE (LINES - 1);
-
- wattrset (stdscr, A_NORMAL);
- mutt_refresh ();
- endwin ();
- }
-
- if (msg && *msg) {
- puts (msg);
- fflush (stdout);
- }
-}
-
void _mutt_perror (const char *s, const char* filename, int line)
{
char *p = strerror (errno);
while (n-- > 0)
waddch (stdscr, ' ');
}
-
-/* this routine should be called after receiving SIGWINCH */
-void mutt_resize_screen (void)
-{
- char *cp;
- int fd;
- struct winsize w;
-
- int rows, cols;
-
- rows = -1;
- cols = -1;
- if ((fd = open ("/dev/tty", O_RDONLY)) != -1) {
- if (ioctl (fd, TIOCGWINSZ, &w) != -1) {
- rows = w.ws_row;
- cols = w.ws_col;
- }
- close (fd);
- }
- if (rows <= 0) {
- if ((cp = getenv ("LINES")) != NULL) {
- rows = atoi (cp);
- }
- else
- rows = 24;
- }
- if (cols <= 0) {
- if ((cp = getenv ("COLUMNS")) != NULL)
- cols = atoi (cp);
- else
- cols = 80;
- }
- resizeterm (rows, cols);
-}
if (menu->redraw & REDRAW_STATUS) {
menu_status_line (buf, sizeof (buf), menu, NONULL (Status));
CLEARLINE (option (OPTSTATUSONTOP) ? 0 : LINES - 2);
- sidebar_draw_frames();
SETCOLOR (MT_COLOR_STATUS);
BKGDSET (MT_COLOR_STATUS);
wmove(stdscr, option (OPTSTATUSONTOP) ? 0 : LINES - 2,SW);
if (SigWinch) {
mutt_flushinp ();
- mutt_resize_screen ();
+ ui_layout_resize();
menu->redraw = REDRAW_FULL;
menu->menu = MENU_MAIN;
- SigWinch = 0;
menu->top = 0; /* so we scroll the right amount */
- /*
- * force a real complete redraw. wclrtobot(stdscr) doesn't seem to be able
- * to handle every case without this.
- */
- clearok (stdscr, TRUE);
continue;
}
void curses_initialize(void);
void curses_install(void);
-void mutt_endwin (const char *);
void mutt_flushinp (void);
-void mutt_refresh (void);
-void mutt_resize_screen (void);
void mutt_ungetch (int, int);
-void mutt_need_hard_redraw (void);
/* ----------------------------------------------------------------------------
* Support for color
HEADER *, format_flag);
+#define WSETCOLOR(w, X) wattrset(w, ColorDefs[X])
#define SETCOLOR(X) wattrset(stdscr, ColorDefs[X])
#define ADDCOLOR(X) wattron(stdscr, ColorDefs[X])
--- /dev/null
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * Copyright © 2006 Pierre Habouzit
+ */
+
+#include <lib-ui/lib-ui.h>
+
+#include <termios.h>
+#ifdef HAVE_SYS_IOCTL_H
+# include <sys/ioctl.h>
+#elif defined(HAVE_IOCTL_H)
+# include <ioctl.h>
+#endif
+
+static struct {
+ int rows, cols;
+ WINDOW *sidebar;
+ WINDOW *main;
+} layout;
+
+void mutt_need_hard_redraw(void)
+{
+ keypad(stdscr, true);
+ clearok(stdscr, true);
+ set_option(OPTNEEDREDRAW);
+}
+
+void mutt_refresh(void)
+{
+ /* don't refresh when we are waiting for a child. */
+ if (option(OPTKEEPQUIET))
+ return;
+
+#if 0 /* MC: WHY ? */
+ /* don't refresh in the middle of macros unless necessary */
+ if (UngetCount && !option(OPTFORCEREFRESH))
+ return;
+#endif
+
+ /* else */
+ wrefresh(stdscr);
+ if (layout.sidebar)
+ wrefresh(layout.sidebar);
+}
+
+void mutt_endwin(const char *msg)
+{
+ if (!option(OPTNOCURSES)) {
+ CLEARLINE(LINES - 1);
+
+ if (layout.sidebar) {
+ delwin(layout.sidebar);
+ layout.sidebar = NULL;
+ }
+ if (layout.main) {
+ delwin(layout.main);
+ layout.main = NULL;
+ }
+
+ wattrset(stdscr, A_NORMAL);
+ mutt_refresh();
+ endwin();
+ }
+
+ if (!m_strisempty(msg)) {
+ puts(msg);
+ fflush(stdout);
+ }
+}
+
+void ui_layout_init(void)
+{
+ SETCOLOR(MT_COLOR_NORMAL);
+ wclear(stdscr);
+ mutt_error = mutt_curses_error;
+ mutt_message = mutt_curses_message;
+
+ getmaxyx(stdscr, layout.rows, layout.cols);
+}
+
+void ui_layout_resize(void)
+{
+ if (SigWinch) {
+ int fd;
+ struct winsize w;
+
+ layout.rows = layout.cols = -1;
+
+ if ((fd = open("/dev/tty", O_RDONLY)) != -1) {
+ if (ioctl(fd, TIOCGWINSZ, &w) != -1) {
+ layout.rows = w.ws_row;
+ layout.cols = w.ws_col;
+ }
+ close(fd);
+ }
+ if (layout.rows <= 0) {
+ layout.rows = atoi(getenv("LINES") ?: "24");
+ }
+ if (layout.cols <= 0) {
+ layout.cols = atoi(getenv("COLUMNS") ?: "80");
+ }
+ resizeterm(layout.rows, layout.cols);
+ SigWinch = 0;
+ /* force a real complete redraw. */
+ clearok(stdscr, true);
+ }
+}
+
+WINDOW *ui_layout_sidebar_w(void)
+{
+ if (option(OPTMBOXPANE) && SidebarWidth > 1 && SidebarWidth < layout.cols)
+ {
+ int sw, sh;
+
+ if (!layout.sidebar) {
+ layout.sidebar = newwin(layout.rows - 1, SidebarWidth, 0, 0);
+ }
+
+ getmaxyx(layout.sidebar, sh, sw);
+
+ if (sh != layout.rows - 1 || sw != SidebarWidth) {
+ wresize(layout.sidebar, layout.rows - 1, SidebarWidth);
+ }
+ } else {
+ if (layout.sidebar) {
+ delwin(layout.sidebar);
+ layout.sidebar = NULL;
+ }
+ }
+ return layout.sidebar;
+}
--- /dev/null
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * Copyright © 2006 Pierre Habouzit
+ */
+
+#ifndef MUTT_LIB_UI_LAYOUT_H
+#define MUTT_LIB_UI_LAYOUT_H
+
+void ui_layout_init(void);
+void ui_layout_resize(void);
+
+WINDOW *ui_layout_sidebar_w(void);
+
+void mutt_need_hard_redraw(void);
+void mutt_refresh(void);
+void mutt_endwin(const char *);
+
+#endif
#endif
#include "curses.h"
+#include "layout.h"
#endif
wmove (stdscr, 0, 0);
wclrtobot (stdscr);
- if (option (OPTHELP)) {
- SETCOLOR (MT_COLOR_STATUS);
- wmove (stdscr, option (OPTSTATUSONTOP) ? LINES - 2 : 0, SW);
- mutt_paddstr (COLS-SW, "");
- SETCOLOR (MT_COLOR_NORMAL);
- menu->offset = 1;
- menu->pagelen = LINES - 3;
- }
- else {
- menu->offset = option (OPTSTATUSONTOP) ? 1 : 0;
- menu->pagelen = LINES - 2;
- }
-
- sidebar_draw_frames();
-
+ SETCOLOR (MT_COLOR_STATUS);
+ wmove (stdscr, option (OPTSTATUSONTOP) ? LINES - 2 : 0, SW);
+ mutt_paddstr (COLS-SW, "");
+ SETCOLOR (MT_COLOR_NORMAL);
+ menu->offset = 1;
+ menu->pagelen = LINES - 3;
mutt_show_error ();
menu->redraw = REDRAW_INDEX | REDRAW_STATUS;
mutt_paddstr (COLS-SW, buf);
SETCOLOR (MT_COLOR_NORMAL);
menu->redraw &= ~REDRAW_STATUS;
- sidebar_draw_frames();
}
void menu_redraw_index (MUTTMENU * menu)
mutt_curs_set (1);
if (SigWinch) {
- mutt_resize_screen ();
+ ui_layout_resize();
menu->redraw = REDRAW_FULL;
- SigWinch = 0;
- clearok (stdscr, TRUE); /*force complete redraw */
}
if (i == -1)
static int TopBuffy = 0;
static int CurBuffy = 0;
-static int known_lines = 0;
static short initialized = 0;
static short prev_show_value;
/* computes first entry to be shown */
-static void calc_boundaries (void) {
- if (!Incoming.len)
- return;
- if (CurBuffy < 0 || CurBuffy >= Incoming.len)
- CurBuffy = 0;
- if (TopBuffy < 0 || TopBuffy >= Incoming.len)
- TopBuffy = 0;
-
- if (option (OPTSIDEBARNEWMAILONLY)) {
- int i = CurBuffy;
- TopBuffy = CurBuffy - 1;
- while (i >= 0) {
- if (Incoming.arr[i]->new > 0)
- TopBuffy = i;
- i--;
+static void calc_boundaries(void)
+{
+ if (!Incoming.len)
+ return;
+ if (CurBuffy < 0 || CurBuffy >= Incoming.len)
+ CurBuffy = 0;
+ if (TopBuffy < 0 || TopBuffy >= Incoming.len)
+ TopBuffy = 0;
+
+ if (option (OPTSIDEBARNEWMAILONLY)) {
+ int i = CurBuffy;
+ TopBuffy = CurBuffy - 1;
+ while (i >= 0) {
+ if (Incoming.arr[i]->new > 0)
+ TopBuffy = i;
+ i--;
+ }
+ } else {
+ TopBuffy = CurBuffy - (CurBuffy % (LINES - 3));
}
- } else if (known_lines>0)
- TopBuffy = CurBuffy - (CurBuffy % known_lines);
- if (TopBuffy < 0)
- TopBuffy = 0;
+ if (TopBuffy < 0)
+ TopBuffy = 0;
}
static char *shortened_hierarchy (char *hbox, int maxlen)
return src;
}
-int sidebar_need_count (void) {
- if (!option (OPTMBOXPANE) || SidebarWidth == 0 ||
- !SidebarNumberFormat || !*SidebarNumberFormat)
- return (0);
- return (1);
+int sidebar_need_count(void)
+{
+ return ui_layout_sidebar_w()
+ && !m_strisempty(SidebarNumberFormat);
}
/* print single item
* 0 item was not printed ('cause of $sidebar_newmail_only)
* 1 item was printed
*/
-static int make_sidebar_entry (char* sbox, int idx, ssize_t len)
+static int make_sidebar_entry(WINDOW *sw, char *sbox, int idx, ssize_t len)
{
- int shortened = 0, lencnt = 0;
- char no[STRING], entry[STRING];
- int l_m = m_strlen(Maildir);
-
- if (SidebarWidth > COLS)
- SidebarWidth = COLS;
-
- if (option (OPTSIDEBARNEWMAILONLY) && sbox && Context && Context->path &&
- m_strcmp(Context->path, sbox) && Incoming.arr[idx]->new == 0)
- /* if $sidebar_newmail_only is set, don't display the
- * box only if it's not the currently opened
- * (i.e. always display the currently opened) */
- return 0;
-
- m_strformat(no, len, SidebarWidth, SidebarNumberFormat, sidebar_number_format, idx, 0);
- lencnt = m_strlen(no);
-
- if (l_m > 0 && m_strncmp(sbox, Maildir, l_m) == 0 &&
- m_strlen(sbox) > l_m) {
- sbox += l_m;
- if (Maildir[strlen(Maildir)-1]!='/') {
- sbox += 1;
+ int shortened = 0, lencnt = 0;
+ char no[STRING], entry[STRING];
+ int l_m = m_strlen(Maildir);
+
+ if (option(OPTSIDEBARNEWMAILONLY) && sbox && Context && Context->path &&
+ m_strcmp(Context->path, sbox) && Incoming.arr[idx]->new == 0)
+ /* if $sidebar_newmail_only is set, don't display the
+ * box only if it's not the currently opened
+ * (i.e. always display the currently opened) */
+ return 0;
+
+ m_strformat(no, sizeof(no), len, SidebarNumberFormat,
+ sidebar_number_format, idx, 0);
+ lencnt = m_strlen(no);
+
+ if (l_m > 0 && m_strncmp(sbox, Maildir, l_m) == 0 &&
+ m_strlen(sbox) > l_m) {
+ sbox += l_m;
+ if (Maildir[strlen(Maildir)-1]!='/') {
+ sbox += 1;
+ }
+ } else {
+ sbox = basename(sbox);
}
- } else
- sbox = basename (sbox);
- if (option(OPTSHORTENHIERARCHY) && m_strlen(sbox) > len-lencnt-1) {
- sbox = shortened_hierarchy (sbox, len-lencnt-1);
- shortened = 1;
- }
+ if (option(OPTSHORTENHIERARCHY) && m_strlen(sbox) > len - lencnt) {
+ sbox = shortened_hierarchy(sbox, len - lencnt);
+ shortened = 1;
+ }
- snprintf(entry, sizeof(entry), "%*s", (int)len, no);
- memcpy(entry, sbox, MIN(len - 1, m_strlen(sbox)));
- waddnstr(stdscr, entry, len);
+ snprintf(entry, sizeof(entry), "%*s", (int)len, no);
+ memcpy(entry, sbox, MIN(len, m_strlen(sbox)));
+ waddnstr(sw, entry, len);
- if (shortened)
- p_delete(&sbox);
+ if (shortened)
+ p_delete(&sbox);
- return 1;
+ return 1;
}
/* returns folder name of currently
tmp->msg_flagged = curContext->flagged;
}
-void sidebar_draw_frames (void) {
- ssize_t i,delim_len;
-
- if (!option(OPTMBOXPANE) || SidebarWidth==0)
- return;
-
- delim_len=m_strlen(NONULL(SidebarDelim));
-
- /* draw vertical delimiter */
- SETCOLOR (MT_COLOR_SIDEBAR);
- for (i = 0; i < LINES-1; i++) {
- wmove (stdscr, i, SidebarWidth - delim_len);
- if (!m_strcmp(SidebarDelim, "|"))
- waddch (stdscr, ACS_VLINE);
- else
- waddstr (stdscr, NONULL (SidebarDelim));
- }
-
- /* fill "gaps" at top+bottom */
- SETCOLOR(MT_COLOR_STATUS);
- for (i=0; i<SidebarWidth; i++) {
- /*
- * if we don't have $status_on_top and have $help, fill top
- * gap with spaces to get bg color
- */
- if (option(OPTSTATUSONTOP) || option(OPTHELP)) {
- wmove(stdscr, 0,i);
- waddch(stdscr, ' ');
- }
- /*
- * if we don't have $status_on_top or we have $help, fill bottom
- * gap with spaces to get bg color
- */
- if (!option(OPTSTATUSONTOP) || option(OPTHELP)) {
- wmove(stdscr, LINES-2,i);
- waddch(stdscr, ' ');
- }
- }
- SETCOLOR (MT_COLOR_NORMAL);
-}
-
/* actually draws something
* FIXME this needs some clue when to do it
*/
-int sidebar_draw (void) {
- int first_line = option (OPTSTATUSONTOP) ? 1 : option (OPTHELP) ? 1 : 0,
- last_line = LINES - 2 + (option (OPTSTATUSONTOP) && !option (OPTHELP) ? 1 : 0),
- i = 0,line;
- BUFFY *tmp;
- ssize_t delim_len = m_strlen(SidebarDelim);
- char blank[STRING];
-
- known_lines=last_line-first_line;
-
- /* initialize first time */
- if (!initialized) {
- prev_show_value = option (OPTMBOXPANE);
- initialized = 1;
- }
+int sidebar_draw(void)
+{
+ int x, y, i, line;
+ char blank[STRING];
+ WINDOW *sw;
+
+ /* initialize first time */
+ if (!initialized) {
+ prev_show_value = option(OPTMBOXPANE);
+ initialized = 1;
+ }
- if (TopBuffy==0 || CurBuffy==0)
- calc_boundaries();
+ if (TopBuffy == 0 || CurBuffy == 0)
+ calc_boundaries();
- /* save or restore the value SidebarWidth */
- if (prev_show_value != option (OPTMBOXPANE)) {
- if (!prev_show_value && option (OPTMBOXPANE)) {
- /* after toggle: force recounting of all mail */
- buffy_check (2);
+ /* save or restore the value SidebarWidth */
+ if (prev_show_value != option(OPTMBOXPANE)) {
+ if (!prev_show_value && option(OPTMBOXPANE)) {
+ /* after toggle: force recounting of all mail */
+ buffy_check (2);
+ }
+ prev_show_value = option(OPTMBOXPANE);
}
- prev_show_value = option (OPTMBOXPANE);
- }
- if (SidebarWidth > 0 && option (OPTMBOXPANE)
- && m_strlen(SidebarDelim) >= SidebarWidth) {
- mutt_error (_("Value for sidebar_delim is too long. Disabling sidebar."));
- sleep (2);
- unset_option (OPTMBOXPANE);
- return (0);
- }
+ sw = ui_layout_sidebar_w();
+ if (!sw)
+ return 0;
+ getmaxyx(sw, y, x);
+
+ memset(&blank, ' ', sizeof(blank));
+
+ wmove(sw, 0, 0);
+ WSETCOLOR(sw, MT_COLOR_STATUS);
+ waddnstr(sw, blank, x);
+
+ for (i = TopBuffy, line = 1; i < Incoming.len && line < y; i++) {
+ BUFFY *tmp = Incoming.arr[i];
+
+ if (i == CurBuffy)
+ WSETCOLOR(sw, MT_COLOR_INDICATOR);
+ else if (tmp->new > 0)
+ WSETCOLOR(sw, MT_COLOR_NEW);
+ else if (tmp->msg_flagged > 0)
+ WSETCOLOR(sw, MT_COLOR_FLAGGED);
+ else
+ WSETCOLOR(sw, MT_COLOR_NORMAL);
+
+ if (make_sidebar_entry(sw, tmp->path, i, x - 1)) {
+ WSETCOLOR(sw, MT_COLOR_SIDEBAR);
+ waddch(sw, ACS_VLINE);
+ line++;
+ }
+ }
- if (SidebarWidth == 0 || !option (OPTMBOXPANE))
- return 0;
+ while (line < y - 1) {
+ WSETCOLOR(sw, MT_COLOR_NORMAL);
+ waddnstr(sw, blank, x - 1);
+ WSETCOLOR(sw, MT_COLOR_SIDEBAR);
+ waddch(sw, ACS_VLINE);
+ line++;
+ }
- sidebar_draw_frames();
+ WSETCOLOR(sw, MT_COLOR_STATUS);
+ waddnstr(sw, blank, x);
+ WSETCOLOR(sw, MT_COLOR_NORMAL);
- if (!Incoming.len)
return 0;
-
- /* actually print items */
- for (i = TopBuffy, line=first_line; i < Incoming.len && line < last_line; i++) {
- tmp = Incoming.arr[i];
-
- if (i == CurBuffy)
- SETCOLOR (MT_COLOR_INDICATOR);
- else if (tmp->new > 0)
- SETCOLOR (MT_COLOR_NEW);
- else if (tmp->msg_flagged > 0)
- SETCOLOR (MT_COLOR_FLAGGED);
- else
- SETCOLOR (MT_COLOR_NORMAL);
-
- wmove (stdscr, line, 0);
- line += make_sidebar_entry (tmp->path, i, SidebarWidth-delim_len);
- }
-
- SETCOLOR (MT_COLOR_NORMAL);
-
- /* fill with blanks to bottom */
- memset(&blank, ' ', sizeof(blank));
- for (; line < last_line; line++) {
- wmove (stdscr, line, 0);
- waddnstr (stdscr, blank, SidebarWidth-delim_len);
- }
- return 0;
}
/* returns index of new item with new mail or -1 */
-static int exist_next_new () {
+static int exist_next_new (void) {
int i = 0;
if (!Incoming.len)
return (-1);
}
/* returns index of prev item with new mail or -1 */
-static int exist_prev_new () {
+static int exist_prev_new (void) {
int i = 0;
if (!Incoming.len)
return (-1);
mutt_error (_("You are on the first mailbox."));
return;
}
- CurBuffy -= known_lines;
+ CurBuffy -= LINES - 3;
if (CurBuffy < 0)
CurBuffy = 0;
break;
mutt_error (_("You are on the last mailbox."));
return;
}
- CurBuffy += known_lines;
+ CurBuffy += LINES - 3;
if (CurBuffy >= Incoming.len)
CurBuffy = Incoming.len - 1;
break;
#include "mutt.h" /* because of CONTEXT :| */
int sidebar_draw (void);
-void sidebar_draw_frames (void);
void sidebar_scroll (int);
void sidebar_set_buffystats (CONTEXT *);
const char* sidebar_get_current (void);
mx_set_magic (newMagic);
if (!option(OPTNOCURSES)) {
- curses_install();
+ ui_layout_init();
}
/* Create the Maildir directory if it doesn't exist. */
OPTHCACHECOMPRESS,
#endif
OPTHEADER,
- OPTHELP,
OPTHIDDENHOST,
OPTHIDELIMITED,
OPTHIDEMISSING,
bodyoffset = statusoffset + 1;
helpoffset = LINES - 2;
bodylen = helpoffset - bodyoffset;
- if (!option (OPTHELP))
- bodylen++;
} else {
helpoffset = 0;
indexoffset = 1;
statusoffset = LINES - 2;
- if (!option (OPTHELP))
- indexoffset = 0;
bodyoffset = indexoffset + (IsHeader (extra) ? indexlen : 0);
bodylen = statusoffset - bodyoffset;
}
- if (option (OPTHELP)) {
- SETCOLOR (MT_COLOR_STATUS);
- wmove (stdscr, helpoffset, SW);
- mutt_paddstr (COLS-SW, "");
- SETCOLOR (MT_COLOR_NORMAL);
- }
+ SETCOLOR (MT_COLOR_STATUS);
+ wmove (stdscr, helpoffset, SW);
+ mutt_paddstr (COLS-SW, "");
+ SETCOLOR (MT_COLOR_NORMAL);
if (Resize != NULL) {
if ((SearchCompiled = Resize->SearchCompiled)) {
mutt_query_exit ();
continue;
}
- else if (SigWinch) {
- mutt_resize_screen ();
+
+ if (SigWinch) {
+ ui_layout_resize();
/* Store current position. */
lines = -1;
redraw = REDRAW_FULL | REDRAW_SIGWINCH;
ch = 0;
}
-
- SigWinch = 0;
- clearok (stdscr, TRUE); /*force complete redraw */
continue;
}
- else if (ch == -1) {
+
+ if (ch == -1) {
ch = 0;
continue;
}