Adds a draw mode toggle (pencil icon, shortcut D) that reveals a
bottom toolbar with freeform pen and shape tools (rectangle, ellipse,
triangle, star), a colour picker, line-width spinner, undo (Ctrl+Z),
clear-all, and a "Save Copy…" button that exports a flattened PNG.
Copying to clipboard (Ctrl+C) also flattens the annotations when any
strokes are present. Strokes are stored in image-pixel coordinates and
rendered via a Cairo overlay in the snapshot pipeline, so they remain
correctly positioned during zoom and pan.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
So after building the package with ninja, "ninja test" will no longer
rebuild the entire package (and require another rebuild with "ninja
install" or simply "ninja" again).
Before, if the target file was gone, files_around just returned an empty
list of files, leading Loupe to think there are no images and showing
the empty state view.
This was frequently triggered by the "Replace original" function in
editing, since the tmp file was already gone, when the view moved to it.
Now, the correct error is shown, and scrolling to the other files is
possible.
Issue #585
Previously, detecting unsaved changes relied on whether there are any
changes that happened in the editing view. This would mean, that after
using "Save as" unsaved changes were still assumed.
Changed the logic of app.quit accelerator, introduced a dialog in it.
Also made functions such is_save_senstive() and save_overwrite()
publicly accessible for logic building.
Fixes: #537
Part-of: <https://gitlab.gnome.org/GNOME/loupe/-/merge_requests/576>
A message catalog can have at most a single string with a given msgid,
in this case having a branch with gettext and another with ngettext
would result in two strings with " (Edited)" as their msgid.
This can be checked via:
$ meson compile loupe-pot
INFO: autodetecting backend as ninja
INFO: calculating backend command to run: /usr/bin/ninja loupe-pot
[0/1] Running external command loupe-pot
/usr/bin/xgettext: warning: msgid ' (Edited)' is used without plural and with plural.
src/widgets/edit_window.rs:197: Here is the occurrence without plural.
src/widgets/edit_window.rs:200: Here is the occurrence with plural.
Workaround: If the msgid is a sentence, change the wording of the sentence; otherwise, use contexts for disambiguation.
Part-of: <https://gitlab.gnome.org/GNOME/loupe/-/merge_requests/578>
Zoom out for 16px or smaller images is usually blocked. But allow it for
zoom menu as we allow 50% via zoom menu in other situations where it is
blocked otherwise. Also, this is probably much less complex
implementation wise.
Closes#544
The best-fit calculation would consider levels >=1 for best-fit. This
seems fundamentally wrong since that should be reserved for LargeFit.
This caused zoom-in to fail since best-fit was considered instead. But
that best-fit was computed with BestFit mode since the mode changed in
between in zoom_to_full.
Fixes#556