switch_to_selected_folder can be called when the
selection contains more than one item. Handle it
like it used to be handled: switch to the first
folder we find.
Fixes: #5494
The tooltips from the Grid View & List View buttons are unnecessarily long and look different from the tooltips used in Nautilus.
This commit makes the tooltips to be consistent with Nautilus and, consequently, makes them shorter.
Most of the pointer comparisons against 'browse_files_column_view'
should actually be performed against the current view widget. As
it turns out, it weren't that many places after all.
Add a grid view outside of the widgetry tree. The grid view mimics
the column view using bindings, so we only need to manage the column
view.
Also add a button in the path bar section to toggle the view. This
is handled as a new 'toggle-view' action in the file chooser.
The way switching between views currently work is by setting either
the column or grid view as the child of the GtkScrolledWindow. This
has the benefit of unmapping the unused view, which is nice and can
avoid some tricky situations with thumbnails.
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/233
gtk_widget_set_visible and gtk_window_present
are better alternatives, and calling gtk_widget_show
on newly created widgets is no longer necessary
anyway.
These are being replaced by GtkFileDialog.
This commit only moves the headers for GtkFileChooserWidget and
GtkFileChooserDialog to deprecated/, and keeps the implementations
in gtk/, since they will eventually be salvaged into a private
GtkFileChooserWindow.
These settings existed before, we keep using them.
This loses some information about sorting by multiple
columns, but it is sufficient to get the same primary
sort column back.
The "Show Time" setting does not take immediate effect (only after
changing folders) because it's set as a single call to
column_view_get_time_visible() on the FileChooserCell creation.
Instead create a bind a show-time property that gets updated
as the setting is changed.
Move the gestures to the individual cells, and
make them trigger the context menu via an action
that takes item position and coordinates.
The semantics are changed slightly: the menu actions
now operate on the clicked item, not on the selection.
Still to do: Fix up keyboard activation.
We can use the new collation property of GtkStringSorter,
and get the benefit of sort key caching. This commit
also fixes an accidental leak of all sorters, and
removes the sorter from the location column - we never
show that column when individual colummns are sortable.
This reverts commit 34752a15a71597d00a8d08befc545ac1c178b81b.
Leaving out the drag source portion as that needs a total
reimplementation. The GtkDropTarget only required minor
modifications.
Put a filter model between the selection model and
the filesystem model, and make it filter on the
filechooser::visible attribute. This makes the filer
combo in the filterchooser and the 'show hidden files'
item work. But we need to prod the filter to trigger
a refiltering every now and then.
To track changes of the selected items in a selection
model, we need to listen to both ::selection-changed
and ::items-changed.
This fixes the open button not turning sensitive
when initially loading a new folder.
When a list item is activated, we activate the default widget.
Unfortunately, due to some other bug, sometimes the open button
is not made sensitive, and then default.activate falls back
to activating the focus widget (which is the item we are just
coming from). Boom