Commit Graph

56 Commits

Author SHA1 Message Date
Přemysl Eric Janouch 701846ab39
Support opening collections of files
Implement a process-local VFS to enable grouping together arbitrary
URIs passed via program arguments, DnD, or the file open dialog.

This VFS contains FivCollectionFile objects, which act as "simple"
proxies over arbitrary GFiles.  Their true URIs may be retrieved
through the "standard::target-uri" attribute, in a similar way to
GVfs's "recent" and "trash" backends.

(The main reason we proxy rather than just hackishly return foreign
GFiles from the VFS is that loading them would switch the current
directory, and break iteration as a result.

We could also keep the collection outside of GVfs, but that would
result in considerable special-casing, and the author wouldn't gain
intimate knowledge of GIO.)

There is no perceived need to keep old collections when opening
new ones, so we simply change and reload the contents when needed.

Similarly, there is no intention to make the VFS writeable.

The process-locality of this and other URI schemes has proven to be
rather annoying when passing files to other applications,
however most of the resulting complexity appears to be essential
rather than accidental.

Note that the GTK+ file chooser widget is retarded, and doesn't
recognize URIs that lack the authority part in the location bar.
2022-08-08 18:06:50 +02:00
Přemysl Eric Janouch 33fb047a73
Make Alt+Return work in the browser as well 2022-08-06 07:49:01 +02:00
Přemysl Eric Janouch 5bae7c1bd2
Use gdk_event_triggers_context_menu() 2022-08-03 21:37:45 +02:00
Přemysl Eric Janouch ab70b30053
Centre ultra-wide items vertically
Overall, this looks better, even though we lose a baseline of sorts.
2022-07-31 04:35:04 +02:00
Přemysl Eric Janouch eca319e5e4
Extend a comment 2022-07-24 22:46:03 +02:00
Přemysl Eric Janouch 4b4e24e71a
Work around broken Cairo Quartz backend on macOS
Pre-render the padded pattern, costing us 2 megabytes of memory there.
2022-07-23 20:47:57 +02:00
Přemysl Eric Janouch d3b34cd482
Only offer horizontal browser scrolling if useful
Motivated by small screens.
2022-07-21 16:04:51 +02:00
Přemysl Eric Janouch b067c1948b
Use GDK event handling return value constants 2022-07-21 16:03:36 +02:00
Přemysl Eric Janouch 390e21a72d
Fix touch screen drag scrolling in the browser 2022-07-21 15:33:42 +02:00
Přemysl Eric Janouch 876fda4f55
Handle the long press gesture on browser items
Unfortunately, this doesn't work on X11, though Wayland seems fine.
2022-07-21 12:28:01 +02:00
Přemysl Eric Janouch 62b1e83541
Support horizontal scrolling in the browser
An unlikely situation.
2022-07-17 13:47:56 +02:00
Přemysl Eric Janouch 23429d9631
Implement GtkScrollable in FivView
This fixes rendering and positioning behaviour when dragging on X11,
where we aim to use a native GdkWindow.
2022-07-17 05:27:06 +02:00
Přemysl Eric Janouch 1fee920902
Make the browser scroll with touchpad on Wayland
And generally clear up scroll handling.
2022-07-15 07:35:33 +02:00
Přemysl Eric Janouch a1b2225750
Move the browser's popup menu to its own file 2022-07-04 20:44:47 +02:00
Přemysl Eric Janouch a8f7532abd
Employ embedded thumbnail extraction
And store all direct thumbnailer output in the browser's cache--
low-quality thumbnails will always be regenerated, as is desired,
and we'll reload faster on devices where we don't store thumbnails.

This change improves latency at the cost of overall efficiency,
seeing as images with thumbnails will be spent cycles on twice.

Keeping this out-of-process avoids undesired lock-ups.
Moreover, embedded thumbnails can be fairly expensive to decode.
2022-06-08 02:51:54 +02:00
Přemysl Eric Janouch 8dfbd0dee2
Add a command line option to extract thumbnails
Only use LibRaw for now, which probably has the most impact
using the least amount of effort.
2022-06-08 02:51:54 +02:00
Přemysl Eric Janouch 4ca8825e02
Clean up
Use gchar when memory is allocated through GLib.
2022-06-05 13:30:53 +02:00
Přemysl Eric Janouch 8bba456b14
Cache thumbnails across reloads
This will speed up sort changes, as well as simple reloads,
at the cost of an extra hash map from URIs to Cairo surface references.

It seems unnecessary to provide an explicit option to flush this cache,
as it may be cleared by changing either the directory or the current
thumbnail size.
2022-06-04 16:37:25 +02:00
Přemysl Eric Janouch bb97445a96
Attach mtime to the browser's rescaled thumbnails 2022-06-04 16:37:25 +02:00
Přemysl Eric Janouch e2adac72cc
Use the model's mtime for validating thumbnails
Saves a syscall, generalizes fiv_thumbnail_lookup(),
wastes a tiny bit of memory per entry.
2022-06-04 16:37:25 +02:00
Přemysl Eric Janouch 3ddb0cf205
Expose the mtime of the model's entries 2022-06-04 14:50:56 +02:00
Přemysl Eric Janouch da507edd05
Prevent thumbnailing from disrupting mouse clicks 2022-02-24 21:52:25 +01:00
Přemysl Eric Janouch 580b68789b
Turn the browser into a DnD source
The destination does all the work of handling file operations.

Also, add some missing logic for horizontal scrolling.
2022-02-22 15:44:38 +01:00
Přemysl Eric Janouch 31f9feab7b
Use the X-GNOME-FullName desktop file key 2022-02-21 22:29:14 +01:00
Přemysl Eric Janouch 41bd25e711
Avoid g_app_info_should_show() in context menus
We were hiding our own JPEG cropper.
2022-02-21 21:49:44 +01:00
Přemysl Eric Janouch 68bb695054
Clean up 2022-02-20 21:29:34 +01:00
Přemysl Eric Janouch 04ec292caf
Make thumbnailers pass back raw images 2022-02-20 21:14:33 +01:00
Přemysl Eric Janouch fbf26a7d66
Show application icons in context menu items 2022-02-20 12:07:40 +01:00
Přemysl Eric Janouch ef2544868d
Open items on mouse button release, not press
At least the left and middle mouse buttons seem to behave similarly
in other programs and systems.

Context menus are opened on button release on Windows and with some
GTK+ widgets (popovers in GtkPlacesSidebar).
2022-02-14 02:10:25 +01:00
Přemysl Eric Janouch 0857a04a3a
Scroll to selection when returning from the viewer 2022-02-13 13:18:36 +01:00
Přemysl Eric Janouch 4302ec71f2
Make changing the browser zoom launch thumbnailers 2022-02-13 13:18:36 +01:00
Přemysl Eric Janouch 38670428da
Add keyboard shortcuts for thumbnail size 2022-01-23 06:44:50 +01:00
Přemysl Eric Janouch 757bc9beaa
Fully support GNOME's inode/directory mechanism 2022-01-12 11:12:32 +01:00
Přemysl Eric Janouch 05453718bb
Avoid blank browser space when resizing the window 2022-01-12 10:41:33 +01:00
Přemysl Eric Janouch f1e9e47e13
Implement browser keyboard navigation 2022-01-11 14:36:19 +01:00
Přemysl Eric Janouch 764312652d
Support invoking a context menu from keyboard 2022-01-11 12:26:28 +01:00
Přemysl Eric Janouch e663f02754
Implement selection in the browser
Keyboard controls are missing so far.
2022-01-11 11:27:35 +01:00
Přemysl Eric Janouch 1a190001fc
Make the browser implement its own scrollable
It's quite rough around the edges so far.
2022-01-10 11:53:15 +01:00
Přemysl Eric Janouch 4f19a67da3
Add an unnecessarily fancy about dialog 2022-01-09 19:11:36 +01:00
Přemysl Eric Janouch 35c1f2c8ba
Parallelize thumbnail production 2022-01-08 07:46:28 +01:00
Přemysl Eric Janouch 0a6b06d1d0
Fix browsing the "resource" GVfs schema 2022-01-05 07:59:18 +01:00
Přemysl Eric Janouch 685defa684
Rename the whole project shorter
There is no point in claiming speed, it turns out to be a strange focus
to have, considering the amount of available innovations to make.

The new name does not appear to be taken by anything important.
2022-01-05 04:45:46 +01:00
Přemysl Eric Janouch b935b0baf8
Use a unified filesystem model
This removes some duplication of effort.

So far, sorting adjustments are not exposed in the UI.
2022-01-05 03:48:22 +01:00
Přemysl Eric Janouch 2ac918b7ab
A bunch of additional fixes 2021-12-31 03:43:51 +01:00
Přemysl Eric Janouch 5f8dc88fa7
Minor URL-related fix-ups 2021-12-31 00:41:04 +01:00
Přemysl Eric Janouch 380ddd540b
Convert all loading to use GFile
Now we're able to make use of GVfs, with some caveats.
2021-12-30 22:32:29 +01:00
Přemysl Eric Janouch c49e58a0ba
Fix thumbnailing cancellation
Everything's according to GAsyncResult documentation.
2021-12-28 23:49:35 +01:00
Přemysl Eric Janouch bf47782f0a
Move thumbnails into their own source file
And clean up identifiers.
2021-12-28 20:18:25 +01:00
Přemysl Eric Janouch 720464327c
Clean up 2021-12-28 02:07:42 +01:00
Přemysl Eric Janouch ad1ff06aff
Avoid producing thumbnails of thumbnails 2021-12-28 02:07:42 +01:00