Index: apps/settings.c
===================================================================
RCS file: /cvsroot/rockbox/apps/settings.c,v
retrieving revision 1.365
diff -u -r1.365 settings.c
--- apps/settings.c	3 Mar 2006 01:12:49 -0000	1.365
+++ apps/settings.c	16 Mar 2006 17:06:14 -0000
@@ -254,6 +254,7 @@
     {1, S_O(timeformat), 0, "time format", "24hour,12hour" },
 #endif /* HAVE_LCD_BITMAP */
     {1, S_O(show_icons), true, "show icons", off_on },
+    {1, S_O(show_currdir), true, "show current dir", off_on },
     /* system */
     {4, S_O(poweroff), 10,
         "idle poweroff", "off,1,2,3,4,5,6,7,8,9,10,15,30,45,60" },
@@ -984,6 +985,7 @@
     lcd_remote_scroll_speed(global_settings.scroll_speed);
     lcd_remote_scroll_step(global_settings.scroll_step);
     lcd_remote_scroll_delay(global_settings.scroll_delay * (HZ/10));
+    lcd_remote_bidir_scroll(global_settings.bidir_limit);
 #ifdef HAVE_REMOTE_LCD_TICKING
     lcd_remote_emireduce(global_settings.remote_reduce_ticking);
 #endif
Index: apps/settings.h
===================================================================
RCS file: /cvsroot/rockbox/apps/settings.h,v
retrieving revision 1.206
diff -u -r1.206 settings.h
--- apps/settings.h	3 Mar 2006 01:12:49 -0000	1.206
+++ apps/settings.h	16 Mar 2006 17:06:15 -0000
@@ -367,6 +367,7 @@
     int max_files_in_dir; /* Max entries in directory (file browser) */
     int max_files_in_playlist; /* Max entries in playlist */
     bool show_icons;   /* 0=hide 1=show */
+    bool show_currdir; /* show the current dir at the top of the file list */
     int recursive_dir_insert; /* should directories be inserted recursively */
 
     bool   line_in;       /* false=off, true=active */
Index: apps/settings_menu.c
===================================================================
RCS file: /cvsroot/rockbox/apps/settings_menu.c,v
retrieving revision 1.238
diff -u -r1.238 settings_menu.c
--- apps/settings_menu.c	5 Mar 2006 22:58:51 -0000	1.238
+++ apps/settings_menu.c	16 Mar 2006 17:06:19 -0000
@@ -88,6 +88,14 @@
 /**
  * Menu to set icon visibility
  */
+static bool show_currdir(void)
+{
+    return set_bool( (char *)str(LANG_SHOW_CURRDIR), &global_settings.show_currdir );
+}
+
+/**
+ * Menu to set icon visibility
+ */
 static bool show_icons(void)
 {
     return set_bool( (char *)str(LANG_SHOW_ICONS), &global_settings.show_icons );
@@ -1556,6 +1564,7 @@
         { ID2P(LANG_FILTER),       dir_filter          },
         { ID2P(LANG_FOLLOW),       browse_current      },
         { ID2P(LANG_SHOW_ICONS),   show_icons          },
+        { ID2P(LANG_SHOW_CURRDIR), show_currdir        },
     };
 
     m=menu_init( items, sizeof(items) / sizeof(*items), NULL,
Index: apps/tree.c
===================================================================
RCS file: /cvsroot/rockbox/apps/tree.c,v
retrieving revision 1.387
diff -u -r1.387 tree.c
--- apps/tree.c	4 Mar 2006 22:32:25 -0000	1.387
+++ apps/tree.c	16 Mar 2006 17:06:23 -0000
@@ -351,6 +351,17 @@
     if( tc.selected_item >= tc.filesindir)
         tc.selected_item=tc.filesindir-1;
 
+    if (global_settings.show_currdir)
+    {
+        char* title = strrchr(tc.currdir, '/') + 1;
+        if (*title == '\0')
+            title = NULL;
+        gui_synclist_set_title(&tree_lists, title,
+                               (ICON)filetype_get_icon(ATTR_DIRECTORY));
+    }
+    else
+        gui_synclist_set_title(&tree_lists, NULL, NULL);
+        
     gui_synclist_select_item(&tree_lists, tc.selected_item);
     gui_synclist_draw(&tree_lists);
     gui_syncstatusbar_draw(&statusbars, true);
Index: apps/gui/list.c
===================================================================
RCS file: /cvsroot/rockbox/apps/gui/list.c,v
retrieving revision 1.19
diff -u -r1.19 list.c
--- apps/gui/list.c	9 Mar 2006 22:26:22 -0000	1.19
+++ apps/gui/list.c	16 Mar 2006 17:06:33 -0000
@@ -24,6 +24,7 @@
 #include "sprintf.h"
 #include "settings.h"
 #include "kernel.h"
+#include "debug.h"
 
 #include "screen_access.h"
 #include "list.h"
@@ -56,6 +57,9 @@
     gui_list_set_nb_items(gui_list, 0);
     gui_list->selected_item = 0;
     gui_list->start_item = 0;
+    gui_list->skip_rows = 0;
+    gui_list->title = NULL;
+    gui_list->title_icon = NULL;
     gui_list->limit_scroll = false;
     gui_list->data=data;
     gui_list->cursor_flash_state=false;
@@ -82,6 +86,7 @@
     int selected_line=gui_list->selected_item-gui_list->start_item;
 #ifdef HAVE_LCD_BITMAP
     int line_ypos=display->getymargin()+display->char_height*selected_line;
+    int nb_lines = display->nb_lines - gui_list->skip_rows;
     if (global_settings.invert_cursor)
     {
         int line_xpos=display->getleftmargin();
@@ -94,7 +99,7 @@
     else
     {
         int cursor_xpos=(global_settings.scrollbar &&
-                         display->nb_lines < gui_list->nb_items)?1:0;
+                         nb_lines < gui_list->nb_items)?1:0;
         screen_put_cursorxy(display, cursor_xpos, selected_line, gui_list->cursor_flash_state);
     }
     display->update_rect(0, line_ypos,display->width,
@@ -112,7 +117,7 @@
     gui_list->display->setfont(FONT_UI);
 #endif
     gui_textarea_update_nblines(gui_list->display);
-    int nb_lines=gui_list->display->nb_lines;
+    int nb_lines=gui_list->display->nb_lines - gui_list->skip_rows;
     if(put_from_end)
     {
         int list_end = gui_list->selected_item + SCROLL_LIMIT;
@@ -134,6 +139,37 @@
         gui_list->start_item = 0;
 }
 
+int gui_list_get_item_offset(struct gui_list * gui_list, int item_width,
+                             int text_pos)
+{
+    struct screen * display=gui_list->display;
+    int item_offset;
+    
+    if (offset_out_of_view)
+    {
+        item_offset = gui_list->offset_position;
+    }
+    else
+    {
+        /* if text is smaller then view */
+        if (item_width <= display->width - text_pos)
+        {
+            item_offset = 0;
+        }
+        else
+        {
+            /* if text got out of view  */
+            if (gui_list->offset_position > 
+                    item_width - (display->width - text_pos))
+                item_offset = item_width - (display->width - text_pos);
+            else
+                item_offset = gui_list->offset_position;
+        }
+    }
+
+    return item_offset;
+}
+
 void gui_list_draw(struct gui_list * gui_list)
 {
     struct screen * display=gui_list->display;
@@ -143,16 +179,39 @@
     bool draw_icons = (gui_list->callback_get_item_icon != NULL ) ;
     bool draw_cursor;
     int i;
+    int nb_lines = display->nb_lines - gui_list->skip_rows;
+
+    gui_textarea_clear(display);
 
     /* Adjust the position of icon, cursor, text */
 #ifdef HAVE_LCD_BITMAP
+    int item_offset, item_width, h;
     display->setfont(FONT_UI);
     gui_textarea_update_nblines(display);
     bool draw_scrollbar = (global_settings.scrollbar &&
-                           display->nb_lines < gui_list->nb_items);
+                           nb_lines < gui_list->nb_items);
     draw_cursor = !global_settings.invert_cursor;
+
+    if(gui_list->title)
+    {
+        text_pos = 0;
+        if (gui_list->title_icon && draw_icons)
+        {
+            screen_put_iconxy(display, 0, 0, gui_list->title_icon);
+            text_pos = 8;
+        }
+
+        screen_set_xmargin(display, text_pos);
+        display->getstringsize(gui_list->title, &item_width, &h);
+        item_offset = gui_list_get_item_offset(gui_list, item_width, text_pos);
+        if (item_offset > item_width - (display->width - text_pos))
+            display->puts_offset(0, 0, gui_list->title, item_offset);
+        else
+            display->puts_scroll_offset(0, 0, gui_list->title, item_offset);
+    }
+
     text_pos = 0; /* here it's in pixels */
-    if(draw_scrollbar)
+    if(draw_scrollbar || gui_list->skip_rows > 0)
     {
         cursor_pos++;
         icon_pos++;
@@ -162,7 +221,6 @@
         icon_pos--;
     else
         text_pos += CURSOR_WIDTH;
-
     if(draw_icons)
         text_pos += 8;
 #else
@@ -173,16 +231,15 @@
         text_pos = 1;
 #endif
 
-    gui_textarea_clear(display);
 #ifdef HAVE_LCD_BITMAP
     screen_set_xmargin(display, text_pos);
 #endif
 
-    for(i = 0;i < display->nb_lines;i++)
+    int current_item = gui_list->start_item;
+    for(i = gui_list->skip_rows;i < display->nb_lines;i++)
     {
         char entry_buffer[MAX_PATH];
         unsigned char *entry_name;
-        int current_item = gui_list->start_item + i;
 
         /* When there are less items to display than the
          * current available space on the screen, we stop*/
@@ -193,24 +250,9 @@
                                                       entry_buffer);
 #ifdef HAVE_LCD_BITMAP
         /* position the string at the correct offset place */
-        int item_offset;
-        int item_width,h;
         display->getstringsize(entry_name, &item_width, &h);
-
-        if (offset_out_of_view)
-            item_offset = gui_list->offset_position;
-        else
-            /* if text is smaller then view */
-            if (item_width <= display->width - text_pos)
-                item_offset = 0;
-            else
-                /* if text got out of view  */
-                if (gui_list->offset_position > 
-                        item_width - (display->width - text_pos))
-                    item_offset = item_width - (display->width - text_pos);
-                else
-                    item_offset = gui_list->offset_position;
-
+        item_offset = gui_list_get_item_offset(gui_list, item_width,
+                                                   text_pos);
 #endif
         if(current_item == gui_list->selected_item) {
             /* The selected item must be displayed scrolling */
@@ -238,7 +280,7 @@
         else
         {/* normal item */
 #ifdef HAVE_LCD_BITMAP
-            display->puts_offset(0, i, entry_name,item_offset);
+            display->puts_offset(0, i, entry_name, item_offset);
 #else
             display->puts(text_pos, i, entry_name);
 #endif
@@ -253,18 +295,20 @@
             if(icon)
                 screen_put_iconxy(display, icon_pos, i, icon);
         }
+
+        current_item++;
     }
 #ifdef HAVE_LCD_BITMAP
     /* Draw the scrollbar if needed*/
     if(draw_scrollbar)
     {
-        int y_start = gui_textarea_get_ystart(display);
-        int scrollbar_y_end = display->char_height *
-                              display->nb_lines + y_start;
+        int y_start = gui_textarea_get_ystart(display) +
+                      display->char_height * gui_list->skip_rows;
+        int scrollbar_y_end = display->char_height*nb_lines + y_start;
         gui_scrollbar_draw(display, 0, y_start, SCROLLBAR_WIDTH-1,
                            scrollbar_y_end - y_start, gui_list->nb_items,
                            gui_list->start_item,
-                           gui_list->start_item + display->nb_lines, VERTICAL);
+                           gui_list->start_item + nb_lines, VERTICAL);
     }
 #endif
     gui_textarea_update(display);
@@ -294,7 +338,7 @@
     }
     else
     {
-        int nb_lines = gui_list->display->nb_lines;
+        int nb_lines = gui_list->display->nb_lines - gui_list->skip_rows;
         gui_list->selected_item++;
         item_pos = gui_list->selected_item - gui_list->start_item;
         end_item = gui_list->start_item + nb_lines;
@@ -324,7 +368,7 @@
 {
     if( gui_list->selected_item == 0 )
     {
-        int nb_lines = gui_list->display->nb_lines;
+        int nb_lines = gui_list->display->nb_lines - gui_list->skip_rows;
         if(gui_list->limit_scroll)
             return;
         gui_list->selected_item--;
@@ -340,7 +384,7 @@
     else
     {
         int item_pos;
-        int nb_lines = gui_list->display->nb_lines;
+        int nb_lines = gui_list->display->nb_lines - gui_list->skip_rows;
         gui_list->selected_item--;
         item_pos = gui_list->selected_item - gui_list->start_item;
         if (global_settings.scroll_paginated)
@@ -365,6 +409,8 @@
 
 void gui_list_select_next_page(struct gui_list * gui_list, int nb_lines)
 {
+    nb_lines -= gui_list->skip_rows;
+
     if(gui_list->selected_item == gui_list->nb_items-1)
     {
         if(gui_list->limit_scroll)
@@ -382,6 +428,8 @@
 
 void gui_list_select_previous_page(struct gui_list * gui_list, int nb_lines)
 {
+    nb_lines -= gui_list->skip_rows;
+
     if(gui_list->selected_item == 0)
     {
         if(gui_list->limit_scroll)
@@ -410,7 +458,7 @@
     if(gui_list->nb_items > 0)
     {
         gui_textarea_update_nblines(gui_list->display);
-        int nb_lines = gui_list->display->nb_lines;
+        int nb_lines = gui_list->display->nb_lines - gui_list->skip_rows;
 
         int dist_selected_from_end = gui_list->nb_items
             - gui_list->selected_item - 1;
@@ -461,6 +509,22 @@
 }
 #endif /* HAVE_LCD_BITMAP */
 
+void gui_list_set_title(struct gui_list * gui_list, char * title, ICON icon)
+{
+    if (title == NULL)
+    {
+        gui_list->skip_rows = 0;
+        gui_list->title = NULL;
+        gui_list->title_icon = NULL;
+    }
+    else
+    {
+        gui_list->skip_rows = 1;
+        gui_list->title = title;
+        gui_list->title_icon = icon;
+    }
+}
+
 /*
  * Synchronized lists stuffs
  */
@@ -691,3 +755,10 @@
     }
     return 0;
 }
+
+void gui_synclist_set_title(struct gui_synclist * lists, char * title, ICON icon)
+{
+    int i;
+    FOR_NB_SCREENS(i)
+        gui_list_set_title(&(lists->gui_list[i]), title, icon);
+}
Index: apps/gui/list.h
===================================================================
RCS file: /cvsroot/rockbox/apps/gui/list.h,v
retrieving revision 1.17
diff -u -r1.17 list.h
--- apps/gui/list.h	24 Feb 2006 15:42:50 -0000	1.17
+++ apps/gui/list.h	16 Mar 2006 17:06:34 -0000
@@ -140,6 +140,9 @@
     int selected_item;
     bool cursor_flash_state;
     int start_item; /* the item that is displayed at the top of the screen */
+    int skip_rows; /* number of rows to skip from top */
+    char* title;
+    ICON title_icon;
 
 #ifdef HAVE_LCD_BITMAP
     int offset_position; /* the list's screen scroll placement in pixels */
@@ -372,4 +375,6 @@
  */
 extern unsigned gui_synclist_do_button(struct gui_synclist * lists, unsigned button);
 
+extern void gui_synclist_set_title(struct gui_synclist * lists, char * title, ICON icon);
+
 #endif /* _GUI_LIST_H_ */
Index: apps/lang/english.lang
===================================================================
RCS file: /cvsroot/rockbox/apps/lang/english.lang,v
retrieving revision 1.226
diff -u -r1.226 english.lang
--- apps/lang/english.lang	4 Mar 2006 23:53:09 -0000	1.226
+++ apps/lang/english.lang	16 Mar 2006 17:06:43 -0000
@@ -3796,3 +3796,9 @@
 eng: "Searching... %d found (%s)"
 voice: ""
 new:
+
+id: LANG_SHOW_CURRDIR
+desc: in fileview_settings_menu
+eng: "Show Current Dir"
+voice: ""
+new:
Index: firmware/drivers/lcd-h100-remote.c
===================================================================
RCS file: /cvsroot/rockbox/firmware/drivers/lcd-h100-remote.c,v
retrieving revision 1.45
diff -u -r1.45 lcd-h100-remote.c
--- firmware/drivers/lcd-h100-remote.c	11 Mar 2006 09:28:49 -0000	1.45
+++ firmware/drivers/lcd-h100-remote.c	16 Mar 2006 17:06:57 -0000
@@ -1287,7 +1287,7 @@
 
         s->len = utf8length((char *)string);
         s->offset = offset;
-        s->startx = x;
+        s->startx = leftmargin + x * s->width / s->len;
         s->backward = false;
         scrolling_lines |= (1<<y);
     }
@@ -1334,7 +1334,7 @@
                 s->offset += scroll_step;
 
             pf = font_get(curfont);
-            xpos = leftmargin + s->startx * s->width / s->len;
+            xpos = s->startx;
             ypos = ymargin + index * pf->height;
 
             if (s->bidir) { /* scroll bidirectional */
Index: firmware/drivers/lcd-h100.c
===================================================================
RCS file: /cvsroot/rockbox/firmware/drivers/lcd-h100.c,v
retrieving revision 1.45
diff -u -r1.45 lcd-h100.c
--- firmware/drivers/lcd-h100.c	11 Mar 2006 09:28:49 -0000	1.45
+++ firmware/drivers/lcd-h100.c	16 Mar 2006 17:06:59 -0000
@@ -1208,7 +1208,7 @@
 
         s->len = utf8length((char *)string);
         s->offset = offset;
-        s->startx = x;
+        s->startx = leftmargin + x * s->width / s->len;
         s->backward = false;
         scrolling_lines |= (1<<y);
     }
@@ -1246,7 +1246,7 @@
                 s->offset += scroll_step;
 
             pf = font_get(curfont);
-            xpos = s->left_margin + s->startx * s->width / s->len;
+            xpos = s->startx;
             ypos = ymargin + index * pf->height;
 
             if (s->bidir) { /* scroll bidirectional */
