Skip to content
Snippets Groups Projects
Commit 1b500f00 authored by Alexandre Janniaux's avatar Alexandre Janniaux Committed by Hugo Beauzée-Luyssen
Browse files

ncurses: restore previous box type on toggle

After pressing `i` to open the info box, pressing `i` again will lead to
the none box, which will display nothing. Instead, store the previous
box when switching to a different box, and restore it instead of
switching to none.
parent cafec9d0
No related branches found
No related tags found
1 merge request!921ncurses: restore previous box type on toggle
Pipeline #160716 passed with stage
in 14 minutes and 3 seconds
......@@ -187,6 +187,7 @@ struct intf_sys_t
short yellow_b;
int box_type;
int previous_box_type;
int box_y; // start of box content
int box_height;
int box_lines_total; // number of lines in the box
......@@ -1166,7 +1167,9 @@ static void AddItem(intf_thread_t *intf, const char *path)
static inline void BoxSwitch(intf_sys_t *sys, int box)
{
sys->box_type = (sys->box_type == box) ? BOX_NONE : box;
int previous_box_type = sys->box_type;
sys->box_type = (sys->box_type == box) ? sys->previous_box_type : box;
sys->previous_box_type = previous_box_type;
sys->box_start = 0;
sys->box_idx = 0;
}
......@@ -1678,6 +1681,7 @@ static int Open(vlc_object_t *p_this)
vlc_LogSet(vlc_object_instance(intf), &log_ops, sys);
sys->box_type = BOX_PLAYLIST;
sys->previous_box_type = BOX_PLAYLIST;
sys->plidx_follow = true;
sys->color = var_CreateGetBool(intf, "color");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment