summaryrefslogtreecommitdiffstats
path: root/menu.c
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2016-06-04 11:32:03 -0700
committerKevin McCarthy <kevin@8t8.us>2016-06-04 11:32:03 -0700
commit086a5b8092544d68933d851af83c14c8dcbd834d (patch)
treeb364c239b68decdf274b0c4560f084ba1989aeca /menu.c
parent389c74bb20b20ab31c14460962fbbb6bba82127d (diff)
Sidebar clean up: building and drawing logic.
Fix the autoconf/makefile.am changes to be consistent. Create a global SidebarNeedsRedraw to indicate a redraw is needed, instead of putting sb_draw() everywhere in the code. Create a menu_redraw_sidebar() function and use the REDRAW_SIDEBAR flag instead of piggy-backing it inside the index loop. Fix curs_main.c and pager.c to be a bit cleaner by using the global and REDRAW_SIDEBAR. Start to clean up some of the buffy code, but this needs to refactored and fixed.
Diffstat (limited to 'menu.c')
-rw-r--r--menu.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/menu.c b/menu.c
index a8be371d..86bbed43 100644
--- a/menu.c
+++ b/menu.c
@@ -217,6 +217,9 @@ void menu_redraw_full (MUTTMENU *menu)
mutt_show_error ();
menu->redraw = REDRAW_INDEX | REDRAW_STATUS;
+#ifdef USE_SIDEBAR
+ menu->redraw |= REDRAW_SIDEBAR;
+#endif
}
void menu_redraw_status (MUTTMENU *menu)
@@ -231,6 +234,14 @@ void menu_redraw_status (MUTTMENU *menu)
menu->redraw &= ~REDRAW_STATUS;
}
+#ifdef USE_SIDEBAR
+void menu_redraw_sidebar (MUTTMENU *menu)
+{
+ SidebarNeedsRedraw = 0;
+ sb_draw ();
+}
+#endif
+
void menu_redraw_index (MUTTMENU *menu)
{
char buf[LONG_STRING];
@@ -238,9 +249,6 @@ void menu_redraw_index (MUTTMENU *menu)
int do_color;
int attr;
-#ifdef USE_SIDEBAR
- sb_draw();
-#endif
for (i = menu->top; i < menu->top + menu->pagelen; i++)
{
if (i < menu->max)
@@ -843,6 +851,10 @@ int menu_redraw (MUTTMENU *menu)
if (menu->redraw & REDRAW_STATUS)
menu_redraw_status (menu);
+#ifdef USE_SIDEBAR
+ if (menu->redraw & REDRAW_SIDEBAR || SidebarNeedsRedraw)
+ menu_redraw_sidebar (menu);
+#endif
if (menu->redraw & REDRAW_INDEX)
menu_redraw_index (menu);
else if (menu->redraw & (REDRAW_MOTION | REDRAW_MOTION_RESYNCH))