Commit graph

169 commits

Author SHA1 Message Date
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
Christopher Davis
ae41a77521 properties_view: Move expressions to UI files
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.
2023-03-05 02:13:41 +00:00
Automeris naranja
6857f2c921 window: Change AdwStatusPage title to "View Images"
Fixes https://gitlab.gnome.org/Incubator/Submission/-/issues/1#note_1654093
2023-02-24 19:14:44 -03:00
Sophie Herold
8a46ef32c6 propertiesView: Fix opening flap on drag gesture
This only fixes opening the flap on touchscreens. Preventing
close is much harder. But hopefully wil be fixed upstream.
2023-02-14 22:42:20 +00:00
Sophie Herold
f87a1b7131 data: Update metadata for incubation
Also add some missing appstream information
2023-02-12 19:49:06 +00:00
Sophie Herold
6077292117 helpOverlay: Show correct gestures for RTL
Closes #38
2023-02-07 21:22:12 +00:00
Sophie Herold
69889820cd window: Add Home/End shortcuts for first/last img
This is the same as in EOG.
Also add PageUp/Down for image navigation from EOG.
Cleanup the navigation enums as well.
2023-02-06 19:14:55 +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
aa7a2dfd93 window: Add image deletion
Add Flatpak access to GVfs for trash:/// access for being
able to recover files (undo trash operation).

Closes #26
2023-02-02 00:45:40 +00:00
Christopher Davis
04e8646daa properties_view: Make subtitles selectable
Closes #23
2023-02-01 16:02:08 +00:00
Sophie Herold
4eb8b939b3 application: Add shortcuts for paning the view
Closes #54
2023-01-31 04:56:58 +00:00
Christopher Davis
0d74083cf8 propertiesView: Do not propagate natural height
Propagating the height resulted in new window dimensions not
fitting to images.
Use ScrolledWindow instead of PreferencesPage to have
control over propagate-natural-height.
2023-01-31 04:29:29 +00: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
sunflowerskater
6e632e7281 window: Update AdwStatusPage description
This change applies @bertob suggestion for an updated AdwStatusPage description:
https://gitlab.gnome.org/Incubator/Submission/-/issues/1#note_1641740
2023-01-20 03:13:45 +00:00
Tobias Bernard
9008c394f4 icon: New, unique app icon 2023-01-10 22:57:28 +01:00
sunflowerskater
2817e9bca6 window.ui: Rename Primary Menu to Main Menu
Currently, the "Main Menu" tooltip is "Primary Menu". However, HIG advises to use "Main Menu" instead:
https://developer.gnome.org/hig/patterns/feedback/tooltips.html

This commit changes the button tooltip to "Main Menu".
2022-12-21 19:03:59 -03:00
Sophie Herold
cc52f7a542 propertiesView: Move location to top of section
It just looks better with icon and it makes sense content wise imo
2022-12-19 18:44:23 +01:00
Sophie Herold
4b9c91f8df exif: Show device maker more consitently
Also, don't call it camera because it can be a scanner etc as well
2022-12-19 18:44:08 +01:00
Sabri Ünal
cbde386126 help-overlay: Improve some shortcuts and help-overlay 2022-12-17 17:07:22 +00:00
Sophie Herold
36000ff65c window: Put prev/next accels at window level
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
2022-12-16 18:27:45 +00:00
Sophie Herold
65808f5894 propertiesView: Show basic EXIF data
Use libgweather to determine the city for EXIF GPS coordinates.
Make ImageMetadata a GObject to use it's properties in UI.
2022-12-12 11:31:27 -05: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
f1593203a0 window: Add missing shortcuts
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.
2022-11-25 15:46:35 +01:00
Sophie Herold
3876f55b4c about: Change app name to Loupe and update devs
- 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
2022-11-23 21:10:03 +00:00
Sophie Herold
ab4981a4e1 data: Add metainfo 2022-11-23 18:13:01 +00: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
c2e3bb2f83 menus: Add rotate left and right buttons 2022-11-06 17:58:02 +01:00
Sophie Herold
57f573f98a ui: Fix quotation marks 2022-11-04 20:48:32 +01:00
Sophie Herold
a2e6767584 image: Add rotation and auto rotate based on exif 2022-11-04 18:52:33 +01:00
AsciiWolf
743577757f data: Rename appdata to metainfo
The appdata file/directory name is deprecated.

Also change the desktop component type to desktop-application. Same reason.
2022-10-06 16:38:46 +02:00
Elton A Rodrigues
8679734a43 general: change wallpaper to background
- Change wallpaper term to background(string and code)
- Remove toast error when cancel background portal
2022-08-18 09:42:25 -03:00
Elton A Rodrigues
2f9c7793c8 window: Add "open..." to menu
add an option in menu to open new image
2022-08-17 21:20:02 -03:00
Christopher Davis
d443107146 build: Drop join_paths() in favor of / 2022-08-05 00:39:50 -04:00
Christopher Davis
ba4661031f Implement Properties
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.
2022-08-02 19:31:44 -04:00
Christopher Davis
1e95dd4cbb image_view: Expose file as a property instead of filename
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()`
2022-08-02 19:30:08 -04:00
Christopher Davis
9ba6cced6c window,image_view: Move fullscreen controls to the image view
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.
2022-07-14 17:35:20 -04:00
Christopher Davis
689f975bf0 window: Add copy button to top left
Allan Day's latest mockups put a copy button in the top left
of the window. This commits adds the button and the toast along
with it.
2022-07-14 16:27:38 -04:00
Christopher Davis
fadb6bfb9b image_view: Move controls to the bottom
Per Allan Day's latest mockups
2022-07-14 16:27:38 -04: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
Christopher Davis
f88c48ca69 desktop: Add Loupe as a keyword
Allows us to search by code/bin name in GNOME
Shell
2022-02-04 23:58:53 +00:00
Maximiliano Sandoval R
be09d49756
image: Implement Copy to clipboard 2022-01-08 23:59:56 +01:00
Christopher Davis
400672b6b6 window: Add ToastOverlay and use toasts for feedback 2021-12-28 16:40:58 -08:00
Christopher Davis
be70bdafe5 window: Implement drag and drop
The main page is no longer a lie.
2021-12-27 22:05:29 -08:00
Christopher Davis
5d9567507c window: Add "Open File..." button, remove gesture
This gives users a very intuitive way to open files.
The gesture was awkard and didn't match any common patterns
across GNOME. The button is simple and obvious.
2021-12-23 20:35:22 -08:00
Christopher Davis
5c25a6a270 application: Use standard shortcut for help overlay
Ctrl+F1 never really worked - that was chosen based
on the mockups, but in reality it only opened Help.
Apps usually use Ctrl+?.
2021-12-22 16:02:17 -08:00
Christopher Davis
d4fca8aae3 general: Iv* to Lp*
We're probably going to be keeping `loupe` as the codename
and binary name going forward.
2021-12-21 10:55:02 -08:00
Christopher Davis
4d1141a675 widgets: split view and image
This will make implementing a more comprehensive photo view simpler.
2021-12-20 08:37:50 -08:00
Christopher Davis
5e7965ff4a window: Disable swipes on the flap
We don't want or need these for this case.
2021-10-08 05:50:49 -07:00
Christopher Davis
1e0732ac92 ui: Add tooltips to buttons 2021-09-29 00:38:07 -07:00
Christopher Davis
f7553e02a4 More typography fixes 2021-09-29 00:38:07 -07:00