TROMjaro Forum

Feature Request: icon view for filechooser

Good day,
First at all, say congratulation for what TROMjaro has become beauty wonderful desktop, great job ! Will be nice to implement icon view for filechooser as official development of TROMjaro, since it is part of unofficial channel developed by dudemanguy

kind regards

Thank you for the kind words! You are right the filechooser is terrible without proper big thumbnails, but this is already implemented in GTK4 A grid for the file chooser – GTK Development Blog - I have asked the XFCE developers how is XFCE handling this. I will update this post.

1 Like

Thanks for your answer, some time ago it was working on XFCE by flatpak, however I could not do it again :frowning:

It is likely that the flatpak you were using was using its own file chooser. Could be…anyway, this is already implemented so it is a matter of “when it will land in XFCE”. Will keep you posted.

1 Like

Ok unfortunately XFCE uses GTK3 and they do not plan to move to GTK4 anytime soon. See File Chooser with bigger thumbnails / Desktop / Xfce Forums - But I am reluctant to use the GTK3 fork you showed me for an official TROMjaro ISO since it is not maintained in more than a year. We have to think long term.

If anyone has other suggestions let us know…

1 Like

It looks like we should at least be able to get an image preview window in GTK3 if we can enable the widget for this:
https://docs.gtk.org/gtk3/method.FileChooser.set_preview_widget_active.html
https://docs.gtk.org/gtk3/method.FileChooser.get_preview_widget_active.html

A full solution would be to use Thunar for the file selection functionality which is under discussion here:
https://gitlab.xfce.org/xfce/thunar/-/issues/547
https://gitlab.freedesktop.org/xdg/xdg-specs/-/issues/64

@yoyito
In the meantime, one workaround you could try out is to do the following:

  1. Select the file you want in either Thunar (Ctrl+1 for icon view) or GThumb and copy it with Ctrl-C or from the right click context menu.
  2. In the application you wish to open it in press: Ctrl-O,L,V and then Enter (i.e. Ctrl-L and Ctrl-V to paste the path into the file chooser)

Note that some applications remember the Ctrl-L setting for entering the location such that you can skip this step on subsequent opens, and also some allow you to paste in directly with Ctrl-V without ever having to do Ctrl-L at all.

GThumb does not show filenames by default, but you can enable these by going to Preferences → Browser and from the Caption checkbox list here you can enable the display of name, size and other file attributes. Then in the Behavior section below this you can also change it from single to double click to open files. This then allows you to single click on the file you want and press Ctrl-C, rather than having to use the context menu or select it with the arrow keys.

[As an aside: Two other changes which I make here which I think are a big improvement to GThumb are to also tick the checkbox in the Browser → Behavior section to ‘Open files in fullscreen mode’. And then in the Shortcuts options change the ‘Show next file’ and ‘Show previous file’ to using the Right and Left arrow keys respectively, instead of PageDown and PageUp.]

It is far from ideal, but it should only add a couple of extra seconds each time to Alt-Tab between the two programs and enter the shortcut keys. Still, if we can get the preview widget working I think that would be the better short term solution.

Looking into it more, I don’t think the preview widget is something a user can activate themselves. But if anyone with programming experience would like to investigate further, the following additional resources might help:
https://stackoverflow.com/questions/39522192/gtkfilechooserdialog-with-image-preview
https://docs.gtk.org/gtk3/iface.FileChooser.html
https://lazka.github.io/pgi-docs/Gtk-3.0/interfaces/FileChooser.html
https://valadoc.org/gtk±3.0/Gtk.FileChooser.html
https://www.gnu.org/software/guile-gnome/docs/gtk/html/GtkFileChooser.html
https://api.gtkd.org/gtk.FileChooserWidget.FileChooserWidget.html

However, I did discover some other useful FileChooser tweaks and keyboard shortcuts along the way…

Open a terminal and run the following commands for each desired setting:

Sort directories first
gsettings set org.gtk.Settings.FileChooser sort-directories-first true

Set the window size
gsettings set org.gtk.Settings.FileChooser window-size '(900,450)'

Set the column to sort by
gsettings set org.gtk.Settings.FileChooser sort-column name|size|type|modified

Set the sort order
gsettings set org.gtk.Settings.FileChooser sort-order ascending|descending

All of the above as well as other FileChooser settings can alternatively be set using dconf-editor as described here.
I.e. install and open dconf-editor, and then navigate to:
org → gtk → settings → file-chooser

For some apps that use the Gtk2 FileChooser (which doesn’t respect display scaling, e.g. KolourPaint), you need to instead change the settings here:
~/.config/gtk-2.0/gtkfilechooser.ini

And if any of your settings are getting reverted, you could try locking them with the following guide:
https://forum.xfce.org/viewtopic.php?pid=55276#p55276

Keyboard shortcuts (worked out from here)

Enter location:
Ctrl + L

Jump to the Home folder:
Alt + Home

Jump to Desktop:
Alt + D

Jump to recently used files:
Alt + R

Jump to bookmark number 1, 2, 3,…,0:
Alt + 1, 2,…etc.

Up/Down a folder level:
Alt + Up/Down arrow key

Show hidden files (same as in Thunar etc.):
Ctrl + H

Search:
Alt + S

1 Like