From 028eafaeef87b8855a79e118e4239d6220b2b6c9 Mon Sep 17 00:00:00 2001 From: Christian Soffke Date: Fri, 26 May 2023 01:47:24 +0200 Subject: Onplay: Fix items from Queue submenu appearing at top level If "Show Queue Options" was set to "in Submenu", the queue options would incorrectly appear at the top level after you had queued a track, at least until you entered and exited the submenu again without selecting an option. Change-Id: I59abd73de7e3634bc8701aa2288b56bde7552513 --- apps/onplay.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/apps/onplay.c b/apps/onplay.c index 05046f6e00..3e52aab003 100644 --- a/apps/onplay.c +++ b/apps/onplay.c @@ -70,6 +70,7 @@ static const char *selected_file = NULL; static char selected_file_path[MAX_PATH]; static int selected_file_attr = 0; static int onplay_result = ONPLAY_OK; +static bool in_queue_submenu = false; static bool (*ctx_current_playlist_insert)(int position, bool queue, bool create_new); static int (*ctx_add_to_playlist)(const char* playlist, bool new_playlist); extern struct menu_item_ex file_menu; /* settings_menu.c */ @@ -767,8 +768,6 @@ static int treeplaylist_callback(int action, const struct menu_item_ex *this_item, struct gui_synclist *this_list) { - static bool in_queue_submenu = false; - (void)this_list; switch (action) { @@ -822,13 +821,7 @@ static int treeplaylist_callback(int action, break; case ACTION_ENTER_MENUITEM: - if (this_item == &queue_menu) - in_queue_submenu = true; - break; - - case ACTION_EXIT_MENUITEM: - if (this_item == &queue_menu) - in_queue_submenu = false; + in_queue_submenu = this_item == &queue_menu; break; } @@ -844,6 +837,7 @@ void onplay_show_playlist_menu(const char* path, void (*playlist_insert_cb)) selected_file_attr = ATTR_DIRECTORY; else selected_file_attr = filetype_get_attr(path); + in_queue_submenu = false; do_menu(&tree_playlist_menu, NULL, NULL, false); } -- cgit v1.2.3