Commit graph

6529 commits

Author SHA1 Message Date
Jehan
e9e2bb1b2e app: GimpEditor buttons will have the associated action name as identifier. 2026-03-01 23:48:57 +01:00
Jehan
b87bab9e8c app, libgimp*: add GimpCurve sample API in libgimp and PDB. 2026-03-01 22:33:58 +01:00
Bruno Lopes
b7d89728c4 app, libgimpthumb, plug-ins, tools: Fix POSIX namespace warnings on MSVC 2026-02-28 10:06:46 -03:00
Bruno Lopes
dc1771918b app: Only show the installed locales for GIMP
Closes: #15468

There is no point on showing languages that can not be used.
This was confusing distro package and Windows installer users.
2026-02-26 20:51:09 -03:00
Alx Sa
3a4bd57da6 widgets: Turn off default search in GimpPrefsBox
Same patch as cb552d3d, just applied to GimpPrefsBox.
This was visible in the Preferences Dialog, where the same
unnecessary pop-up appeared in the side panel.
2026-02-26 19:15:13 +00:00
Jehan
7296099388 Issue #13368: pressure curve is missing from the GimpDeviceInfoEditor.
This was happening on Wayland in my tests, and apparently on Windows
too, according to the report. I widely simplified the code. Now we don't
list of axis anymore, and therefore we don't allow to change these
(which was not working anyway, for as long as I remember, at least on
Linux, both X11 and Wayland).

As for the pressure curve, we just show it unconditionally for any
device of type "Pen". It may mean that it might show on some rare stylus
devices with no pressure support, but in such case, it will just be a
bogus curve (it won't break the device).
And then we'll avoid all the flimsy heuristic trying to guess if a
device is supposed to have pressure sensitivity, which especially became
bad in Wayland as we have this information only on proximity. It means
that if you don't approach the stylus and were trying to set up your
pen's pressure curve with a mouse, no curve would appear!

Add to this that gdk_device_list_axes() seems very broken on Wayland and
was always returning GDK_NONE for all axis (even when only using it on
various device signal handlers, per advices by Carlos on IRC), at least
anyhow I tried to make it work, our heuristic to detect when an axis
should be ignored was completely broken on Wayland as well.

A simpler logic should work better and makes the code simpler to read
too.

It's also one less usage of GtkListStore, which is good for future GTK
versions where it got deprecated!
2026-02-24 22:54:48 +01:00
Alx Sa
bc02381f14 widgets: Hide move handle in Text Editor window
Since the Text Editor window uses the same
GimpTextStyleEditor widget as the on-canvas editor,
it also shows the Move handle (which doesn't work
in the Text Editor window). This patch simply hides it
so it doesn't confuse users.
2026-02-23 17:42:28 +00:00
Lukas Oberhuber
cb730621e6 Issue #11998: do not steal focus from spin widget when double clicking 2026-02-21 13:48:16 +00:00
Alx Sa
ed1e71917b widgets, themes: Define style for GimpPivotSelector
This patch adds a CSS class name to
GimpPivotSelector so we can define its
CSS style in the GUI.
It also defines the margin-right CSS property
to prevent it be affected by the general
GimpOverlayDialog style.
2026-02-18 14:52:49 +00:00
Alx Sa
11f131aa1f widgets: Use 64bit for HistogramEditor counts
Resolves #13014
In GimpHistogramEditor, pixels and counts are stored
as doubles. We previously converted them into 32bit integers
when displaying the values to the user.

As it is possible for the dimensions of an image to exceed the
limit of a 32bit integer, this could lead to overflow and negative
pixel counts.

This patch switches our display code to use 64bit gsize casts
for conversion to prevent this from happening.
2026-02-13 06:17:52 +00:00
Jehan
d893aa373d Issue #11642: "images-delete" action not disabled when the selected…
… image's displays change in the Images dockable.
2026-02-07 00:39:12 +01:00
Alx Sa
cfba63a932 core, widgets: Don't remove inactive filters on merge
If a filter is inactive/invisible, it does not
affect the appearance of the drawable.
Therefore, when merging all active filters,
those filters should not be removed.

This patch adds conditional checks for
gimp_filter_get_active () and does not
remove filters on merge if it returns
FALSE. It also adds sensitivity checks in
the GUI so that the merge down button is
not active if there are no visible filters.
2026-02-06 21:50:13 +00:00
Jehan
9417565ea2 Issue #15575: add arg to color button prop widget to choose context awareness.
In particular, for indexed images, color choice will happen within the
colormap.

The following uses are made context-aware:

* Test tool options color;
* Fill colors.

These other uses will not be context-aware:

* Padding, quick-mask and padding colors;
* Out-of-gamut colors;
* Generically generated color buttons (e.g. in filter dialogs);
* Foreground selection's mask color;
* Grid colors.
2026-02-03 13:10:41 +01:00
Jehan
0f325fa0d0 app: only grab focus on canvas when exiting the color dialog.
This was introduced in commit d4733e5b21. This was triggering a focus
grab each time we changed the color from within the FG/BG dialog, which
in particular had the focus being lost from said dialog. This is not
really good usability wise (and as a side issue, with some themes, the
focus change was apparently a bit bothering visually).
2026-01-26 16:33:00 +01:00
Alx Sa
dd28bae44c widgets: Make Fx icon invisible when no filters
We use a GimpCellRenderToggle for the Fx icon
in the layer and channel docks. If you hover over it
when there's no filter, a square "checkbox" will appear
and give the impression you can click on it, even though
you currently can not.

This patch connects the "visible" property of the toggle to
the number of filters attached to the drawable, similar to
what we did for "active". This prevents the checkbox from
appearing, and will hopefully reduce user confusion.
2026-01-22 02:06:01 +00:00
Alx Sa
cf41831a58 display, widgets: Change Navigation/Selection editor UI...
...for dark mode.

The Navigation and Selection Editor
docks use GIMP_ICON_TEXTURE as their
default background when there's no
active image. On dark mode, this creates
large bright areas in the UI.
This patch removes the calls to
gimp_view_renderer_set_background ()
for these docks so the theme background
is used instead.
2026-01-20 16:46:12 +00:00
Alx Sa
31e4c79933 widgets: Add conditional mask delete button
GimpLayerTreeView's delete button always deletes
the selected layer(s), even if a mask is selected.
This patch adds a new action button for deleting masks
(using the "layers-mask-delete" action) and conditionally
shows/hides it and the existing delete button based on
whether the mask or the layer is selected.

Note that after 3.2, we may replace this commit with a
single new action that conditionally deletes either the
mask or layer, depending on the selected item.
2025-12-18 12:25:28 +00:00
Jehan
d92c237a17 Issue #13709: wait we get our first surface focus before listing…
… input devices.

Per Carlos' advice on gtk#7534, I wait for us to get a focus, since the
pad devices are only created at that point.
Note that this is a Wayland-only issue, but since it doesn't matter too
much that input devices are not initialized before we have a focused GUI
anyway, let's make this simpler.

At the earliest, the splash focus can announce a focus, but since it is
possible to start GIMP without the splash, display shells will also
possibly announce the first focus (there will always be a display shell
focusing at some point for any GUI GIMP!).
2025-12-16 00:02:33 +01:00
Alx Sa
d20c7f01cb widgets: Don't force selection of GimpRow
As seen in the Welcome Dialog, if you have multi-selection
in place for a ListBox and try to Ctrl-click another row,
the call to gtk_list_box_select_row () will deselect the
prior row unless you click on an area that's not covered
by GimpRow. This patch removes the forced selection,
with the assumption that the click will bubble through
as normal to GtkListBox.
2025-12-05 23:41:12 +00:00
Jehan
e607efa99a Revert "app/widgets: Add spacing between actions buttons in GimpOverlayDialog"
This reverts commit 3f399fd24c.

As discussed in MR !2531, let's reimplement this as CSS at least!
2025-12-04 20:07:27 +01:00
Ondřej Míchal
3f399fd24c app/widgets: Add spacing between actions buttons in GimpOverlayDialog
Without any spacing the button box looks rather weird.
2025-12-04 03:00:49 +02:00
Anders Jonsson
f1c76e0981 app: translate x axis label in GimpDynamicsOutputEditor 2025-11-26 19:43:47 +01:00
Alx Sa
f8b4331647 widgets: Add reason for non-mergeable filters...
...on non-raster layers.
Resolve #15368

Per Bruno, the "Merge Filters" button on the
NDE filter pop-up should have the same warning
message if it is disabled as the "Merge Filter"
checkbox does in the Filter Tool itself.
Since the button is visible when there's a group
layer, a warning is also displayed for that, though
due to string freeze it is not yet set to be
translatable.
2025-11-26 17:02:46 +00:00
Sabri Ünal
c8d7aa0814 widgets: Provide context for "New Layer" string
The "New Layer" string used without plural and with plural which
causes a warning in xgettext.

This patch partly fixes: #15264
2025-11-20 08:15:28 -03:00
Jehan
0129126fb8 app: remove GimpPickableSelect.
It has now been fully replaced by GimpItemSelect.
2025-11-17 13:47:07 +01:00
Alx Sa
37a0e37d25 widgets, pdb, libgimp: GimpProcedureDialog Item Widget
This patch adds a GimpItemChooser widget
for use in GimpProcedureDialog Item parameter
GUI creation.
This will deprecate the existing
GimpDrawableChooser, as it covers all the
same cases plus others such as GimpPath.
2025-11-16 16:42:24 +00:00
Alx Sa
5fde1b9e89 libgimpwidgets, theme: Group radio buttons together
This patch swaps out the GtkBox in
gimp_enum_icon_box_new_with_toggle ()
with a GtkButtonBox and sets it to EXPAND
so that the buttons are pressed together.
It also adds some CSS style to complete
the effect.
2025-11-15 02:50:17 +00:00
Alx Sa
a9dc4ddb2c widgets, pdb, libgimp: GimpProcedureDialog Image Widget
This patch adds a GimpImageChooser widget
for use in GimpProcedureDialog Image parameter
GUI creation.
2025-11-12 03:12:24 +00:00
Jehan
926d5c6daa app, libgimp*, plug-ins: fix previous commit and add gimp_cairo_surface_get_buffer().
The previous commit was not taking into account usages of
gimp_cairo_surface_create_buffer(), other than the text layer rendering
usage, as it was focused on fixing #14970.

In particular, in other pieces of code, we were using a temporary
GeglBuffer as a way to edit the original Cairo surface but the syncing
back was not happening anymore. So previous commit was breaking all
thumbnails of layers or images, as well as PDF export for all raster
layers.

After some thought, I decided to implement a new function
gimp_cairo_surface_get_buffer() which would do what
gimp_cairo_surface_create_buffer() was doing, but adding a boolean flag
to declare whether or not we were expecting to sync back into the Cairo
surface's data. After all, when we don't need to sync back, better avoid
the useless work of copying possibly huge data.

I also added back the possibility of returning a linear-memory backed
buffer, after some discussion with pippin. Because for very small
surfaces, and if we are indeed looking to sync back into the source
Cairo surface, the advantages of using a linear buffer may still be
worth it, even though it's not true for the general case (where tiled
buffers will be much more efficient). I used 4096 (64^2 because our
current tile dimensions are 64 right now in GIMP), though this number is
kinda random and doesn't matter too much (it doesn't have to be the
square of the tile's width or height). I don't put any info about this
in the new function's documentation because developers should not have
any expectations on the type of buffer they get (only whether or not it
will sync back to the source).

As a consequence of all this, gimp_cairo_surface_create_buffer() has
been deprecated as of GIMP 3.2, though it will still work the same. The
new function will be recommended as a replacement.
2025-11-08 20:34:55 +01:00
Gabriele Barbero
5d03bb847e core, widgets: ensure to add colors of GimpFillEditor in color history once
Previously, changing the color via the GimpFillEditor color button
immediately pushed each intermediate value into the color history,
polluting it with transient previews. Only the final choice
confirmed by the user should be recorded.

Now the color is recorded in the history only when the user explicitly
confirms the selection (e.g. OK/Apply), preventing noisy
history entries while preserving the expected behavior when a color
is accepted.

core: add spaces to fix alignment
2025-11-08 18:50:33 +01:00
Alx Sa
32c9d11fd1 widgets: Don't hardcode item column in blink_item ()
In gimp_item_tree_view_blink_item (), we
originally used "3" because that is the
item column in the layer and channel
dockables. However, the path dockable
item column is at "2" since it lacks a
filter column.

To make this more general, Jehan
suggested we create a
gimp_container_tree_view_get_main_column_position ()
function in GimpContainerTreeView that
finds and returns the column index of
the main item. Then, we use that function
in gimp_item_tree_view_blink_item ().
2025-11-08 04:55:30 +00:00
Idriss Fekir
cd2d2bd8bc GimpContainerEntry:Fix non unique names issue and wrong callback signature
Signature for "match-selected" signal on GtkEntryCompletion was wrong,
and code didn't handle the case of multiple resouces sharing the same
name. (e.g. 2 different fonts both named "Holiday").
2025-11-07 21:27:57 +00:00
Jehan
459f80a6de Revert "widgets: Update tool item visibility code"
This reverts commit 2ba6725761.

This too is wrong. First it mentions "visible-vertical" and
"visible-horizontal" properties of GtkAction, but this is not it! Two
similarly named properties are also on GtkToolItem and these are not
deprecated! Looking at the code, tool_button is a GimpToolButton, whose
parenting indeed goes up to GtkToolItem (and that's obviously not an
action anyway).

Secondly, it creates other bugs, in particular I now sometimes have a
completely empty toolbox. That's clearly wrong.

Reverting for now. Issue #9813 will have to be fixed differently.
2025-11-06 22:00:21 +01:00
Jehan
3215e6c967 Revert "app/widgets: Guard against division by zero"
This reverts commit ee421da346.

This is wrong. This case should not happen, or if it does, this is very
likely not the proper fix. In fact, it was trying to fix a bug created
in commit 2ba6725761 which is also wrong (and which I'm going to revert
next).

See also my comment in Gitlab:
ee421da346 (note_2596612)
2025-11-06 21:55:00 +01:00
Ondřej Míchal
ee421da346 app/widgets: Guard against division by zero
Resolves crashes happening occasionally when opening GIMP.

Maybe related to 2ba6725761bfa687fcab0f259712fcdd8aac0bdd?
2025-11-06 05:06:09 +02:00
Alx Sa
2ba6725761 widgets: Update tool item visibility code
"visible-vertical" and "visible-horizontal" attributes
of GtkActions were deprecated in GTK 3.10, and since
the GAction port, we don't set them anyway on actions.
This seems to have impacted the ability to toggle a toolbutton's
visibility when a toolitem's "show" property is changed.
This patch replaced the deprecated "visibile-vertical" and
"visible-vertical" properties with a single "visible" property,
which consistently updates when the eye icon is toggled in
GimpToolEditor.
2025-11-05 17:05:52 +00:00
Alx Sa
29e09ff2b5 widgets: Allow dragging ColorHistory colors
The intention was that you could drag colors from
the color history to the canvas, similar to the
Foreground/Background editor colors.
However, because the GimpColorArea widgets are added
to a button, the button intercepts the DnD signal mask.
This patch adds a call to gimp_dnd_color_source_add ()
when the buttons are created, to pass the ColorArea color
onward.
2025-11-03 12:30:29 +00:00
Alx Sa
aaa6bc5f9c gui, widgets: Connect ViewableDialog to style updates
This patch allows the header icon and view
in GimpViewableDialogs (and children of
this dialogue class) to scale based on user
custom icon size.
Note that it only scales when a new dialogue
is opened; it is not set to update if a dialogue
is already open and the slider is changed.
This could be added later if desired.
2025-11-03 11:37:35 +00:00
Alx Sa
2e6bb273dd widgets: Center buttons in OverlayDialog
Resolves #15215
The GtkButtonBox that holds the overlay buttons
in GimpOverlayDialog were set to GTK_BUTTONBOX_END,
which caused them to go offscreen on one side on the smaller
overlays like Scale and Sheer.
This patch changes the layout style to GTK_BUTTONBOX_CENTER
to ensure the buttons are centered within the overlay.
2025-11-03 02:14:42 +00:00
Jehan
6a40e98c9b app: fix CLang build.
Our Weekly CLang build for Debian failed with:

> ../app/widgets/gimpfiledialog.c:924:37: error: label at end of compound statement: expected statement
>                             default:

That is not a problem locally (with GCC), but I guess we can just add a
g_return_if_reached() in here as this code path is not supposed to ever
be reached indeed.
2025-11-01 19:22:49 +01:00
Gabriele Barbero
dc1bd701ac tools: add icon to restore on-canvas text editor position
This commit adds a button inside the on-canvas text editor
that restores the editor to its original position after it has
been moved. The button is only visible when the editor has been
moved, and disappears when it returns to its default position.
2025-10-31 15:39:10 +01:00
Gabriele Barbero
bd6fc8594a tools: fix on-canvas text editor position on screen after being moved
After the on-canvas text editor has been moved, it should remain fixed
on the screen when zooming or panning the canvas. This commit preserves
the current behavior when the editor is in its original position, and
fixes its position on-screen after it has been moved.
2025-10-31 15:39:10 +01:00
Gabriele Barbero
dae8472d58 tools: allow on-canvas text editor to move
This commit implements the ability to freely move the on-canvas
text editor across the screen by introducing a drag-and-drop mechanism.
2025-10-31 15:39:10 +01:00
Jehan
eeb419a363 Bug 373060 - allow to easily switch to last used tool.
New action "Last Tool" ("context-tools-swap"), defaulted to <shift>X.
Thanks to Damien de Lemeny for the original patch and Alexander Hämmerle
for the test case in test-ui.c.
2025-10-31 13:54:59 +01:00
Jehan
a5fe4f1ca5 Issue #11613: crashing when freeing window handle (again).
This is a followup of commit 0ff960c45b which was the right fix, except
that we must make sure that gimp_widget_free_native_handle() is called
**before** chaining up with the widget's parent dispose().

Failing to do so, the first parent's dispose() was destroying the
associated GdkWindow, which made it impossible to call
gdk_wayland_window_unexport_handle() on it. And therefore we were still
getting handle callbacks possibly run after the window was destroyed, if
we were very fast enough to destroy a window immediately when it is
being shown.

I was still experiencing a crash when closing the Export file dialog
very fast with Esc while it was reappearing after canceling a plug-in's
export dialog.

This followup commit reorders the one case where we still had the crash
because of this order issue, and adds some docs comment to tell
developers how to use the freeing function.
2025-10-30 18:53:00 +01:00
Alx Sa
4812fddc5c widgets, actions: Allow multi-select in Document History
This patch enables multiple selections in
the GimpDocumentView widget and dockable.
It also updates the "documents-open" and
"documents-remove" actions to check if the
GimpContainerView has more than
one selection, and if so, tries to load/remove
all of those images. The action wording is
slightly edited to indicate multiple
images can now be opened/removed.
2025-10-29 14:40:19 +00:00
Jehan
9a36698915 Issue #15152: Export to bzip2, gzip, xz gives warnings.
We could have tweaked further the code to guess what is a meta file
procedure or not (what we have done until now) but I decided to be more
explicit and added gimp_file_procedure_[gs]et_meta() functions to
libgimp to tag a specific import/export procedure to implement a meta
format.

gimp_file_procedure_set_extensions() would still be used to list well
known formats using this meta format, for instance "hgt.zip" or
"xcf.xz,xcfxz" but the meta extension (simply "zip" or "xz"
respectively) would be used as such. No more "guessing" using the list
of extensions and assuming that at least one of them would have a dot
within.
2025-10-28 12:34:58 +01:00
Alx Sa
cb552d3dc0 widgets: Turn off default search in ComponentEditor
Resolves #9324
In GTK3, a default "Search" is enabled by default in GtkTreeView.
While in most places we override this with our own search feature,
it was not explicitly set for the GtkTreeView in the GimpComponentEditor
in the Channel dockable. So, it defaulted to TRUE and created an
unnecessary pop-up whenever you typed after clicking a channel.

This patch calls gtk_tree_view_set_enable_search () and turns off
this default feature.
2025-10-27 13:27:45 +00:00
Jehan
57f8e233f7 app: clean the controller manager off invalid controllers after…
… controllerrc config file deserialization.

This is the first part to handle #13787 and not a bad idea by itself
per-se, since we remove one way to crash GIMP by creating an invalid
controllerrc file.
2025-10-24 02:24:53 +02:00
Jehan
0358625b1c app: merge button should be insensitive on non-rasterized GimpRasterizable. 2025-10-15 21:07:55 +02:00