From 4553069f9dc1883072a9e1dee130235d4a970075 Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Sun, 17 Sep 2006 08:30:17 +0000 Subject: holding left in the tree will quickly get back to root, as long as the text is in the left-most position (like before) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10965 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/list.c | 2 ++ apps/tree.c | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/gui/list.c b/apps/gui/list.c index 9415017..164bfc8 100644 --- a/apps/gui/list.c +++ b/apps/gui/list.c @@ -749,6 +749,8 @@ unsigned gui_synclist_do_button(struct gui_synclist * lists, unsigned button) gui_synclist_draw(lists); return ACTION_TREE_PGRIGHT; case ACTION_TREE_PGLEFT: + if (lists->gui_list[0].offset_position == 0) + return ACTION_STD_CANCEL; gui_synclist_scroll_left(lists); gui_synclist_draw(lists); return ACTION_TREE_PGLEFT; diff --git a/apps/tree.c b/apps/tree.c index 50ad922..1f68a85 100644 --- a/apps/tree.c +++ b/apps/tree.c @@ -549,7 +549,7 @@ static bool dirbrowse(void) int numentries=0; char buf[MAX_PATH]; int lasti = -1; - unsigned button; + unsigned button, returned_button; bool reload_root = false; int lastfilter = *tc.dirfilter; bool lastsortcase = global_settings.sort_case; @@ -619,7 +619,10 @@ static bool dirbrowse(void) } #endif button = get_action(CONTEXT_TREE,HZ/5); - need_update = gui_synclist_do_button(&tree_lists, button); + returned_button = gui_synclist_do_button(&tree_lists, button); + need_update = (bool)returned_button; + if (returned_button == ACTION_STD_CANCEL) + button = ACTION_STD_CANCEL; switch ( button ) { case ACTION_STD_OK: -- cgit v1.1