[vlc-commits] [Git][videolan/vlc][master] ncurses: restore previous box type on toggle
Hugo Beauzée-Luyssen (@chouquette)
gitlab at videolan.org
Sat Nov 20 09:39:22 UTC 2021
Hugo Beauzée-Luyssen pushed to branch master at VideoLAN / VLC
Commits:
1b500f00 by Alexandre Janniaux at 2021-11-20T09:21:14+00:00
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.
- - - - -
1 changed file:
- modules/gui/ncurses.c
Changes:
=====================================
modules/gui/ncurses.c
=====================================
@@ -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");
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/1b500f0053fd267f8ea6a258b5d8c52e2640d970
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/1b500f0053fd267f8ea6a258b5d8c52e2640d970
You're receiving this email because of your account on code.videolan.org.
More information about the vlc-commits
mailing list