From: Richard Russon Date: Thu, 14 Jul 2016 01:45:30 +0000 (+0100) Subject: feature: sidebar X-Git-Tag: neomutt-20160822~27^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f5d286704797cabbfcef3635694393ae8bc7c74d;p=neomutt feature: sidebar --- diff --git a/configure.ac b/configure.ac index 75517f6f2..c032c08c3 100644 --- a/configure.ac +++ b/configure.ac @@ -175,12 +175,11 @@ if test x$have_smime != xno ; then SMIMEAUX_TARGET="smime_keys" fi -AC_ARG_ENABLE(sidebar, AC_HELP_STRING([--enable-sidebar], [Enable Sidebar support]), -[ if test x$enableval = xyes ; then - AC_DEFINE(USE_SIDEBAR, 1, [Define if you want support for the sidebar.]) - OPS="$OPS \$(srcdir)/OPS.SIDEBAR" - MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS sidebar.o" - fi +AC_ARG_ENABLE(sidebar, AC_HELP_STRING([--enable-sidebar], [Enable Sidebar support]), enable_sidebar=$enableval, enable_sidebar=no) +AS_IF([test x$enable_sidebar = "xyes"], [ + AC_DEFINE(USE_SIDEBAR, 1, [Define if you want support for the sidebar.]) + OPS="$OPS \$(srcdir)/OPS.SIDEBAR" + MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS sidebar.o" ]) AC_ARG_WITH(mixmaster, AS_HELP_STRING([--with-mixmaster@<:@=PATH@:>@],[Include Mixmaster support]), diff --git a/globals.h b/globals.h index 95a6869ba..b9e8f5c06 100644 --- a/globals.h +++ b/globals.h @@ -222,7 +222,7 @@ WHERE short ScoreThresholdRead; WHERE short ScoreThresholdFlag; #ifdef USE_SIDEBAR -WHERE short SidebarWidth; +WHERE short SidebarWidth INITVAL(0); WHERE LIST *SidebarWhitelist INITVAL(0); WHERE int SidebarNeedsRedraw INITVAL (0); #endif diff --git a/mx.c b/mx.c index fbe82e4ca..b1f006aed 100644 --- a/mx.c +++ b/mx.c @@ -328,7 +328,7 @@ static void mx_unlink_empty (const char *path) /* try to figure out what type of mailbox ``path'' is * * return values: - * M_* mailbox type + * MUTT_* mailbox type * 0 not a mailbox * -1 error */ diff --git a/sidebar.c b/sidebar.c index 5b7edafdf..f5977402e 100644 --- a/sidebar.c +++ b/sidebar.c @@ -202,7 +202,7 @@ static const char *cb_format_str(char *dest, size_t destlen, size_t col, int col * @buflen: Buffer length * @width: Desired width in screen cells * @box: Mailbox name - * @b: Mailbox object + * @sbe: Mailbox object * * Take all the relevant mailbox data and the desired screen width and then get * mutt_FormatString to do the actual work. mutt_FormatString will callback to @@ -490,7 +490,7 @@ static int draw_divider (int num_rows, int num_cols) int i; for (i = 0; i < num_rows; i++) { - mutt_window_move (MuttSidebarWindow, i, SidebarWidth - delim_len); //RAR 0 for rhs + mutt_window_move (MuttSidebarWindow, i, SidebarWidth - delim_len); addstr (NONULL(SidebarDividerChar)); } @@ -513,7 +513,7 @@ static void fill_empty_space (int first_row, int num_rows, int width) int r; for (r = 0; r < num_rows; r++) { - mutt_window_move (MuttSidebarWindow, first_row + r, 0); //RAR rhs + mutt_window_move (MuttSidebarWindow, first_row + r, 0); int i; for (i = 0; i < width; i++) addch (' '); @@ -667,6 +667,14 @@ void mutt_sb_draw (void) if (!option (OPTSIDEBAR)) return; +#ifdef USE_SLANG_CURSES + int x = SLsmg_get_column(); + int y = SLsmg_get_row(); +#else + int x = getcurx (stdscr); + int y = getcury (stdscr); +#endif + int num_rows = MuttSidebarWindow->rows; int num_cols = MuttSidebarWindow->cols; @@ -684,6 +692,7 @@ void mutt_sb_draw (void) return; draw_sidebar (num_rows, num_cols, div_width); + move (y, x); } /**