Rust's standard library now provides a drop-in replacement
for `OnceCell`. It requires no API changes from `once_cell`'s
version.
This commit replaces the version from `once_cell` with the
new `std` struct where possible. We still need to use
`once_cell` for properties until
https://github.com/gtk-rs/gtk-rs-core/pull/1113
is merged. We also still need it for Lazy until that lands.
Part-of: <https://gitlab.gnome.org/GNOME/Incubator/loupe/-/merge_requests/241>
Also changing behavior when opening with multiple command line
arguments or when multiple images were selected from other
applications.
Old behavior: Spawn an instance of Loupe for each argument.
New behavior: One Loupe instance containing all arguments.
Closes#195
Uses code that drag and drop already uses. It's kinda ugly because the
file dialog returns a ListModel.
As an added bonus, since the button responds to the action "win.open",
it will also allow open multiple files with the primary menu.
It would be a good idea to change the "Open…" label in the primary menu though.
Closes#191
Usually we want to wait for dimensions to show the window in correct
apsect ration. But especially for large SVGs dimensions are only known pretty late.
Show the image to give UI feedback instead of waiting for dimensions.
Closes#146
Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/209>
Add parameters to use zoom_to without animation or
snapping to best fit. Hopefully fixing 100%/200% snapping
to best fit when close to filling the window and
fixing high res scroll wheel bugs.
Closes#120, #134
Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/177>
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
This also fixes the issue with the buttons triggering
focus changes when the action is deactivated because buttons
know have their own action.
Fixes#44
Issue #38
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
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
GTK 4.10 deprecates the old GtkFileChooser* APIs in favor of a
new GtkFileDialog utility. This new utility uses async functions
instead of a `response` signal, so we can make use of Rust's
async/await patterns.
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.