Commit graph

399 commits

Author SHA1 Message Date
Sophie Herold
d14e9dca53 ci: Add cargo clippy checks 2023-02-12 19:32:22 +01:00
Sophie Herold
19c8d69dca code: Fix clippy warnings 2023-02-12 19:31:22 +01:00
Sophie Herold
1d034cd53d flatpak: Do not use builddir
This currently leads to Builder rebuilding for every branch.
With builddir=false we get incremental builds across branches.
2023-02-12 02:05:35 +00:00
Sophie Herold
75cb4ad58f slidingView: Fix swiping on touchscreens
The width of one page is measure by a unit of 1.0.
So this is the correct value
2023-02-10 21:45:34 +01:00
Sophie Herold
cf03d357a0 slidingView: Add space between images 2023-02-10 17:35:26 +00:00
Sophie Herold
6077292117 helpOverlay: Show correct gestures for RTL
Closes #38
2023-02-07 21:22:12 +00:00
Sophie Herold
caefec74b4 image: Limit rubberbanding zoom and add stiffness 2023-02-07 21:56:00 +01:00
Sophie Herold
74a067e3b8 window: Fix Left/Right button direction for RTL
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
2023-02-06 21:07:23 +01: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
7cf04d290a clipboard: Use same ContentProvider as for D+D
FileList is working in more cases than PNGs and has fewer drawbacks.
Also, it's the same that has been used elsewhere for a long time.

Closes #50
2023-01-31 05:17:39 +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
ce1cb0d299 slidingView: Add RTL support
Issue #38
2023-01-31 01:08:56 +00:00
Sophie Herold
d533124daa slidingView: Implement swipe gesture (AdwSwipeable) 2023-01-31 01:08:56 +00:00
Sophie Herold
74d148572f image: Fix image centering creates blur
Ensure to only move by physical pixel values
2023-01-30 04:25:01 +00:00
Sophie Herold
fc553d108c image: Fix minimal scrollbar with best-fit
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
2023-01-30 04:25:01 +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
Sophie Herold
73764810eb CI: Move pages to deploy stage 2023-01-27 02:26:22 +01:00
Sophie Herold
3b08851cce CI: Generate code docs and publish for main 2023-01-26 17:51:56 +01:00
Christopher Davis
8de0b42d9d util: Use proper file collation API
glib-rs provides an API to get file collation keys that
can be used for comparison. This means we do not need to
use the function for this ourselves.

This commit gets rid of the manual binding for
`g_utf8_collate_key_by_filename ()` in favor of the glib-rs
API.
2023-01-22 22:56:16 +00:00
Christopher Davis
6c59e21264 image: Load Texture directly
`gdk::Texture::from_file ()` automatically falls back to
GdkPixbuf for file types Texture doesn't support natively.
2023-01-22 20:16:55 +00:00
Christopher Davis
469e721d2b image: Use async function to load file info
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.
2023-01-22 20:16:55 +00:00
Christopher Davis
7b7435f50a general: Use spawn! less
Because widgets can install async actions, we can simply
turn our callbacks into async functions.
2023-01-22 19:55:42 +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
Christopher Davis
eae81ebc60 window: Use GtkFileLauncher
GtkFileLauncher handles using the portal when
appropriate.
2023-01-18 20:21:48 -05:00
Christopher Davis
9d7dae408b properties_view: Use GtkFileLauncher for opening directory
GtkFileLauncher handles opening the containing folder for
us, using the portal when appropriate
2023-01-18 20:21:15 -05:00
Sophie Herold
0c86d0d202 flatpak: Add libadwaita carousel patch for testing
Add the patch for now to get more test exposure

Issue #11
2023-01-15 19:24:07 +01:00
Christopher Davis
1dce6b75ae application: Use gio API for help
`show_uri ()` is deprecated
2023-01-14 14:44:50 -05:00
Christopher Davis
947b2101b2 application: Use gtk_window_present() instead of gtk_widget_show () 2023-01-14 14:43:46 -05:00
Christopher Davis
2757e94e08 window: Update use of FileDialog.open_future()
Requires an updated gtk-rs
2023-01-14 14:23:54 -05:00
Tobias Bernard
9008c394f4 icon: New, unique app icon 2023-01-10 22:57:28 +01:00
Philip Goto
3f8921198d Update POTFILES 2022-12-28 21:19:40 +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
ec45132a97 exif: Do not display city if more than 100 km away
Display GPS coordiantes instead
2022-12-19 19:24:23 +01: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
Christopher Davis
ba77ee1a32 window: Use new async FileDialog API
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.
2022-12-12 17:52:06 +00:00
Sophie Herold
01bebfef38 imageView: Include overlay controls in min size
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
2022-12-12 12:01:24 -05: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
68221bacba file_model: Load opened image first add dir later
- 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
2022-12-12 15:54:24 +00:00
Sophie Herold
acd8bea356 README: Add bundle download url and screenshot 2022-12-08 17:55:57 +01:00
Sophie Herold
ccfbcf60a8 image: Calculate next zoom step from target
This fixes that clicking a button/key during an animation
does not give you the expected zoom speedup.
2022-11-29 00:04:13 +01:00
Sophie Herold
78e528d299 image: Also snap into 'best-fit' if close to it
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.
2022-11-28 23:43:56 +01:00
Sophie Herold
c1a3cc353d image: Limit zoom to 2000% 2022-11-28 23:24:12 +01:00