diff options
author | Christian Soffke <christian.soffke@gmail.com> | 2022-12-31 03:47:27 +0100 |
---|---|---|
committer | Christian Soffke <christian.soffke@gmail.com> | 2022-12-30 21:57:55 -0500 |
commit | 1773e56447785931968d46002b73307c1fb3a35a (patch) | |
tree | f52231390381bb9c56c08bb0de43bc53ca839180 /apps | |
parent | 178560f495b0b4c0cf3249c07ee81e94c001c312 (diff) | |
download | rockbox-1773e56447785931968d46002b73307c1fb3a35a.tar.gz rockbox-1773e56447785931968d46002b73307c1fb3a35a.zip |
tagtree: Discard item history when selection changes in both directions
A changed selection only caused the item
history for deeper levels to be discarded
in tagtree_enter, when you were descending,
but not in tagtree_exit when you were ascending
the menu hierarchy again.
Change-Id: Ia40fa47980a05c2569e8af04e928b06130aa1f33
Diffstat (limited to 'apps')
-rw-r--r-- | apps/tagtree.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/tagtree.c b/apps/tagtree.c index 7887ee1c36..03af5fc83a 100644 --- a/apps/tagtree.c +++ b/apps/tagtree.c | |||
@@ -2035,12 +2035,16 @@ int tagtree_enter(struct tree_context* c, bool is_visible) | |||
2035 | void tagtree_exit(struct tree_context* c, bool is_visible) | 2035 | void tagtree_exit(struct tree_context* c, bool is_visible) |
2036 | { | 2036 | { |
2037 | if (is_visible) /* update selection history only for user-selected items */ | 2037 | if (is_visible) /* update selection history only for user-selected items */ |
2038 | { | ||
2039 | if (c->selected_item != selected_item_history[c->dirlevel]) | ||
2040 | max_history_level = c->dirlevel; /* discard descending item history */ | ||
2038 | selected_item_history[c->dirlevel] = c->selected_item; | 2041 | selected_item_history[c->dirlevel] = c->selected_item; |
2042 | } | ||
2039 | c->dirfull = false; | 2043 | c->dirfull = false; |
2040 | if (c->dirlevel > 0) | 2044 | if (c->dirlevel > 0) |
2041 | c->dirlevel--; | 2045 | c->dirlevel--; |
2042 | if (is_visible) | 2046 | if (is_visible) |
2043 | c->selected_item=selected_item_history[c->dirlevel]; | 2047 | c->selected_item = selected_item_history[c->dirlevel]; |
2044 | c->currtable = table_history[c->dirlevel]; | 2048 | c->currtable = table_history[c->dirlevel]; |
2045 | c->currextra = extra_history[c->dirlevel]; | 2049 | c->currextra = extra_history[c->dirlevel]; |
2046 | } | 2050 | } |