Commit Graph

49118 Commits

Author SHA1 Message Date
Jehan 3852f164d2 modules: fix typo in meson build.
This explains such WARNING over a previous installation on Windows:

> (gimp-2.99.exe:11524): GLib-GObject-WARNING **: 21:36:36.664: Two different plugins tried to register 'ControllerDXDInput'.

The previous install was autotools-built, so it didn't have the typo.
2022-11-13 22:21:14 +01:00
Jehan 75e56986a0 NEWS: update. 2022-11-13 19:52:02 +01:00
Alexandre Prokoudine 4caa543dee Update Russian translation 2022-11-13 21:29:47 +03:00
Alx Sa cc3f7afb04 tools: auto-activate transform tools on canvas
This removes the need to click the canvas after selecting a transform
tool before you can start working on the transform.
2022-11-13 17:52:25 +00:00
Øyvind Kolås 06b481a3ec meson, configure, app: depend on babl 0.1.98 2022-11-13 17:31:32 +01:00
Øyvind Kolås b85032d8b6 meson, configure, app: depend on GEGL 0.4.40 2022-11-13 17:16:49 +01:00
Zurab Kargareteli 7eb07347fe Update Georgian translation 2022-11-13 06:48:54 +00:00
Anders Jonsson d3cea66c39 Update Swedish translation 2022-11-12 23:17:45 +00:00
Anders Jonsson 389da6447d Update Swedish translation 2022-11-12 23:15:18 +00:00
Jehan 143496af22 app, menus, pdb: new "Paste as Single Layer( in Place)?" actions.
When the clipboard contains raw image data or single layers, it's the same as
the normal "Paste" (and "Paste In Place" respectively). These actions are useful
if you want to copy a bunch of layers and paste them "merged" into a single
layers (since now the copy-paste of multiple layers will create multiple
layers).
It is somehow similar to the "Copy Visible" action except that it works on
selected layers only and work at paste time, making the action more versatile.
2022-11-12 22:34:51 +01:00
Jehan fc050914ab app, menus, plug-ins: move some advanced paste actions into submenu.
There are so many paste options and I feel that the "Paste into Selection*"
actions are advanved enough that they can go into submenus. So I move them into
"Paste as". The other reason is that I'm going to add 2 more options!

I hesitated to rename the "Paste as" submenu but we couldn't find a good naming
(except just "Paste" but it's redundant with the default action and "Paste…" but
this usually implies a dialog, not a submenu).

Last but not least, I renamed the various paste actions to contain the word
"Paste" in it. E.g. s/New Image/Paste as New Image/. The old naming made sense
when action labels were only displayed in menus. But nowadays they can be shown
in other more independant context, such as the action search (and just
displaying "New Image" in there is very misleading).
2022-11-12 22:34:36 +01:00
Jehan 92cc33d52a app: fix a use of gimp_edit_paste().
When dropping a buffer, we just consider it like common data pasting, hence we
leave the GIMP_PASTE_TYPE_NEW_LAYER_OR_FLOATING algorithm decide what type of
paste it will be.
2022-11-12 19:07:47 +01:00
Jehan 9a2f5b0709 app: rework and fix the logic for copy-pasting multiple drawables.
There were a lot of incertainty of what should happen when we copy layers being
descendant of each other (i.e. when you select a group layer and some of its
children), then when you paste such data. So we sat down with Aryeom and tried
to come up with some consistent behavior which is somewhat expectable, but also
which would allow the most use-case.

Otherwise it was making very weird result when pasting the data, duplicating
some layers and whatnot, which was obviously a buggy behavior and never the
expected result.

We decided that if you select one leaf item, then even if you also selected a
parent item, it would be as though the parent was not selected. This is very
often what you expect anyway when you select a whole bunch of layers and would
work well if, say, you shift-click over many layers in sub-groups. Then you
wouldn't have to manually ctrl-click to unselect every group.

Then what if you were instead expecting to copy many groups? Then you could
shift-click the group arrow, closing all same-level groups. Once they are all
closed, you can shift-click the groups to only select group layers, not their
contents.

This way, both use cases are still quite doable easily with this default choice.
2022-11-12 18:28:58 +01:00
Jordi Mas 6e92077a1f Update Catalan translation 2022-11-12 15:20:59 +01:00
Anders Jonsson a27089385e Update Swedish translation 2022-11-11 23:32:26 +00:00
Hugo Carvalho 418a45b165 Update Portuguese translation 2022-11-11 11:53:15 +00:00
Jehan 18c5b39cf5 app: copying from selection creates layers the size of the selection.
After further discussions with Aryeom, we had to make decisions about a few
problems. The main problem was: what happens when we copy a selection of a layer
whose bounds don't intersect with the selection?

The silent treatment of discarding the layer was not acceptable, because e.g. it
could happen on huge set of selected layers (like say you copy 100 layers with a
selection: you expect 100 created layers and if you realize you don't have them
all — e.g. you have 99! — after hours of work, trying to find the missing one
can be a huge time loss).
The status bar notification (or even error) did not feel right either because
this can typically be missed easily. Also it doesn't give a lot of feedback
(e.g. you might want hint to find the non-intersecting layers, in case it was
not supposed to happen).
An error box was even considered, possibly proposing to ignore the problematic
layers, or even giving easy ways to find them.
Finally what if we let the selection happen regardless the non-intersecting
layers? What should the dimension and offset of said layers be?

In the end, we went with the more consistent behavior of always creating new
layers of the exact same size as the selection. It can be considered as a rule
which would make the behavior predictable. For the non-intersecting layers, we'd
just have new layers with the dimension/offset of the selection bounding box,
and no contents. For other layers, they'd be also this same dimension, possibly
increasing the dimension of the source layers (though any new pixel is fully
transparent obviously). Aryeom wondered if some people might absolutely need for
their workflow that the new layers stick to the origin bounding box. But we felt
it was enough of a stretch that we'd try this way for now.

Note: of course if some day we get infinite canvas/layers, this whole discussion
could be less of a problem anyway! This was Aryeom's conclusion! Ahahah!
2022-11-11 00:04:38 +01:00
Jehan 363facef5e app: fix one case in gimp_edit_paste_get_top_item().
I was forgetting to store the path for the first item, which in particular was
making a problem when the top item was the first one in the list.
2022-11-10 23:29:23 +01:00
Jehan 1b64fdf52d app: pasting selection from multiple layers should still create multiple layers.
This is also work-in-progress for better copy-paste handling for multi-items.
Until now, I had decided that, if a selection existed, a copy would copy a
merged version of the selected items. But sometimes you want to have a piece of
each layer, each piece in its own layer. Also you may always merge the pasted
layers afterwards.

So now we will indeed create as many layers out as there are layers in. Being
able to copy a merged down version of all selected layers is still an
interesting feature though. We might add a dedicated "Copy Merged" action,
similarly to the fact we have a "Copy Visible" (which does the same thing but
for all visible layers, not specifically the selected ones).
2022-11-10 22:49:47 +01:00
Jehan bd186d56ee app: fix position of pasted data.
Position of pasted image data was getting very bad lately, especially with the
multi-item selection logic which confused the hell out of the legacy algorithm.
So I reviewed it a bit, in light of the multi-item abilities, as well as the
recent no-floating-selection paste changes.

One of the particularly wrong paste position was when pasting one or several
pieces (through selection) of existing layers. The positionning was really bad
and sometimes even off-canvas (which was explicitly forbidden by the algorithm,
except it was broken now).

Now the behavior is much more reliable and consistent, by centering on viewport
or on target drawables. If there are several such targets, their bounding box is
used as target position (and the bounding box of all source drawables is also
used now). An interesting consequence of this is that copy-pasting quickly
without removing a selection paste "in-place" since the target this time will
use the selection bounding box.

Aryeom and I are doing some work on specifying copy-paste (based on existing
logic, we tried not to disrupt too much years of logic, but also keeping
consistency and new logic for recent changes, such as multi-items). It will all
be written down into the GIMP developer website, section "Specifications".
2022-11-10 22:49:47 +01:00
Daniel Novomeský ec3da29f67 flatpak: remove extra lcms2
lcms 2.13 is already present.
2022-11-10 16:50:20 +01:00
Alexandre Prokoudine 61279385fb Update Russian translation 2022-11-10 14:49:21 +03:00
Yuri Chornoivan 178f283a37 Update Ukrainian translation 2022-11-10 09:20:34 +00:00
Jehan 3453c8bd55 app, pdb: paste layers over the top selected drawable.
When several drawables were selected, it was pasting at the top of the layer
stack. Instead, paste over the top selected layer ("top" visually in the Layers
dockable).

There was the question of: what should we do when pasting over a layer group.
Should we consistently paste the new layers above the group or inside the group?
After discussions with Aryeom, we decided to stay consistent and paste above, at
least for now.
2022-11-09 17:22:35 +01:00
Jehan 6083fd81a1 app, desktop: prepare AppData <release/> item for upcoming GIMP 2.99.14. 2022-11-09 15:31:39 +01:00
Jehan b674fd33f0 app: fix a critical for release demos with a dockable and no specific widget.
Fixes:

> GLib-CRITICAL **: 13:39:39.804: g_strchug: assertion 'string != NULL' failed
2022-11-09 15:22:05 +01:00
Jehan 51fe025afb app: update sensitivity rules of distribute buttons.
Distribute features do not care about the reference object anymore. All we care
about is whether we have more than 2 objects.
2022-11-09 13:20:31 +01:00
Jehan c3e1197ec9 app: fix a CRITICAL.
We should look at the display stored on the GimpDrawTool.
2022-11-09 13:04:51 +01:00
Zurab Kargareteli d5f21716f7 Update Georgian translation 2022-11-09 05:13:33 +00:00
Jehan 6b787312c0 NEWS: update. 2022-11-09 02:42:23 +01:00
Jehan 28457ce337 app: display the floating mask over the layer mask.
It would make using floating masks a lot easier as it is visually understandable
that it applies to the layer mask.
2022-11-09 02:15:41 +01:00
Alx Sa 2c4f91f585 app: Paste as new layer by default
This changes the default selection pasting behavior to be a new layer,
rather than a floating selection. It also removes the
"Paste as New Layer" submenu options as they are now redundant.
2022-11-09 00:31:00 +00:00
Jehan f6dd7f9b3a app: get rid of return_if_no_drawable() macro and…
… gimp_image_get_active_drawable() function!

Also fixing some memory leaks from previous usages of the multi version
return_if_no_drawables().
2022-11-09 01:24:34 +01:00
Jehan 5d75c79c89 app: remove compat registration for gimp-image-get-active-drawable.
Now we must use gimp-image-get-selected-drawables which is not a compatible
signature, as it returns an array of drawables.
2022-11-09 00:59:59 +01:00
Jehan ddec8e2255 app: remove the last usage of gimp_image_get_active_layer().
The histogram is still not multi-drawable aware. In the future, it would be nice
to add ability to generate histogram for all selected layers (merged and as
separate images) as well as the whole visible image, therefore 3 possible cases.

But for now, it's alright like this (no more, but no less feature than before)
and at least we got rid of the last usage of functions assuming single item
selection.
2022-11-09 00:53:17 +01:00
Jehan bd87766170 app: various Alignement tool strings update.
- Option dockable is named "Align and Distribute" rather than "Alignment".
  First, because it's not just about alignment; also because this way, it looks
  like other software, such as Inkscape; lastly because it's more consistent
  with other tool options ("Move", "Rotate", etc.).
- Add a tooltip to the Anchor Point widget to explain what it's used for.
- Rewrite various align/distribute button tooltips to make clearer that we are
  aligning anchor points with specific edges (or distributing these anchor
  points).
- Rename the first section to simpler "Targets".
- Some more rewording of other texts.
2022-11-09 00:40:44 +01:00
Jehan 6a63091e68 app: remove the offset feature in the Align/Distribute tool.
It's clearly broken right now. I can see it might have been used even to
progressively shift aligned items, but this was not used anymore. As for being
used while distributing, it doesn't make any sense anymore with the new logic of
not moving the extreme (first/last in coordinates) items.

I can see how an additional concept of offset can be useful in some situations,
but for now, let's get rid of this. We'll see in the future if someone asks for
it and provides valid use cases to work from.
2022-11-09 00:08:16 +01:00
Jehan e48b002c84 app, icons, libgimpwidgets: add "distribute with evenly gaps" options.
There was one case in Inkscape which we could not do: distributing objects
keeping even gaps between them. Until now, we could only distribute keeping even
distance between anchor points (top, left, bottom, right or center).

With these 2 additional distribute options, I believe that GIMP is able to do
all the Alignment and Distribution options available in Inkscape (not the
"Rearrange" or node features, neither the text align/distrib; I just mean the
common align/distribute on objects), and even a bit more thanks to the anchor
point system (e.g. in Inkscape, we can't left or right-align to a reference
object/image center, or we can't center to a reference left/right/bottom/top
border; but we can do it in GIMP).

The icons are hopefully temporary, until we can make better ones.
2022-11-08 23:48:32 +01:00
Jacob Boerema 9ba5b8dbd6 app: fix issues in gimpmodifiersmanager.c found by coverity
- buttons_key doesn't get freed.
- modifiers could theoretically be used uninitialized.
2022-11-08 16:57:04 -05:00
Jacob Boerema 981979bb39 plug-ins: improve security in flame plug-in
- Use g_malloc* functions instead of malloc, so we don't continue on
failed allocations unless we test for NULL.
- Make sure we don't iterate past the known number of control points (ncps).
- Safely allocate, initialize and free points. Since points seems to be
used uninitialized, we use g_malloc0 to set everything to 0.
2022-11-08 16:57:04 -05:00
Martin 4fa8e7941d Update Slovenian translation 2022-11-08 21:42:45 +00:00
Zurab Kargareteli a18408f73f Update Georgian translation 2022-11-08 20:50:04 +00:00
Jehan 09543af82a app: distribute while keeping extreme objects unmoved.
After discussing with Aryeom, we decided that "Distribute" should work within
the current horizontal or vertical bounds, as this is how it is usually done in
other software (e.g. Inkscape). For instance, if there are 4 items, the first
and last (coordinate-wise) stay untouched, and only the 2 intermediate items get
distributed evenly.

Since the Reference is not relevant anymore for "Distribute", I undo part of my
previous commit, where I was organizing the reference setting into its own
section of the Alignment tool options. This setting is back as part of the
"Align" section.
2022-11-08 21:39:58 +01:00
Jehan 2b0928d895 app: big UI rework of the align/distribute tool.
- Adding a separate pivot widget to allow choosing which point of the items we
  align or distribute. E.g. until now, we could only align the right side of
  objects to the right side of the reference object, left to left and center to
  center. Now these are independent. Therefore I can align the left side of
  objects to the right border of a selection or a layer, and so on.
- Only keep 2 "distribute" buttons (for now). Most of the distribution actions
  were basically broken or extremely hard to understand. Also they were
  apparently mixing concepts of alignments with distributions. Now let's
  basically only keep the bases: horizontal or vertical distributions.
  Everything is still possible using a mix of alignment and distribution
  buttons, and it's much clearer.
- Since the GimpAlignmentType was used nearly only there (except for some usage
  like to store dock side or filter preview split direction, but these
  GIMP_ARRANGE_* values were unused there), I removed the various enum values
  which we don't use anymore.
- The Reference settings gets its own subsection in the Align tool options.
  Until now, it looked like it only applied to alignment, whereas it applies to
  distribution too.

Note: this is still work-in-progress, mostly some initial dev work to put some
algorithmic bases. We had some UI and specification discussions with Aryeom
already and some things might still change a lot.
2022-11-08 19:19:55 +01:00
Jehan 63dc7dee8a app: redraw handles when needed.
There were various cases when the reference's on-canvas handles were not
redrawn, or drawn at all:

- When the reference is an image, we now draw them. It may seem redundant as
  it's the image bounds, but it's still useful to see what are the reference
  bounds in a glimpse. Moreover in "Show All" mode, it's even more useful.
- Start the tool, hence draw the reference handles, in oper_update() if not
  started yet.
- When the "align-reference" property changes.
- When the display (active image) changes.
2022-11-08 13:05:56 +01:00
Jehan 4c09f194d1 app: more fine-grained align/distribute button sensitivity.
When the reference is a guide in particular, no distribution is possible (on one
dimension, the size is 0, on the other, it's infinite) and alignment is only
possible in one direction (depending on guide orientation).
2022-11-07 22:48:30 +01:00
Martin a8983f7823 Update Slovenian translation 2022-11-06 20:19:07 +00:00
Luming Zh 06a9240046 Update Chinese (China) translation 2022-11-06 19:22:53 +00:00
Boyuan Yang c0cd58f38f Update Chinese (China) translation 2022-11-06 19:20:16 +00:00
Daniel Novomeský e58efc314d flatpak: change recipe for libjxl 2022-11-04 11:17:58 +00:00