Commit graph

35 commits

Author SHA1 Message Date
Sophie Herold
2fdfe5657c image: Refresh file info after file rename 2023-12-04 18:08:25 +01:00
Sophie Herold
b56d650086 code: Reformat with new rules 2023-11-29 21:16:11 +01:00
Sophie Herold
4ca7c71538 imagePage: Use properties macro 2023-11-29 19:19:49 +01:00
Sophie Herold
55811a2bb7 image: Use macro for object properties 2023-11-29 18:52:31 +01:00
Sophie Herold
5a905cd53f ui: Move .ui-files to src/
Closes #46
2023-11-29 01:50:54 +01:00
Julian Hofer
cd8188a1bb Simplify async code
- Update Cargo.lock
- Use new gtk-core API
- Remove unneeded async
- Remove unneeded clones

Part-of: <https://gitlab.gnome.org/GNOME/loupe/-/merge_requests/310>
2023-11-22 09:12:36 +01:00
Sophie Herold
55551ae6a2 general: Update copyright notices
Part-of: <https://gitlab.gnome.org/GNOME/loupe/-/merge_requests/258>
2023-07-18 17:48:43 +00:00
abu_shawarib
33b4928c72 Revert "imagePage: Correctly align right-click menu"
This reverts commit 0ddecefe01.

Part-of: <https://gitlab.gnome.org/GNOME/Incubator/loupe/-/merge_requests/247>
2023-07-02 12:13:22 +00:00
Sophie Herold
291fa13d1f meta: Update copyright headers 2023-06-07 23:44:20 +02:00
Huan Nguyen
0ddecefe01 imagePage: Correctly align right-click menu
Before it was incorrectly centered
2023-05-21 16:03:13 +00:00
Sophie Herold
c42fe235c6 imagePage: Make crossfade from spinner work
It did not work before because the spinner page did
not take up the complete stack.

Also hiding the spinner when animating out of it
since it can be pretty dominant. Especially, since
it's usually not really shown before but the animation
starts emediately instead.

Closes #153

Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/205>
2023-05-03 15:54:51 +00:00
Sophie Herold
2f9fad47a1 src: Update or add auto generated license headers
Closes #55

Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/169>
2023-04-19 20:02:01 +02:00
Sophie Herold
fad8bb7939 decoder: Use GFile instead of PathBuf
This allows to show images from locations that don't
have a representation with path.

This also works around not being able to read files in trash:///

Closes #56

Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/174>
2023-04-18 16:22:49 +00:00
Sophie Herold
032707a210 fileModel: Use GFile with URI as key
Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/174>
2023-04-18 16:22:49 +00:00
Sophie Herold
8b3cfd000a cargo: Remove gtk-macros dependency
Using the crate is depreacted. Replaced spawn! macro
with our own spawn function
2023-04-06 21:08:33 +00:00
Sophie Herold
7b7ece1dc3 slidingView: Allocate LpImage more correctly
Allocate the ScrolledWindow instead of the LpImage
to include non-overlayed scrollbars.

General cleanup how we measure things.

Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/150>
2023-04-02 15:42:42 +00:00
Sophie Herold
0e24f347e6 imagePage: Move popover out of LpImage
It cause 'not measured' errors and we have enough
things to handle in LpImage already.

Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/146>
2023-03-18 21:24:45 +00:00
Sophie Herold
6a4ee11c76 imageView: Add only viewed images to recently used
Only adding images expclicitly opened via file browser
or drag and drop. Do not add images while browsing
SlidingView to avoid spamming recently used files.

Closes #53
2023-03-08 02:24:27 +00:00
Sophie Herold
05ef429b86 image: Add newly designed thumbnail for DnD
The old method stopped working with the new decoder setup.

The new design features a frame for contrast and rotates
images based on EXIF information.

Closes #89
2023-03-08 01:48:34 +00:00
Sophie Herold
f12ff1ea4d widgets: Add some widget descriptions 2023-03-06 22:59:40 +01:00
Sophie Herold
f80ec7db56 decoder: Use image-rs, libheif-rs, librsvg
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
2023-03-04 21:48:51 -05:00
Lubosz Sarnecki
30136f9050 code: Fix some typos.
Fix some typos, mainly in comments with the power of
Builder's spell correction.
2023-02-21 00:19:05 +01:00
Sophie Herold
004ebd5615 cargo: Update dependencies 2023-02-15 17:04:59 +01:00
Sophie Herold
169dd454cc image: Add double click for zoom/fullscreen
Zooms on touchscreens and fullscreens otherwise.
Using the fullscreen behavior for now, since that's what
a lot of other apps do.
2023-02-06 18:40:32 +01:00
Sophie Herold
f2357513da imageView: Use custom slide widget and IndexSet
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
2023-01-30 01:08:57 +00:00
Sophie Herold
e04992b46d window: Adjust to image size when opening
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.
2022-12-12 15:54:24 +00:00
Sophie Herold
d6ab100062 image: Use FileList in ContentProvider
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.
2022-11-28 19:34:18 +01:00
Sophie Herold
029c0c9244 image: Add zoom and scrolling support
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
2022-11-23 00:57:43 +01:00
Sophie Herold
a2e6767584 image: Add rotation and auto rotate based on exif 2022-11-04 18:52:33 +01:00
Sophie Herold
3d6564377a cargo: Update dependencies 2022-11-03 00:57:18 +01:00
Christopher Davis
81273c736e general: Update libadwaita-rs
Allows us to clean up our imports a bit.
2022-08-06 00:48:52 -04:00
Christopher Davis
37f170b165 general: Name spawned threads
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.
2022-08-03 19:53:32 -04:00
Christopher Davis
d99215bfd1 general: Use gtk_macros::spawn!()
Makes the code a tad cleaner because we're not manually
getting `glib::MainContext` every time we want to spawn
a future.
2022-08-03 19:37:03 -04:00
Christopher Davis
7b24523079 image_page: Claim event sequences 2022-04-20 13:12:47 -07:00
Christopher Davis
2aa480eee5 widgets: Rework image_view with AdwCarousel, add ImagePage
Previously we loaded images synchronously and manually
changed `LpImage`. This could cause freezes when loading
large images and SVGs. We also had no proper feedback for
when a corrupted or unsupported image was loaded.

This commit introduces a major rework to how we handle
images and the gallery. It introduces a swipeable gallery
that loads files asynchronously via a new widget: LpImagePage.

LpImagePage owns the file and information related to the file,
and on creation it spawns a future that either loads an error
page when it can't load something (file deleted, corrupted, or
unsupported) or the actual image via LpImage. LpImagePage
now holds the right-click popover and the associated gestures.

The gestures needed to be moved to LpImagePage in order to
rework LpImageView's overlay - instead of having an overlay
child that's a box with a few buttons, we now have the buttons
as individual overlay children. This could cause them
to overlap each other at certain sizes, but it's required
in order to allow input to reach the carousel below.

Right now this comes with a few regressions:

* Occasionally input gets blocked across the applications. It's
hard to tell if this is caused by swipes or right clicking. This
input issue can cause a crash - no Rust backtrace, so a debugger
is needed.

* The "current" page doesn't seem to be properly loaded by the
time `set_image_from_file ()` finishes, so we need to rework
resizing from image dimensions

* We need to re-implement loading different directories and
files within directories

There also seems to be an issue on touchscreens, swiping between
images on a touchscreen causes responsiveness issues not present
when swiping on a touchpad. My guess is that it's related to
the long press gesture.
2022-04-20 13:12:45 -07:00