** \fC<sidebar-prev-new>\fP command is similarly affected, wrapping around to
** the end of the list.
*/
+ { "sidebar_on_right", DT_BOOL, R_BOTH|R_REFLOW, UL OPTSIDEBARONRIGHT, 0 },
+ /*
+ ** .pp
+ ** When set, the sidebar will appear on the right-hand side of the screen.
+ */
{ "sidebar_short_path", DT_BOOL, R_SIDEBAR, OPTSIDEBARSHORTPATH, 0 },
/*
** .pp
SETCOLOR(MT_COLOR_DIVIDER);
+ int col;
+ if (option (OPTSIDEBARONRIGHT)) {
+ col = 0;
+ } else {
+ col = SidebarWidth - delim_len;
+ }
+
int i;
for (i = 0; i < num_rows; i++)
{
- mutt_window_move (MuttSidebarWindow, i, SidebarWidth - delim_len);
+ mutt_window_move (MuttSidebarWindow, i, col);
addstr (NONULL(SidebarDividerChar));
}
* fill_empty_space - Wipe the remaining Sidebar space
* @first_row: Window line to start (0-based)
* @num_rows: Number of rows to fill
- * @width: Width of the Sidebar (minus the divider)
+ * @div_width: Width in screen characters taken by the divider
+ * @num_cols: Number of columns to fill
*
* Write spaces over the area the sidebar isn't using.
*/
-static void fill_empty_space (int first_row, int num_rows, int width)
+static void fill_empty_space (int first_row, int num_rows, int div_width, int num_cols)
{
/* Fill the remaining rows with blank space */
SETCOLOR(MT_COLOR_NORMAL);
+ if (!option (OPTSIDEBARONRIGHT))
+ div_width = 0;
+
int r;
for (r = 0; r < num_rows; r++)
{
- mutt_window_move (MuttSidebarWindow, first_row + r, 0);
+ mutt_window_move (MuttSidebarWindow, first_row + r, div_width);
+
int i;
- for (i = 0; i < width; i++)
+ for (i = 0; i < num_cols; i++)
addch (' ');
}
}
else
SETCOLOR(MT_COLOR_NORMAL);
- mutt_window_move (MuttSidebarWindow, row, 0);
+ int col = 0;
+ if (option (OPTSIDEBARONRIGHT)) {
+ col = div_width;
+ }
+
+ mutt_window_move (MuttSidebarWindow, row, col);
if (Context && Context->realpath &&
!mutt_strcmp (b->realpath, Context->realpath))
{
row++;
}
- fill_empty_space (row, num_rows - row, w);
+ fill_empty_space (row, num_rows - row, div_width, w);
}
if (!Incoming)
{
- fill_empty_space (0, num_rows, SidebarWidth - div_width);
+ fill_empty_space (0, num_rows, div_width, num_cols - div_width);
return;
}