Commit graph

6553 commits

Author SHA1 Message Date
Gabriele Barbero
8af15d525a tools: fix font size jump when using shortcuts
Previously, when using shortcuts to increase or decrease the font size of
the selected text, the size would jump to 0. This behavior occurred because,
if the text did not yet have a font tag, the initial font size was evaluated as 0.

This commit ensures that the text tool's default font size is used when
no font tag is present. This prevents the font size from jumping to 0 the
first time the shortcuts are used.
2026-04-02 00:24:26 +02:00
Bruno Lopes
8aeb5d6f53 app, libgimpwidgets: More strcpy_s on Windows 2026-03-31 21:44:51 -03:00
Bruno Lopes
7ce3ed457e app, libgimp*, modules: More type <> casting fixes 2026-03-31 16:27:25 -03:00
Bruno Lopes
77682518b9 app, plug-ins: Use strcpy_s on Windows to fix CRT_INSECURE_DEPRECATE warnings 2026-03-30 22:32:01 -03:00
Bruno Lopes
2066844166 app, lib*, plug-ins: Use sscanf_s on Windows to fix CRT_INSECURE_DEPRECATE warns 2026-03-30 22:31:57 -03:00
Bruno Lopes
74efec2b76 app: Fix mixed declaration and code of infoCount 2026-03-29 21:07:00 -03:00
Bruno Lopes
e6eeaba58e app: Explicity cast third argument of gimp_enum_radio_box_add to gint
To fix a Apple Clang warning.

gint is what the function on app/widgets/gimpwidgets-utils.h expects.
2026-03-29 21:07:00 -03:00
Bruno Lopes
c69549aff5 app, libgimpwidgets: Fix some declarations mixed with code 2026-03-29 17:19:42 -03:00
Bruno Lopes
af1dac3c51 app, plug-ins: Comment unused stuff on macOS
This fixes Apple Clang warnings about:

- idx
- count_large
- count_nan
- n
- iteration
- original_id
- real_pos
2026-03-29 17:19:42 -03:00
Bruno Lopes
f4f1baf5ef app, libgimp, libgimpbase, libgimpwidgets, plug-ins: Add macro to unused code
This fixes Apple Clang warnings about:

- xdiff
- ydiff
- gimp_ui_get_foreign_window
- locale_parser_parse
- use_app_menu
- gimp_unique_dbus*
- transient_set
- gimp_get_foreign_window
- support
2026-03-29 17:19:42 -03:00
Alx Sa
8eae22306a widgets: Block signals when changing visible filters
eec9d512 did not block calls to
gimp_drawable_filters_editor_visible_all_toggled () when
updating the "All Visible" toggle button in
gimp_drawable_filters_editor_set_sensitive (). This resulted
in unexpected visibility changes in some combinations of
filters being turned on and off.
This patch adds the blocking calls around the call to
gtk_toggle_button_set_active () to keep this consistent.
2026-03-29 12:36:39 +00:00
Bruno Lopes
2381ec5c7c app: Convert history_duration to gdouble for unambiguous division 2026-03-28 19:51:25 -03:00
Bruno Lopes
3835167be6 app: Convert some vars to guint so make bitwise operation unambiguous
Silences a GNU Clang warning.
2026-03-28 19:51:25 -03:00
Bruno Lopes
0834c7c954 app, plug-ins: Use GINT_TO_POINTER / GPOINTER_TO_INT for portability
Doing traditional explicit conversion (casting) causes warnings.
See: https://docs.gtk.org/glib/conversion-macros.html
2026-03-28 19:51:25 -03:00
Aditya Tiwari
48e194532e app: show "Tab" accelerator label for windows-hide-docks
Tab was intentionally removed from the action entry to avoid overriding
its standard accessibility usage across the software, leaving the menu
item and shortcut editor showing no shortcut. This adds a cosmetic hint
in gimp_action_get_display_accels() to show 'Tab' without registering a
real accelerator.
2026-03-27 18:06:17 +01:00
Alx Sa
ca5438c6da widgets: Prevent deleting temporary filters
Resolves #12791 (again)
After cleaning up and separating the filter pop-up code
from GimpItemTreeView to GimpDrawableTreeView-Filters,
we accidentally lost the checks that prevent deleting filters
that have not yet been applied (thus causing a crash).
This patch restores the checks for the filter to not be temporary
before you can delete it.
2026-03-26 15:26:10 +00:00
Bruno Lopes
1d4b1e098b app: Add support to installing gimp-help on GIMP*_DIRECTORY
See: https://gitlab.gnome.org/GNOME/gimp-help/-/issues/553

This is needed for some read-only packages.
2026-03-22 22:20:18 -03:00
Jehan
b822a56d10 app: localize "Pressure Curve" instead of breaking into 2 words.
Much easier to localize, and it's actually our only case for input
device axis curve so far. Let's simplify.
2026-03-18 16:34:55 +01:00
Alx Sa
eec9d51236 widgets: Sync filter visibility with toggle button
Resolves #16002

Since the "Toggle All Filter Visibility" button's state
is only updated when the NDE filter popover first
appears, it could get out of sync with the current state
of the filter stack.
(For instance, if you open the popover and turn all the
filters' visibility off, then clicked the button, it would try
to turn them off again)

This patch adds a check for gimp_drawable_has_visible_filters ()
whenever the filter changes, and updates the toggle button
with that value.

This patch also condenses the filter visibility check to use
the existing function rather than its own custom code.
2026-03-18 01:11:18 +00:00
Alx Sa
ff647fccb0 path, core: Create gimp_vector_layer_set ()
Currently to change vector layer properties,
you need to grab the VectorLayerOptions
and then grab its FillOptions or the
StrokeOptions to make changes.
To make this process more self-contained,
this patch creates a gimp_vector_layer_set ()
function that operates in the same manner
as gimp_text_layer_set (). 
This patch adds properties for Fill -
Stroke properties will be added in a
follow-up commit.
This also adds
automatic tracking for Undoing/Redoing
vector property settings.
A demonstration of its use in DnD colors
and patterns onto the layer dock is
included.
2026-03-17 19:32:51 +00:00
Alx Sa
4cff7cc2b5 widgets: Allow DnD pattern for vector layers in dock
Building on d8d8e7a0, we add a gimp_layer_tree_drop_viewables ()
function to handle dragging and dropping a pattern onto a Vector
layer in the layer dock.
2026-03-14 03:52:46 +00:00
Alx Sa
d8d8e7a0e8 widgets: Allow DnD for vector layers in dock
916cf84e handles dragging and dropping colors
onto vector layers on the canvas. However, we did
not handle what happens if you drag and drop onto
the layer dock.
This patch adds logic to gimp_layer_tree_view_drop_color ()
so that it also updates the vector layer fill, instead of
treating the vector layer like a raster layer and filling the
whole layer with the color.
2026-03-14 02:13:54 +00:00
Jacob Boerema
04ff553746 app: improve clipboard shutdown on Windows
On Windows gtk_clipboard_store ignores the number of items we have
set to be stored, instead storing all. Since this can be a long list,
shutting down GIMP on Windows can take considerable time when you
have a larger selection on the clipboard.

So we manually stop handling every target larger than 1 (png) and even
stop handling png after the first time, since it often gets called
multiple times for png.
2026-03-13 09:05:55 -04:00
balooii balooii
e0d70d4dc9 Issue #12357: Fix navigation popup positioning and dragging on Wayland 2026-03-12 22:36:25 +00:00
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