|Re: [hatari-devel] Retaining fileselector position between fileselector openings|
[ Thread Index |
| More lists.tuxfamily.org/hatari-devel Archives
Le 21/09/2012 20:53, Eero Tamminen a écrit :
Nicolas, I noticed you commited support for retaining
scroll position in the SDL GUI file selector when
re-opening the file selector.
Is the position reseted when a different directory is
If you change directory (".." for example), position is reset. But if
you use the memory snapshot file selector after the floppy disk's one,
it will keep the previous position. You can press "home" to go to 1st
line in that case, I think it's better to keep a position and maybe not
use it, than never keeping it and having to scroll down to go where you
were last time.
For example, all of these:
- TOS image
- Cartridge image
- Memory state save snapshot
- A & B floppy images
- GEMDOS drive dir
- ACSI, IDE master & slave images
- Keyboard mapping file
- Printer output file
- Serial and MIDI output & input files
- Sound recording file
- Hatari configuration file
Can in theory be in different directories.
I think from the user point of view it would be better
if file selector position would be retained (and passed
to file selector) separately for each of above things.
That could be done e.g. by adding an additional argument
("int *position") for both of the file selector functions,
which is static in the caller and updated only by
This shows what places would need changing:
grep SDLGui_File $(find src -name '*.c')
For now, the saved position is indeed common to all file selector calls.
Apart from loading disk images, I rarely browse other dirs and I think
those other dirs are less prone to contains hundreds of files (as it can
be the case for games / demos disks), so it's less a problem because in
most cases there will be no draggable scroll bar.
I agree it could be added one level above each time SDLGui_FileSelect()
is called ; maybe I will have time to give it a look later, but for now
if someone feels like doing it, don't hesitate.