Commit Graph

2687 Commits

Author SHA1 Message Date
Alx Sa cc62f2b037 actions: Load Gegl properties when editing filters
Some GIMP-custom GEGL operations do not use GimpConfig to
store their properties (for instance, Threshold). 
Previously, we weren't copying over their values when editing an
NDE filter.
This patch adds code to copy over the Gegl properties if there is
not a GimpConfig object attached to the filter.
2024-02-02 22:42:02 +00:00
Jehan 2294ad12fc app: fix crash when setting an action insensitive without setting reason.
When working on #9712, I encountered this crash first before the main issue
(with the same reproduction steps as listed by Wormnest): reason may not be set
by the method. It's better to always explicitly set this variable to NULL first.
2024-01-30 21:31:04 +01:00
Alx Sa e5592f2adf actions, dialogs, widgets: Windows Dark Mode title bar fixes
Making more dialogues use the title bar
theme code from ad8b47bf on Windows.
2024-01-30 15:58:07 +00:00
Jehan 3f54d83bac app: do not maintain manually the list of core ops with custom config object.
The list of objects where the config object is a dedicated custom class (instead
of a runtime-registered class) is well known. These are the operations
registered inside gimp_operations_init().

The list inside gimp_gegl_procedure_execute_async() which the previous commit
was updating was not right: it was still missing "gimp:hue-saturation" and
"gimp:threshold" should not have been on the list (this was generating a
CRITICAL when trying to get the "config" property on this object).

Instead let's add some init/exit() functions in gimp-operation-config API to
distinguish the operations with custom config (registered during init) with all
the others. Then we add gimp_operation_config_is_custom() which can be used
everywhere where we want to verify if an operation is using a custom-made config
object or a generated class just mirroring the operation properties.

This way, we should not get out-of-sync anymore.
2024-01-23 15:39:09 +00:00
Alx Sa 7a05a8956f tools: Fix Color Balance editing crash
Adds gimp:color-balance to the list of
GIMP-specific GEGL operations we
retrieve the GimpConfig settings from.
Also prevents trying to set a GEGL
property when editing if it couldn't be
converted properly (e.g. GimpConfig)
2024-01-23 15:39:09 +00:00
Alx Sa e678a20951 core: Initial non-destructive editing implementation
This patch implements an initial form of
non-destructive editing. Filters now stay active
instead of being immediately merged down.
A new column is added to the layer tree view, which
can be clicked to show a pop-over menu.
Filters can currently be hidden/shown, edited, reordered,
deleted, and merged down from this pop-over menu.

Currently, this works on layers and layer selections only.
Plenty of room for improvement!
2024-01-23 15:39:09 +00:00
Jacob Boerema 7a8f465b2d Issue #10588: enumerations for RotationType can't be used in Python
Due to GObject Introspection we can't have the last part of an
identifier start with a digit, since that part will be used in Python
as the identifier, and Python doesn't allow that to start with a digit.
e.g. GIMP_ROTATE_90 would be used in Python as
image.rotate(Gimp.RotationType.90)

To fix this we add DEGREES in front of the number, without a '_',
even though that looks ugly.
2024-01-05 13:28:49 -05:00
Anders Jonsson a4d309c7f7 plug-ins: more consistent ellipsis usage 2024-01-02 03:43:34 +00:00
Anders Jonsson bdf0d88456 app, plug-ins: mark missing strings as translatable 2023-12-13 17:44:35 +00:00
Jehan 05b2f93876 Issue #10153: introducing new floating data actions.
Though we mostly removed floating layers/masks (formerly floating
selections) in many interactions, at least for default behaviors for
basic pastes, there are still advanced usage attached to this concept
and some advanced users are willing to have easier access to such items.

For this reason, this commit:

- adds edit-paste-float and edit-paste-float-in-place for pasting the
  contents of the clipboard as floating data with default positionning
  algorithm or in-place respectively;
- renames select-float to select-cut-float which does a cut and paste as
  float in one action;
- adds select-copy-float which does a copy and paste as float in one
  action;
- reorganize a bit the `Edit > Paste as` submenu with sections for the
  floating data variants;
- add a "Float" submenu in "Select" root menu, containing the 2 variant
  actions select-cut-float and select-copy-float.
2023-11-11 16:40:44 +01:00
Alx Sa efa1267f13 actions: Fix layer buttons relative to floating selections
The anchor and merge down buttons are visible at the same time, which should not be the case.
Their visibility is now dependent on the existance of a floating selection.
The New Group and Search/Link buttons are also disabled when there's a floating section.
2023-11-10 20:33:26 +00:00
Jehan 8e66e5ae58 app: use "num-drawables" consistently for the array size argument of "drawables".
This is the naming we use everywhere else.
2023-10-16 14:45:04 +02:00
Jehan c8de818349 app, menus: Colormap dockable now shows a delete button.
This comes with a "colormap-delete-color" into the "colormap" action group. The
action/button will be insensitive when the selected color is used in the image,
since it is only possible to delete unused colors.
2023-10-09 15:28:20 +02:00
Jehan d71cd9d277 Issue #9604: "view-zoom-*" actions should not be radio actions.
A first attempt at fixing this was going through the idea of changing the
concept of radio actions, such as allowing an active action in an action group
to be called again. Or having some action in the radio group which can be called
but never set active.

But in fact, I just realized that these zoom actions are simply not meant to be
radio actions. They are not stateful actions, nor are they exhaustive.

I also updated the `other_scale` storage logic. Instead of updating it each time
the zoom changed (which was even broken in some cases, like when changing zoom
through another action), I simply save the last custom zoom value. This is the
one which is reused across calls. I don't think always resetting to the current
zoom value is very useful (if you call this dialog, it's not to zoom to the
current zoom!). Also there was some concept of flagging this stored zoom value
as "dirty" by making it negative, but this was never actually used, which makes
me believe that current logic was not the original intent anyway.
Saving the previous custom zoom explicitly set seems to be a good enough
behavior, so let's go with it.
2023-09-24 23:51:14 +02:00
programmer-ceds b84095d7c6 Fix Tools Shortcuts 2023-07-25 21:33:28 +00:00
mr.fantastic c47f4954ef Adding snapping by equidistance functionality 2023-07-25 15:31:16 +02:00
mr.fantastic 0aa8ac4660 Adding initial support for snapping layers/path_points by layers bounding boxes 2023-07-25 15:31:16 +02:00
programmer-ceds 4fa1472e9c Add terminating NULLs to the tools accelerator arrays 2023-07-20 22:59:51 +01:00
Anders Jonsson 44108eb9c3 app: make debug menu translatable 2023-07-10 14:58:49 +00:00
Jacob Boerema 14cce79d16 app: use hyphen for the precision settings in Encoding submenu
The Microsoft style guide and other places online suggest that using a
hyphen is recommended between a number and the related word, when modifying
a noun, so let's do that in our Image -> Encoding submenu too.
2023-06-30 11:37:19 -04:00
Jehan 3cb43bef93 app: localize GEGL filter's action default short label template.
Even though it's just for 3 dots, this may actually be formatted differently in
different languages. Let's not assume we all share this punctuation mark.
2023-06-26 02:19:26 +02:00
Alx Sa 01d7e7a992 actions: Fix "Raise or Open" to actually raise
Resolves #9636.
gimp_object_get_name (gimp_display_get_image (display)) returns NULL 
instead of the filename. documents_raise_display was changed to call 
gimp_image_get_imported_file () or gimp_image_get_file() instead to 
get the actual filename.
2023-06-21 20:10:12 +00:00
Øyvind Kolås 5b129f891a app: better synthesized short_label for gegl menu actions
For all the test-ops thus far in gegl, gimp:menu-label has been
the same as title + "..", to keep the number of duplicate strings
that need to be translated and the number of needed boiler-plate
lines of meta-data in GEGL down, this is the default behavior when
a title key exists.
2023-06-17 22:38:53 +02:00
Jehan 6dc5f6792e app: use the new GEGL metadata "gimp:menu-path" and "gimp:menu-label".
Instead of unconditionally add all the non-special-cased GEGL operations into
the menu, only insert the ones which explicitly use the new "gimp:menu-path"
GEGL key.
See new operation "gegl:adaptive-threshold" added in commit 7c2a70eee for such
an example.

Note that the other operations will still get their own generated action (which
means for instance that you can still search them through the action search and
that you can create custom shortcuts for your favorite actions). But now you
won't get an overlong generic list of non-organized actions in a single submenu.
Some people were finding this messy when they had a lot of custom GEGL ops.

Also it means that GIMP doesn't assume that any custom GEGL op is usable in
GIMP. Indeed some ops are really not meant to be used as filters, which is why
we have the gimp_gegl_op_blacklisted() internal function; but this cannot apply
to custom operations. Therefore from now on, instead of GIMP guessing, operation
developers will have the say on whether their op should show in menus and in
which menu path exactly!

Moreover the "gimp:menu-label" key will be used as short label, i.e. the label
which is used in menus in particular, where the menu path is a helpful context
(hence allowing to use shorter menu labels).
The main "title" will still be used as long label, for places where there is no
such context, for instance the action search.
2023-06-10 23:09:00 +02:00
Jehan b437552580 app: make sure that custom GEGL-operation generated actions have unique names.
When reverting commit d51c64ec06 and reimplementing as fa2e9adc29, the code to
make sure the generated per-op action name is unique disappeared. This code
ensures that the action name is indeed unique, otherwise the action will
override a previously registed action, which could be made from a plug-in, or
even by another GEGL operation. Indeed, while GEGL operation names are supposed
to be unique, they are post-processed to be valid GIO action names. So it is
totally possible to have 2 GEGL ops with different GEGL names, yet the same
GAction name.
2023-06-10 23:09:00 +02:00
Jacob Boerema 0bcce39637 app: update help-ids for layer crop/resize commands
The layer resize to selection and crop to content menu commands were
using the same help ids. This made it difficult to have them both listed
separately in the index of the manual.

Since we use separate help ids everywhere else for menu commands, let's
give each its own help id here too.
2023-06-07 11:24:28 +02:00
Michael Natterer e12798be0d app: change GimpGeglProcedure to take (n-drawables, drawables)
because we treat it the same as a plug-in procedure.
2023-05-27 12:35:52 +02:00
Michael Natterer 26dce72d2c Remove autotools 2023-05-27 00:03:52 +02:00
Michael Natterer c4f71f553c app: fix action_data_get_image() to return NULL more often
If "data" is a GimpItemTreeView or a GimpImageEditor, we REALLY want
only the image from these dialogs, even if NULL, and NOT some other
image from a display or context that randomly is around anyway. Fixes
the sensitivity states of lots of buttons in these dialogs.
2023-05-26 15:25:15 +02:00
Michael Natterer 58c40a1871 app: add "lock visibility" to the layer,channel,path property dialogs
and make the lock toggles use the same icons as in in the popover in
the dockable dialogs.

Fixes #9306
2023-05-26 02:46:53 +02:00
Michael Natterer b48846c752 app: remove the "Tab" accelerator from the "windows-hide-docks" action
Apparently this has never worked until we refactored our menus, now it
suddenly does but not as originally intended. Simply remove the
accelerator and let only the canvas event handler deal with the Tab
key. Restores 2.10 behavior which was quite ok.

Fixes #9352
2023-05-26 00:45:30 +02:00
Michael Natterer fa2e9adc29 app: reimplement the stuff reverted below
but stay completely in filter-actions.c and filters-menus.c
2023-05-25 02:31:28 +02:00
Michael Natterer dc25c2bc97 Revert "app: add a "Filters > Generic > GEGL Operations" submenu with generated actions."
This reverts commit 747cbf70db.
2023-05-25 02:31:28 +02:00
Jehan 806f88b9a0 app: no longer name variant for "Preferences".
It doesn't feel to me like appending "Dialog" is needed for this
specific dialog.
2023-05-25 02:27:21 +02:00
Michael Natterer e4f0bb0dfe app: valgrind found a bunch of memory leaks 2023-05-23 00:11:23 +02:00
Michael Natterer 7ada432690 app: big porting of weak pointers to g_set,clear_weak_pointer()
This started as review of weak pointers, but using
g_set_weak_pointer() and g_clear_weak_pointer() is almost always
better, and shorter.
2023-05-22 18:16:09 +02:00
Alx Sa 026e99c441 actions: Restore pasting image in empty workspace
In !769, I accidentally removed the ability to paste into an empty
workspace with Ctrl+V since I added a "does image exist?" check before
the `edit_paste_as_new_image_cmd_callback ()` call.
This patch resolves the issue by moving the check after the
"paste as image" function call.
2023-05-22 03:56:36 +00:00
Alx Sa bca4535c40 icons: Restore GIMP icons replaced by GTK defaults
Five icons in the Layer dockable were being replaced by GTK defaults at
runtime. A "gimp-" prefix was added so that GIMP's version would always
be used. A few dialogues were fixed to use constants rather than
hardcoding the filename, to make it easier to update the icon in the
future.
2023-04-30 13:58:39 +00:00
Idriss Fekir 99644ff5c9 Issue 7826: "select all" should not be reapplied
To check if "all" is selected call a function added to to channel interface
"is_full".
2023-04-20 21:49:03 +00:00
Jehan c6906e77da app: get rid of dummy "*-menu" and "*-popup" actions.
With our old code, we needed dummy actions for every submenu. This is not needed
anymore. Actions are only for end menu items (items which actually do something,
not just open a submenu).
Get rid of them all, as well as the code to ignore any action ending with such
suffixes in action-listing pieces of code.
2023-04-20 15:36:11 +02:00
Jehan 564103fdc1 app: allow changing submenu's labels with gimp_menu_model_set_title().
Use this for the "View > Zoom" and "View > Flip & Rotate" submenus which used to
display the zoom level and rotation angle. This regression is now fixed.
2023-04-19 15:21:48 +02:00
Jehan b0916fe701 Issue #9362: ordered argument format in printf requires no argument "holes".
Though it actually worked in some cases, and failed in others (I have not
figured out which build option exactly makes the format with hole work anyway),
printf manual actually explicitly says:

> There may be no gaps in the numbers of arguments specified using '$'; for
> example, if arguments 1 and 3 are specified, argument 2 must also be specified
> somewhere in the format string.

This explained while it was crashing GIMP (again, only with some build options,
or lack of build options):

> *** invalid %N$ use detected ***

There were 2 possible solutions for this: either ensure that the order number is
always used, but that defeats the purpose of plural localization. Instead I
reorder the argument so that the file name (which must always be shown for sure)
is first in arguments. This way, even if the order number is sometimes omitted
(be it in English or in any language), we avoid the crash.
2023-04-19 14:30:11 +02:00
Jehan 24048ef862 app: add some longer label variant for dialog actions.
Just "Layers" or "Patterns" was always very confusing. It was even worse when
both tools and dialogs had nearly6 the same name (for instance "Gradient" was
the tool action, but "Gradients" was the dialog).

Now these dialog actions will be labelled more obviously in the action search,
such as "Layers Dialog" or "Gradients Dialog".

Of course, the short name will stay in contextualized menus, such as in the
"Windows > Dockable Dialogs" top submenu, or in the Dockbooks' "Add Tab"
submenu.
2023-04-14 19:27:24 +02:00
Jehan 2511c70e8d Issue #9349: long label variant for tool actions.
While the short label can be "Gradient" for instance, because it is in the
submenu "Tools > Paint Tools", this is a confusing label say in the action
search.

Now the longer label will be used in there and will say:

> Activate tool "Gradient"
2023-04-14 19:15:16 +02:00
Jehan ea1205f094 Issue #9349: removing 2 duplicate "*-short" actions.
"edit-paste-as-new-image-short" and "vectors-selection-to-vectors-short" were
just duplicate of the action named the same, except for the "-short" suffix, and
the only point was to have different labels.

Not though that this time, it was not enough to conclude that the action in a
menu shoud have the short variant. These were both used differently depending on
the menu.
Instead I added the concept of "label-variant" attribute in .ui menu files. When
the "long" variant is set, then we simply use the longer label.

There is still one more "-short" action: "tools-by-color-select-short", but I am
a still unsure how to handle this one.
2023-04-14 18:54:16 +02:00
Jehan 89772351c9 Issue #9349: Add concept of "short" (contextual) vs "long" label for actions.
All Gimp*ActionEntry (except GimpProcedureActionEntry) now have a short_label
member.
This commit doesn't add any new short label yet. It just fixes the struct usage,
and fixes a few localization contexts here and there when I saw such broken
strings.

I also fixed a few gradient editor action strings which were not proper labels
(like "splitmidpoint" or "splituniform", or missing uppercase, etc.).
2023-04-14 17:48:57 +02:00
Jehan 1b932d10d3 Issue #9349: short and long labels for "windows-display-*" actions.
The short labels are just the file names as we have all the context in the menu
to understand what these actions do (in Windows menu, ordered by view position
and with a `Ctrl+n` shortcut next to each, increasing by position).

In the action search for instance, we keep a 'Show "<image name>"' label.

Also I'm adding a relevant tooltip to further explain what each of these actions
do, using the view position.
2023-04-14 16:33:35 +02:00
Jehan 341fd90958 Issue #9349: add concept of "short" (contextual) vs "long" label for actions.
Basically actions in menus should show the short label (we assume the menu
position brings contextuality) when available, whereas it will use the longer
label in GUI lacking contextuality.

As a first such usage, the `file-open-recent-*` actions have the file name which
will be opened as short label. This is used in menus since the submenu `File >
Open Recent` ensures that the action which will run is perfectly understandable.
On the other hand, in the action search, the action is named 'Open "<file
name>"' since an action named only with a file name would not be understandable.
2023-04-14 00:17:15 +02:00
Jehan 747cbf70db app: add a "Filters > Generic > GEGL Operations" submenu with generated actions.
Since we now generate actions for GEGL ops, we might as well generate menu items
for these too.

What I did:

- Move the "GEGL Operation…" tool (generic dialog with a drop-down list of all
  non-ignored GEGL ops) to Tools menu.
- Create a "GEGL Operations" submenu in Filters > Generic.
- Move "GEGL Graph" to the top of this new submenu.
- Generate a new menu item for each generated action tied to a GEGL plug-in,
  alphabetically sorted.
2023-04-13 23:06:54 +02:00
Jehan aa8ccf3ba8 Issue #6612: support numpad's divide ('/') as secondary action search shortcut. 2023-04-12 22:07:09 +02:00
Jehan af5612eda2 Issue #3834: keys Copy, Cut and Paste now supported as secondary shortcuts. 2023-04-12 22:07:09 +02:00
Jehan ab33d032ad app: support Forward and Back keys.
Same as ZoomIn/Out keys, these are implemented as secondary shortcuts to actions
"windows-show-display-next" and "windows-show-display-previous" respectively.

See issue #637.
2023-04-12 22:07:09 +02:00
Jehan 9e8304aeb9 Issue #637: support ZoomIn and ZoomOut special keys.
These will simply be recorded as secondary shortcuts for view-zoom-in and
view-zoom-out.
2023-04-12 22:07:09 +02:00
Jehan 71c8ff1f21 app: change all action entry structs to allow several shortcuts.
- The `accelerator` variable is a NULL-terminated array, allowing up to 3
  accelerators per action (so far, none has more than 2).
- Only the struct GimpProcedureActionEntry still has a single accelerator as I
  don't think it makes sense that we change the plug-in API to allow a plug-in
  to register more than 1 shortcut for a procedure (e.g. we don't want a plug-in
  to just register all possible keys for their procedure!).
  Of course, users will still be allowed to register more shortcuts for plug-in
  actions through the shortcut dialog. It's only the initialization which
  1-shortcut max for procedure actions.
- Remove all actions ending up in "-accel" as these were only a trick to
  register more shortcut for a same action. Now we just have the real
  possibility (rather than creating bogus duplicate actions). As a consequence,
  these actions accelerators have been moved as secondary accelerator to their
  main action.
  The deleted actions are: "view-zoom-out-accel", "view-zoom-in-accel",
  "view-zoom-16-1-accel", "view-zoom-4-1-accel", "view-zoom-2-1-accel" and
  "view-zoom-1-1-accel".
2023-04-12 22:07:09 +02:00
Jehan e724a9bff3 app: GimpActionGroup is not a GtkGroup anymore, but a GimpObject descendant!
I've hesitated if we should make it a GActionGroup, whose API handles actions
fully through name strings. I didn't see what it brings us short-term compared
to the additional work, so for now it's just a class of its own, not
implementing GActionGroup interface. Maybe later.
2023-04-12 22:07:09 +02:00
Jehan 38d0abc026 app: prevent multiple registrations of a same action.
Pre-GIMP-3.0 code logics would re-allocate several GimpMenuFactory or
GimpUIManager for no good reason. While it was still working with old GtkAction
code, with our new GAction-based code, we were ending up overriding an action
with a new version of the same action, while keeping reference to old actions.
This made for discrepancies of the enabled or visible state of actions.

The new code keeps singleton of some objects and references to already
registered GimpUIManager or GimpActionGroups objects and make sure no actions
with the same name are created twice.
2023-04-12 22:07:09 +02:00
Jehan 4251c931c7 app, menus: big cleanup of most of GtkUIManager API.
Only remaining API are action group-related.

While doing this, I also remove 2 debug actions which don't look like they were
outputting any information anyway (at least on the main dev branch):
"debug-dump-items" and "debug-dump-managers".
2023-04-12 22:07:09 +02:00
Jehan 2335e14d59 app: add the gradient editor submenu and a new concept of GimpRadioAction's…
… group name.

The gradient editor submenu add 2 submenus with changing names. It was using
again bogus actions: "gradient-editor-blending-func" and
"gradient-editor-coloring-type" do nothing except for being used as name
holders.

Instead I add the concept of group name for GimpRadioAction-s and when I use a
radio action attribute as <submenu>, this submenu will use the group name (and
sync with it, if it changes).
2023-04-12 22:07:08 +02:00
Jehan 9f1fd64a41 app: GimpRadioAction is now a subclass of GimpRadioAction.
We now completely got rid of all GtkToggleAction and GtkRadioAction code in the
whole of GIMP!
2023-04-12 22:07:08 +02:00
Jehan d73337680d app: rename the dynamic label for the "file-open-recent-*" actions.
While in the menu, under a contextual "Open Recent" submenu, it is well
understandable, the action is much less understandable without context, e.g. in
the action search. So I prepend an "Open" prefix.

Maybe a future alternative could be to have GimpAction have both contextual and
non-contextual labels (a.k.a. short vs long label)?
2023-04-12 22:07:08 +02:00
Jehan febb9dccd6 app: fix default values of 2 actions.
"windows-show-tabs" and "windows-use-single-window-mode" were set to FALSE by
default, while it is now supposed to be TRUE, same as the config properties. The
discrepancy was only showing with my new GimpMenu which better follows the
action's state.
2023-04-12 22:07:08 +02:00
Jehan a98a903976 app: get rid of gimp_action_(g|s)et_accel_path(). 2023-04-12 22:07:08 +02:00
Jehan 68d862b3c2 app: fully get rid of gimp_action_get_accel_closure().
All the remaining pieces of code where the deprecated concept of accelerator
closure was still used have now been replaced by proper GimpAction API using the
newer GAction API.
2023-04-12 22:07:08 +02:00
Jehan fd7ec4df6a app: make sure the "%s-move-to-screen-%s" have valid action names.
Depending on the OS, the display name may contain characters which are not valid
for action names. In particular, on X11, the display name could be ":0.0" and
therefore we get actions named "app.dock-move-to-screen-:0.0" or
"app.view-move-to-screen-:0.0". The ':' is invalid, which will make calling
gtk_application_get_accels_for_action() (or more simply our new function
gimp_action_get_accels()) fail.
See docs of g_action_parse_detailed_name().
The new utils function gimp_make_valid_action_name() will help us get rid of
invalid characters for actions whose name was generated from strings we don't
totally control.

Furthermore gdk_screen_make_display_name() is now deprecated API, and more
generally gdk_display_get_n_screens() is deprecated too and now always returns 1
since GTK+ 3.10 (i.e. now each display only contains a single screen). Instead
we just use gdk_display_get_default_screen() for every GdkDisplay. So this
commit doubles as GTK/GDK deprecation cleanup.
2023-04-12 22:07:08 +02:00
Jehan ae7ddfd5f5 app: better label the "windows-display-[0-9]*" actions.
Adding a 'Show" before the image identifier, which is now between quotes, and
making this string localizable.
This makes the action more understandable, especially when listed in
less-contextual UI such as the action search.
2023-04-12 22:07:08 +02:00
Jehan 726e690d38 app: make the GimpContext a mandatory property for a Gimp*Action.
Making the action be context-awareness will be useful, in particular as we'll
have access to the GtkApplication.
2023-04-12 22:07:08 +02:00
Jehan c8845c95ec app: move more of GimpActionImpl code into GimpAction. 2023-04-12 22:07:08 +02:00
Jehan a4e7bfdf23 app: rename "layers-mask-add-last-values" action as …
… "Add La_yer Masks with Last Values".

Add the "with Last Values", otherwise the shown label is the same as
"layers-mask-add" action, which is confusing (until we read the longer
description/tooltip).
2023-04-12 22:07:08 +02:00
Jehan dfcc339e15 app: fix non-properly matching gimp_image_undo_group_start/end() calls. 2023-04-12 22:07:07 +02:00
Alx Sa faf2be6dff actions: Standardize usage of "Soft-proofing"
Per #9269, every UI in GIMP but the Softproof Profile wrote it as
"Soft-proof". Now all menu options are consistent.
2023-04-04 17:46:21 +00:00
Jehan 508a6351c9 app: fix a call to gimp_edit_paste() (fixing buffers-paste* action). 2023-04-04 01:56:20 +02:00
Alx Sa 66271e1e56 actions: Disable Arbitrary Rotation menus if...
...no image is active.
There are Arbitrary Rotation options under both the Image and Layer
menus. All of those rotation options are disabled without an image open.
To keep consistency, this disables those menu options as well.
The Tools menu Rotation option is left as-is.
2023-03-07 20:45:48 +00:00
Jehan 473f0b49ef app: better handle bogus file names.
When a plug-in enters a bogus file name such as "Untitled.xcd" as URI,
g_file_is_native() returns FALSE. So when saving such file, core code tries to
mount a remote volume and fails (of course), without even opening the file
dialog.

This change is an attempt to detect such cases beforehand and not even try to
save it (just open the file dialog directly; the file name is still useful as
default proposed file name, as this part is actually valid).
Actually remote files will have a valid URI anyway (something with a valid
scheme, such as https:// or whatever other scheme).

As side fix, I am adding a missing space to the error which I got.
2023-02-13 22:57:09 +01:00
Jehan 19cb236955 Issue #8073: Crop can also be an extend.
Rename "Crop to Selection" to "Resize Layers to Selection" since it's not
necessarily a crop. The layer dimension can also grow now.

Also specifying "Layers" because action titles can also be displayed
off-context, such as in the action search, so we must be more detailed with our
action titles. Similarly adding a "Layers" to "Crop to Content".
2023-01-24 18:54:29 +01:00
Jehan ba5c423331 Issue #8924: Paste as new image uses the full canvas instead of just…
… the copied selection.
2023-01-24 12:51:30 +01:00
Jehan 9ec7c155a6 app: make Stroke Paths actions multi-paths aware.
These were also the last usages of the macro return_if_no_vectors.
2023-01-11 01:56:29 +01:00
Jehan a1fc57b325 app: vectors-fill-last-values now also multi-paths aware. 2023-01-11 01:39:29 +01:00
Jehan d96c13de2b app: "Fill Paths" action, multi-paths aware. 2023-01-11 01:31:10 +01:00
Jehan bc8590b40a app: several paths action made multi-items aware.
- Duplicate and Delete Paths are now both callable on several paths at once.
- Path Edit and Edit Attributes can only be run with exactly one path selected.
- Merge Visible Paths obviously always worked with more than one path.
2023-01-11 00:33:51 +01:00
Jehan ca8f4ef0d3 app: remove last usages of return_if_no_layer macro.
- "Discard Text Information" work on all selected text layers.
- "Text to Path" creates as many paths as there are selected text layers.
- "Text along Path" still only works with exactly 1 text layer and 1 path
  selected.
2023-01-10 23:13:49 +01:00
Jehan 563744934a app: layers edit actions are only meant to work on single layers. 2023-01-10 20:12:15 +01:00
Jehan 35ef93be03 app: remove last usage of return_if_no_channel macro.
The channel attribute edit action only works with a single channel at once.
2023-01-10 20:07:44 +01:00
Jehan 897d7ef168 app: channels and path to selection actions multi-item aware. 2023-01-10 20:07:44 +01:00
Jehan 545b794b72 app: setting color tags actions now multi-item aware. 2023-01-10 20:07:44 +01:00
Jehan 036ba77415 app: actions for lock position of items multi-item aware. 2023-01-10 20:07:44 +01:00
Jehan a602ea7662 app: lock contents of items multi-item aware. 2023-01-10 20:07:44 +01:00
Jehan 7c7c62a1df app: Toggle Layers/Channels/Vectors visibility action multi-item aware. 2023-01-10 20:07:44 +01:00
Jehan 2912552263 app: make the "Anchor" tooltip depending on whether we are floating over…
… a layer or a layer mask.
2022-11-28 20:43:56 +01: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
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 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
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 831cb91303 app: remove gimp_image_get_active_drawable() usage in colormap actions. 2022-10-20 23:17:07 +02:00
Jehan 48bebb8a27 app: replace one more usage of gimp_image_get_active_drawable(). 2022-10-19 15:14:14 +02:00
Jehan 74b4951e50 app: remove a gimp_image_get_active_drawable() in select actions.
The action "select-float" should probably only work for a single selected
drawable anyway since a floating selection can only be stacked on one drawable
at a time.
2022-10-19 15:09:38 +02:00
Jehan 6716d06aa1 app: remove one more gimp_image_get_active_drawable().
Actions "vectors-fill*" and "vectors-stroke*" require a single drawable to paint
to. So action logic is unchange. I only replace gimp_image_get_active_drawable()
by gimp_image_get_selected_drawables() and counting the drawables.
2022-10-18 22:36:24 +02:00
Jehan 6eb78ca11f app: remaining drawable actions are now multi-layer aware. 2022-10-18 22:19:44 +02:00
Jehan 85adfb46c8 app: make "drawable-lock-content|position" multi-drawable aware. 2022-10-18 22:06:21 +02:00