weblaf icon indicating copy to clipboard operation
weblaf copied to clipboard

FileChooser - give it a more "native" feel

Open Sciss opened this issue 10 years ago • 3 comments

Hi,

The default list of locations on the left hand side of the file chooser is basically all in / (root). On Linux this makes not much sense, as its crowded with entries you will never visit nor have permissions for.

My suggestion is to add a small API for populating the default locations, and then add some implementations for common platforms (e.g. OS X, Windows, Gnome) I have attached a screenshot that show the default appearance of the file chooser in Gnome 3. Basically what it does is present you with:

  • Search facility
  • Recently used items
  • user home directory
  • user desktop
  • file system root (clicking here will give you the list currently shown in WebLaF)
  • other harddisks
  • favourites

The favourites simply a list of URLs stored in the text file ~/.config/gtk-3.0/bookmarks.

I think this organisation would be vastly improving usability even if one cuts out the first two items (search and recently used) for simplicity. Nautilius, Gnome's file browser adds two or three more "end-user friendly" entries as well, like ~/Pictures, ~/Music, ~/Movies but they are not necessary, besides one can always add them to the favourites.

In a first step, the API would be "read-only", in an advanced step it might be possible to add and delete favourites (if it's easy enough to make this work correctly on the particular platform).

I'm sure there are easy ways to determine the native locations on OS X and Windows, too.

Thoughts?

screenshot from 2015-06-30 23 00 53

Sciss avatar Jun 30 '15 21:06 Sciss

In general it might be a good thing to have similar to native chooser for each system, but it will be really hard to configure, style and maintain in that case, since each one will have different set of features.

I see roots displayed in the tree as a main problem here - I will certainly be adding more ways to customize file chooser the way you want it to function, including possibility to configure toolbar, tree roots, display options and some other parts.

mgarin avatar Jul 01 '15 11:07 mgarin

FYI, I'm using this extension to display the gnome favourites: https://github.com/Sciss/Submin/blob/main/src/main/java/de/sciss/submin/SubminFileChooserPanel.java#L51 - which works quite ok.

Sciss avatar Oct 18 '21 11:10 Sciss

With the rework in #677 I should probably adjust the positioning for all the custom/OS-related navigation options in the chooser because currently my main concern is that if there will be too many of them offered under a specific OS - there simply won't be enough space on the toolbar where they are currently placed.

Alternatively - if layout of the chooser will depend on OS in the first place - it can differ between the different layouts to accommodate the amount of options. I have some nice ideas of how file chooser layout and style can be easily manipulated to make it look "native" or use "weblaf" version instead. It can definitely be optional.

There are some caveats with Mac OS X though, but that's something I'll also have to look into.

mgarin avatar Oct 18 '21 14:10 mgarin