Commit graph

136 commits

Author SHA1 Message Date
Sophie Herold
a8693c50ef fullscreen: Hide headerbar on idle
Closes #154
2023-05-03 22:21:18 +02:00
Sophie Herold
3d6940cd45 image: Show window after 2 secs if dims unknown
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>
2023-05-03 19:16:17 +00:00
Sophie Herold
0a94484bab window: Leave fullscreen when status page is shown
We don't allow to fullscreen without image. So if last image
is deleted, let's leave fullscreen since there are no controls
to leave it.

Closes #150

Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/208>
2023-05-03 18:14:19 +00:00
Sophie Herold
fac2d360b6 meta: Update copyright headers 2023-04-26 18:19:23 +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
9d5dfd8728 window: i18n for filter name and add 'all files'
Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/195>
2023-04-21 16:53:12 +02: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
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
792968e51b window: Set action states based on current_page
Fixes actions not getting enabled and disabled

Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/184>
2023-04-19 01:46:15 +00:00
Sophie Herold
ae5ca76176 printing: Add printing support
Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/165>
2023-04-18 23:52:53 +00:00
Sophie Herold
e96b9ccac9 image: More fine-grained zoom instructions
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>
2023-04-18 23:23:18 +00:00
Sophie Herold
aca49427a1 window: Support dropping multiple files
This allows to scroll through all dropped files.
No further images from directories are loaded in
this mode.

Closes #35
2023-04-18 22:29:30 +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
f8cc9f5f84 i18n: Use gettext function instead of wrapper
No need to deviate from the default here.

Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/170>
2023-04-12 12:58:40 +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
889c818c14 code: Use pub(super) in GObject impl structs
This helps with getting warnings for fields we no longer use

Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/143>
2023-03-14 21:25:45 +00:00
Sophie Herold
f8e64d9805 trash: Use non-existing name when restoring image
We usually use the original path of the image.
For the rare case the original file name exists we create
one that is not used yet.

Closes #66

Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/130>
2023-03-14 00:07:08 +00: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
Christopher Davis
4d4bc4bb38 application: Stop using expressions
This commit moves the logic from the expressions to the
window via GSignalGroup.
2023-03-05 02:13:41 +00:00
Christopher Davis
3d445f25fe window: Use GSignalGroup to watch zoom levels
This allows us to git rid of more expression code.
2023-03-05 02:13:41 +00: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
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
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
4eb8b939b3 application: Add shortcuts for paning the view
Closes #54
2023-01-31 04:56:58 +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
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
Christopher Davis
eae81ebc60 window: Use GtkFileLauncher
GtkFileLauncher handles using the portal when
appropriate.
2023-01-18 20:21:48 -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
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
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
c1a3cc353d image: Limit zoom to 2000% 2022-11-28 23:24:12 +01: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
Christopher Davis
583794a3ec general: Use glib::Object::builder for objects w/ props
Builders are more idiomatic rust code than the old
pattern.
2022-11-24 13:06:53 -05: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
Christopher Davis
aa781d3864 application: Use gio::ActionEntryBuilder for actions
Allows us to drop the action! macro and usage of the clone! macro
in the application file.

The first occurrence of clone! is now in window.rs, so the comment
explaining it has moved there.
2022-11-23 19:56:51 +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
db69cbe64e window: Do not panic on failed drag-and-drop 2022-11-04 20:12:15 +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
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
Christopher Davis
81273c736e general: Update libadwaita-rs
Allows us to clean up our imports a bit.
2022-08-06 00:48:52 -04:00