This adds proper support for a lot of image formats including SVGs.
It will be the basis for many features to come. The technical core
is an asynchronous renderer that can arrange textures in smaller tiles
which might be generated on demand.
Closes#34, #40, #41, #49
Basis for fixing the following issues #7, #27, #36, #43, #68, #71
Expressions have the leak issue mentioned in the previous
commit, but we were using them in a few scenarios where
they couldn't be used in UI files.
Since these expressions don't set a property but instead
trigger behavior, the appropriate API to use is GSignalGroup.
This commit switches the expressions on the image to use
GSignalGroup instead.
Currently Loupe leaks expressions created in-code. This
is because expressions need to be unwatched in order to be
dropped. Since we'd need to hold a reference to the watch
ourselves and unwatch them in dispose, our code would
become more cumbersome if we were to try to handle this properly.
This commit moves the expressions on LpPropertiesView to the
UI file, as GTK handles cleaning up the expressions it creates,
without any extra consideration on the app side.
For larger images minimal float errors can add up to having
an image size being minimally larger than the widget.
This leads to fake scrollbars that don't even scroll.
Rounding to physical pixel size fixes this.
Fixes#47
Use IndexSet to allow direct access by Path and also allow
an arbitrary ordering that was not possible with Vec. Also
add monitoring of file changes in the directory.
Use a custom LpSlidingView instead of AdwCarousel because
Carousel was never designed for this job and suffered of
bugs. LpSlidingView does not support swiping gestures yet
since they currently don't work yet anyways #24.
Use a new algorithm to fill the LpSlidingView that is
stateless and covers all potential changes in the directory.
This not only fixes bugs but would also work with changed
sorting orders.
This also adds build time template XML validation since it
was useful for the refactoring #46.
Closes#9, #11, #30, #33, #42
GdkPixbuf provides `file_info_future ()` to load the file
info asynchronously, using the gio thread pool. That
means we don't need to spawn a thread ourselves for it.
Tried to make things more stateless and RefCell usage for robust
- Use object properties to control the action enabled/disabled
- Borrow model RefCell for only one line or use .replace()
- Don't pass models around and borrow as short as possible instead
Fixes#20
This stops the overlay controls to overlap for very small
window sizes and properties opened.
LpImageView already does custom measure and overlay is it's
direct child. So added it here.
Fixes#32
Give LpImage a native with that should feel nice.
When opening a new window with a new image the window size
is determined by LpImage's natural width.
The image size and EXIF data is loaded before the image such
that the window can be shown in the right dimension while
loading the actual image.
- Fixes image cannot be opened when directory unreadable
- Avoids bugs with wrong images being selected for an instant.
Mostly important for adjusting the window size to image.
- Basis for prioritizing loading the important image first
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.
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.