If only 1/4 of a zoom step zoomed in, assume best-fit.
This helps with floating point precision when zooming in and
out again. It also removes akward other minimal zoom steps.
This change centralizes part of the best-fit detection.
Makes dragging an image out of Loupe work in most cases.
There seems to be an issue with dragging from flatpak to host.
Removing the png from the provider seems to avoid gdk crashes
but not 100% sure that was the cause.
Add shortcuts
- F9 Image properties
- F10 Main menu
- Ctrl +/- for zoom
- Ctrl 0 for best fit
- Ctrl [Shift] R for rotate
- Escape to leave fullscrenen
Updated help overlay accordingly.
- Rename to Loupe to avoid confusion during incubation
and potentially allow for release on Flathub
- Replace GNOME as developer since it violates software policy
- Put a more useful copyright statement
- Add me as developer
Allows us to drop the action! macro and usage of the clone! macro
in the application file.
The first occurrence of clone! is now in window.rs, so the comment
explaining it has moved there.
Zoom via
- Scroll event controller
- Zoom gesture
- Overlay buttons
- Fixed zoom level shortcuts (1=100%, 2=200%)
Scrolling via
- Scrolled window
- Drag gesture
Changes
- Implement best-fit via calculating a zoom level
- Gesture for carousel no longer working because of scrolled window
- Split control overlays into two to not steal inputs in area between
Closes#17
With https://gitlab.gnome.org/GNOME/libadwaita/-/merge_requests/652
merged
we no longer crash when loading files from the same directory.
Now that we don't crash, we've exposed a logic error: we were
changing the state of the carousel while scrolling through it,
which ends with the carousel in a weird state.
This commit delays clearing and refilling the carousel until
after the `page-changed` signal is emitted.
This is for easier debugging in case a panic happens -
instead of dealing with "thread <unnamed> paniced...", etc.,
we get a name relevant to our context.
`parse_svg_file_future()` is called in a cancellable async
block. This means that after it's called it can be cancelled,
which drops the receiver. When we fetch the metadata, we try
sending the result to the dropped receiver.
This is expected behavior in this case - the receiver
being gone at the time of sending the metadata is perfectly
valid. However, previously we would cause the thread to panic.
This didn't break anything but made for scary log message.
Since this is expected behavior we can use `_` to tell the
compiler that we don't care about the outcome of sending.
This is valid in this instance because we will only get an
error if the receiver is gone.
Implement a properties sidebar. In order to prevent
the UI from freezing, we use futures to load and cancel
loading file information. We also make use of
`gdk_pixbuf` and `svg_metadata` in order to get the file's
metadata before the file fully loads, meaning there's
little to no delay between changing files and seeing
the metadata for large images.
The properties widget uses expressions and
properties to avoid glue code for setting each label,
allowing us to have a clean separation between UI
and data.
The GFile is more useful for other data. The window can
use expressions to calculate an appropriate title, so
we no longer need to call `set_title()` or connect to
a signal manually.
This commit also adjusts the `uri()` and `print()`
functions to use `active_file()`
Allan Day's latest mockups have the fullscreen icon on the bottom
left of the image. This commit moves the icon there, using a
GtkExpression for the icon name.