Commit graph

58 commits

Author SHA1 Message Date
qwel
3111efdd94 window: First work for drag overlay visuals
Issue #59

Part-of: <https://gitlab.gnome.org/GNOME/loupe/-/merge_requests/258>
2023-07-18 17:48:43 +00:00
Christopher Davis
186401fb57 general: Change user-facing name to Image Viewer
This is part of the move to Core.

Part-of: <https://gitlab.gnome.org/GNOME/loupe/-/merge_requests/256>
2023-07-13 21:51:09 +00:00
Christopher Davis
9e70931faf Revert "general: Remove help-related code"
This reverts commit 2965799374.

Part-of: <https://gitlab.gnome.org/GNOME/Incubator/loupe/-/merge_requests/248>
2023-07-02 12:43:52 +00:00
Christopher Davis
77c81c8f7c window: Use sp instead of px for breakpoints
sp is a unit provided by libadwaita for sclae-independent pixels.
This unit changes with the text scale factor.

Part-of: <https://gitlab.gnome.org/GNOME/Incubator/loupe/-/merge_requests/228>
2023-05-31 21:32:40 +00:00
Christopher Davis
a5cb0606b4 window: Remove stack from breakpoint
The stack widget is always visible, and does not need to be
set as visible again when the breakpoint is applied/unapplied.

Part-of: <https://gitlab.gnome.org/GNOME/Incubator/loupe/-/merge_requests/228>
2023-05-31 21:32:40 +00:00
Christopher Davis
5297231137 window: Use only one breakpoint
AdwBreakpoint automatically resets properties when the breakpoint
conditions no longer apply. This means we don't need to manually
create a breakpoint for the sidebar at widths greater than 590px,
as libadwaita already does that for us.

This commit removes the extra breakpoint.

Part-of: <https://gitlab.gnome.org/GNOME/Incubator/loupe/-/merge_requests/228>
2023-05-31 21:32:40 +00:00
Christopher Davis
4d391b566e window: Remove extra quotes
Some extra quotes were left in the UI file. Thankfully because
these were fully closed, they weren't causing any issues. Still,
they don't need to be there.

This commit removes the extra quotes.

Part-of: <https://gitlab.gnome.org/GNOME/Incubator/loupe/-/merge_requests/228>
2023-05-31 21:32:40 +00:00
Huan Thieu Nguyen
c6897da62d window: Let the user select multiple files to open.
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
2023-05-21 23:41:22 +02:00
Huan Nguyen
8804938859 window: Support forward and back mouse buttons
The button value for forward is 9. See <GNOME/gtk#515>.

Closes #172
2023-05-21 16:17:48 +00:00
Sophie Herold
3dc9e40bcb imageView: Fix vertical minimum size in measure 2023-05-03 23:47:40 +02:00
Sophie Herold
6e29b1ebff window: Move properties to bottom for narrow view
Closes #39
2023-05-03 23:41:36 +02:00
Sophie Herold
dbb65fa2cb window: Better solution for swipe sending motion
Swipe gestures send motion events without changed cursor position.
Catch that in a better way to avoid showing overlay controls on swipe.
2023-05-03 22:22:05 +02:00
Sophie Herold
a8693c50ef fullscreen: Hide headerbar on idle
Closes #154
2023-05-03 22:21:18 +02:00
Sabri Ünal
32ee47d08f app: Split rotate actions
To ensure simplicity of the process, replace the rotate actions
with new two actions, without modifying the existing rotate_image method.

Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/201>
2023-04-25 17:51:43 +00:00
Sophie Herold
b30296f994 window: Hide cursor with controls fullscreened
Closes #149

Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/197>
2023-04-25 00:05:24 +00:00
Sophie Herold
4037b124d2 window: Properties button insensitive for no image
Make the toggle button insensitve if no image is shown.
Also close the properties if no image is shown anymore.

Closes #60

Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/193>
2023-04-20 20:11:17 +00:00
Sophie Herold
2dbc7fa585 window: Drop AdwFlap for Headerbar
Redo everything headerbar related with new Adw widgets
when there is a working concept.

Closes #112

Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/192>
2023-04-20 19:49:16 +00:00
Sophie Herold
916514604c imageView: Hide controls after mouse inactivity
Closes #25

Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/189>
2023-04-20 15:18:06 +00: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
Christopher Davis
2965799374 general: Remove help-related code
Our help documents are unfinished, and we shouldn't ship
unfinished documentation in our initial release.

We can revert this commit when we're ready to write the
documents properly.

Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/156>
2023-04-02 18:36:17 +00:00
Sabri Ünal
8743149cbb ui: Mark two tooltips translatable
- Copy to Clipboard
- Move to Trash
2023-03-11 00:49:03 +00:00
Automeris naranja
5d3f74b1df window: Add mnemonic to the "Open File" button 2023-03-05 13:59:54 +00:00
Automeris naranja
e1d81fe57b window: Set Main Menu button as primary
By setting the Main Menu button as primary,
the F10 key is automatically assigned to this button.
Setting a shortcut with GtkShortcutController is no longer necessary.
2023-03-05 07:29:10 -03: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
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
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
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
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
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
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
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
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
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
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
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
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
Christopher Davis
02694cc8da window: Adjust sentence casing and typography 2021-09-29 00:38:07 -07:00