diff options
author | Christian Soffke <christian.soffke@gmail.com> | 2023-05-26 01:47:24 +0200 |
---|---|---|
committer | Christian Soffke <christian.soffke@gmail.com> | 2023-05-26 19:13:29 +0200 |
commit | 028eafaeef87b8855a79e118e4239d6220b2b6c9 (patch) | |
tree | cca72d923c5a463ae19bbee43b0a851e747cffad /apps | |
parent | 31b8cd8f73afd22f6cde718a0bc52ed7ce5639d6 (diff) | |
download | rockbox-028eafaeef87b8855a79e118e4239d6220b2b6c9.tar.gz rockbox-028eafaeef87b8855a79e118e4239d6220b2b6c9.zip |
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
Diffstat (limited to 'apps')
-rw-r--r-- | apps/onplay.c | 12 |
1 files 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; | |||
70 | static char selected_file_path[MAX_PATH]; | 70 | static char selected_file_path[MAX_PATH]; |
71 | static int selected_file_attr = 0; | 71 | static int selected_file_attr = 0; |
72 | static int onplay_result = ONPLAY_OK; | 72 | static int onplay_result = ONPLAY_OK; |
73 | static bool in_queue_submenu = false; | ||
73 | static bool (*ctx_current_playlist_insert)(int position, bool queue, bool create_new); | 74 | static bool (*ctx_current_playlist_insert)(int position, bool queue, bool create_new); |
74 | static int (*ctx_add_to_playlist)(const char* playlist, bool new_playlist); | 75 | static int (*ctx_add_to_playlist)(const char* playlist, bool new_playlist); |
75 | extern struct menu_item_ex file_menu; /* settings_menu.c */ | 76 | extern struct menu_item_ex file_menu; /* settings_menu.c */ |
@@ -767,8 +768,6 @@ static int treeplaylist_callback(int action, | |||
767 | const struct menu_item_ex *this_item, | 768 | const struct menu_item_ex *this_item, |
768 | struct gui_synclist *this_list) | 769 | struct gui_synclist *this_list) |
769 | { | 770 | { |
770 | static bool in_queue_submenu = false; | ||
771 | |||
772 | (void)this_list; | 771 | (void)this_list; |
773 | switch (action) | 772 | switch (action) |
774 | { | 773 | { |
@@ -822,13 +821,7 @@ static int treeplaylist_callback(int action, | |||
822 | break; | 821 | break; |
823 | 822 | ||
824 | case ACTION_ENTER_MENUITEM: | 823 | case ACTION_ENTER_MENUITEM: |
825 | if (this_item == &queue_menu) | 824 | in_queue_submenu = this_item == &queue_menu; |
826 | in_queue_submenu = true; | ||
827 | break; | ||
828 | |||
829 | case ACTION_EXIT_MENUITEM: | ||
830 | if (this_item == &queue_menu) | ||
831 | in_queue_submenu = false; | ||
832 | break; | 825 | break; |
833 | } | 826 | } |
834 | 827 | ||
@@ -844,6 +837,7 @@ void onplay_show_playlist_menu(const char* path, void (*playlist_insert_cb)) | |||
844 | selected_file_attr = ATTR_DIRECTORY; | 837 | selected_file_attr = ATTR_DIRECTORY; |
845 | else | 838 | else |
846 | selected_file_attr = filetype_get_attr(path); | 839 | selected_file_attr = filetype_get_attr(path); |
840 | in_queue_submenu = false; | ||
847 | do_menu(&tree_playlist_menu, NULL, NULL, false); | 841 | do_menu(&tree_playlist_menu, NULL, NULL, false); |
848 | } | 842 | } |
849 | 843 | ||