Commit Graph

24544 Commits

Author SHA1 Message Date
Joachim Priesner 35deb1eb30 dialogs: Don't escape underscores in Welcome Dialog recent files list
It seems unnecessary – at least on my system, files with underscores in
their names are shown with two underscores in the recent files list.
This patch fixes that.
2024-06-28 20:50:21 +00:00
Alx Sa 87eadbf5d1 dialogs: Fix theme selection on reset
The Preference settings for themes and icon themes
are not directly connected to the property due to
the possibility of custom themes. Instead, we create
GtkListBoxes and load all the theme values. As a result,
when the preferences are reset, the row selection is not
updated.

This patch adds signals to the config object that update
the listbox selections when the Reset button is clicked.
The handler IDs are stored in the dialogue so that we
can remove them when the dialogue is closed.
2024-06-27 14:14:15 +00:00
Jacob Boerema 0c3bf56d83 app: fix help id for layer-lock-visibility is not set 2024-06-26 15:16:45 -04:00
Jacob Boerema 1e0be3d063 app: fix CI build failure core-enums.c is generated from core-enums.h
I only updated the mask strings to plural in core-enums.c, overlooking
that it is generated from core-enums.h.
So, update the same strings there after "desc".
2024-06-24 19:25:25 +00:00
Jacob Boerema 51b444b846 app, actions: be consistent and use plural for layer moving ...
commands that work on multiple layers:
Raise Layer -> Raise Layers
Layer to Top -> Layers to Top
Lower Layer -> Lower Layers
Layer to Bottom -> Layers to Bottom
Also update the hint strings.
2024-06-23 19:05:01 -04:00
Jacob Boerema 5f41b4460c app, actions: be consistent and call Duplicate Layer -> Duplicate Layers
Since it works on multiple selected layers use the plural like we
also do in other similar cases.
2024-06-23 14:09:06 -04:00
Jacob Boerema 6dbf144f6b app: add missing help ids for the text tool 2024-06-22 16:47:44 -04:00
Jacob Boerema 9c432f6505 app, actions: use consistent naming for Text to Path
In the main menu and layers dialog context menu it is called
`Text to Path`, let's use that same name in the text tool actions
instead of `Path from Text`.
2024-06-22 16:11:57 -04:00
Jacob Boerema a3ecca3487 app: fix some layer mask strings
Not all layer mask menu commands and help texts were updated to reflect
that they work on multiple masks.
Updates
- Apply Layer Mask -> Apply Layer Masks
- Delete Layer Mask -> Delete Layer Masks
- Their text hints and the one for Disable Layer Masks

Updates the undo strings, even though these don't seem to be used
anymore? Looks like undo always picks the menu command now.
2024-06-22 14:20:02 -04:00
Alx Sa fcdddad2a7 core: Include NDE filters when opening as layers
Adds code to copy any NDE filters when
importing an .xcf file as layers in an
existing project.
This also requires removing the check
for the layer being attached to an image,
which historically made sense because
filter effects were immediately merged
down. Now that filters can exist separately
the check is no longer required.
2024-06-20 19:06:57 +00:00
Alx Sa 134100fb8a app/tools: Allow locked layers to be used as sources
GimpSourceTools like Clone and Heal use GimpPaintTool's
code for determining if they can work on a pixel-locked
layer. This means that they can not set a locked layer as a
source even though that would not affect the locked layer's
pixels.
This patch adds an additional condition to GimpPaintTool, to
allow operations if the tool is a GimpSourceTool AND only
Ctrl is held down. This allows the layer to be set as a source
while preventing it from being drawn on.
2024-06-20 13:13:47 +00:00
Jacob Boerema d190c37a2c app: add missing help-id for layer effects
Note that this isn't enough for F1 to work, but that is a separate
issue.
I think that for now one help-id for all the layer effects is enough,
until we get a more final UI.
2024-06-19 13:42:49 -04:00
Alx Sa dc0449b05e widgets: Fix label background on Curves tool
Resolves #11702
In 2.10, the x/y label background on the Curves tool used
GtkStateType enums to get the widget's background color.
These enums were depreciated in GTK3, and during the
port the gdk_cairo_set_source_rgba() command was left
out. This resulted in the current line color being used instead,
making it hard to read the label in some instances.

This patch restores the Cairo color update command, using
the gridline color as an equivalent to the background color
from 2.10.
2024-06-17 13:05:38 +00:00
Alx Sa 9256a15363 widgets: Prevent image name from affecting the dialogue width
Resolves #7588
After the port to GTK3, the Filter dialogue's width started
to be affected the length of the image name. If the name
was very long, the filter dialogue would expand to fit it.

This patch encloses the image title label in a GtkScrolledWindow
with polices of EXTERNAL width and NEVER height. This ensures
there will not be a scrollbar, and the label will not influence the
width of the dialogue. A tooltip was added in case the user wants
to hover to see the full name.
2024-06-16 16:12:16 +00:00
cheesequake fb4cd9aedc core: Fix drawable filter duplication
Resolves #11690
While exporting, the image is duplicated, in turn,
filters are also duplicated. This patch fixes the
duplication by also copying the parent
GimpFilter's properties.
2024-06-15 13:58:33 +00:00
Alx Sa 0be5db0b77 widgets: Allow deleting inactive filters
Resolves #11687
Previously gimp_drawable_has_filters () was used to check
if a drawable had filters before deleting them. However,
this function actually only checks if there's an active filter -
if filters are attached but set to invisible, this returns false.
This mean that you could not delete filters if they were
invisible.
This patch switches to using gimp_container_have () instead
as it checks if the filter is in the drawable's filter stack.
2024-06-12 13:44:21 +00:00
Alx Sa 2260e8bbe8 core: Fix palette error handling
Resolves #11679
The loading code for ASE, ACB, and ACO palettes
set any errors with g_prefix_error (). However, the
error object is NULL at that point for those palettes.
Therefore, a NULL error object is returned to
palette_import_make_palette () which then tries to
access its attributes. This resulted in a crash.
This patch fixes the issue by using g_set_error () for
those three formats instead.
2024-06-11 12:43:39 +00:00
Alx Sa ceb9747e23 libgimpwidgets: New API to check system animation status
Ports the animation code started in e13cc635
to an independent gimp_widget_animation_enabled()
function. This allows plug-in authors to
also conditionally turn off animations if
the user's system settings say to do so.

The function is applied to the About
Dialogue animation as well as two Easter
Egg animations:
* Wilber's eyes blinking after 23 minutes
on an empty canvas
* Wilber's eyes following the mouse after
a certain sequence of tools is clicked
2024-06-10 13:47:25 +00:00
Cheesequake 22c59503b5 app/tools: Fix Filter GUI when expanding vertically,
Resolves #11656
Since e4b1f37e, Filter Tool widgets above the Blend
Mode frame do not expand vertically when the dialogue
is resized.
This especially impacts GeglGraph, as you can no longer
increase the text area to see more graph code.
This patch resolves the issue by adding a GtkExpander
to the GUI so that it allows the inner area to resize
vertically.
2024-06-09 15:02:48 +00:00
Jehan cca637135b app, libgimp, pdb, plug-ins: fix failure to set plug-in as transient.
While setting a plug-in as transient usually worked, it was failing in
cases the plug-in's progress bar was not initialized (i.e. if
progress_init() was not called before setting the dialog transient).

This commit stores the calling display, core side too (libgimp side, the
plug-in already had the calling display ID information), and we use this
when a GimpProgress has not been created yet.
2024-06-08 21:54:21 +02:00
Jehan 39ea23ed52 app, libgimp, plug-ins: improve GimpVectorLoadProcedure workflow.
I'm moving the logic of choosing a correct default for width/height by adding an
"extract dimensions" callback in the procedure. The logic is that every vector
format out there should likely have metadata either for pixel dimensions or
physical dimensions, or at the very least for no-unit dimensions (ratio only).

Vector load procedures will have to implement only the extraction of such data
in a callback called by GIMP but not how to act upon them, so that we have a
common logic for all vector images.

I am implementing this callback first in the SVG plug-in, moving all the code
to extract dimensions (and improving it) in this callback.

Also I am deleting "file-svg-load-thumb" procedure. I could simply reimplement
it using the same code, but it looks to me like this is very useless for vector
formats to have a specific thumbnail procedure (unless it were to use very
specific metadata for faster result). This is vector data, just ask it directly
at the proper bounding box size.
2024-06-08 18:58:06 +02:00
Bruno fb5474ae4d
Issue #4053: Add "*default_bin" support on Windows and enable it
Almost every program have a non-versioned .exe on Windows. MSYS2 does this too.
2024-06-05 11:51:14 -03:00
Alx Sa 29bb5b3608 dialogs: Respect Windows Show Animation option
Building on d25d8778, this patch checks the Window
"Show Animation" option and uses it to determine
if the About Dialogue animations should be active.
2024-06-05 12:49:20 +00:00
Alx Sa d25d877899 dialogs: Respect MacOS Reduced Motion option
e13cc635 uses gtk-enable-animation to determine whether
the more dynamic motion animation should be used for the
About Dialog credits. However, gtk-enable-animation does
not take into account the MacOS preferences.
This patch adds a check for this value using NSWorkspace's
accessibilityDisplayShouldReduceMotion boolean. Since the
value is TRUE on MacOS if the user wants animations turned
off, the boolean is inverted.
2024-06-04 16:46:01 +00:00
Jehan 349191b8ab Issue #10406: get rid completely of the animated authors list when…
… "Reduce Animation" is checked.

This is an alternate version for commit e13cc63525.
Instead of proposing a simpler animation (fade-in/out instead of wave
animation), let's just completely get rid of the whole thing when
someone enabled an accessibility option saying that long animated
contents are basically disturbing to them, which is how I understand
additional issue #11647.

In fact, reading Mozilla docs about such option:
https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion#user_preferences
… they even mention vestibular motion disorders, which seem pretty
serious and would make our About dialog quite uncomfortable.

I tried to experiment with just showing a part of the authors list, then
ending on a link text to the Credits tab after a few second, but it
didn't feel that interesting nor useful. Anyway the whole animated
widget is redundant with said Credits tab, and therefore more on the
"fancy" side of things than on the useful one. Hence let's make simple:
if someone configure their OS saying that animated elements are a
discomfort, let's just get rid of useless ones! Done!
2024-06-04 17:25:37 +02:00
Alx Sa 5bd293340f dialogs: Redesign Welcome Dialogue options layout
Currently, the additional customization
options are laid out horizontally.
Depending on the translation, this might
cause the dialogue window to become
much wider.

This patch converts those options to
GtkSwitch and puts them in a column.
prefs_switch_add () was modified to also
return the GtkSwitch object, so we could
bind its active property for the icon
override property.
2024-06-04 01:57:51 +00:00
Alx Sa e13cc63525 dialogs: Reduce About Dialog animations if requested
The About Dialog shows authors names using motion effects.
Since this is done with Cairo, it does not respect the
"gtk-enable-animations" setting or OSX's "Reduced Motion"
option.

This patch retrieves the "gtk-enable-animations" value.
If it is set to false, then the simple fade-in effect is used
for author names in place of the motion effects.
2024-06-02 02:05:24 +00:00
Alx Sa 1426701143 scriptfu, tools: Allow off-canvas guides in more places
Resolves #10609

Continuing from 1759174d, this patch
removes the on-canvas restrictions for
guides from the New Guide dialogue and
the Measure Tool's guide creation feature.
2024-05-31 12:03:44 +00:00
lillolollo a21b18bbec app/widgets: Fix deprecated code in GimpToolBox
Replaces gtk_widget_show () with gtk_widget_set_visible ()
and replaces margin-left/margin-right with margin-start and
margin-end properties.
2024-05-29 13:43:17 +00:00
Alx Sa 83141ba62d actions, plug-ins: Minor clean-up and warning fix
*In file-pnm, format_name is no longer
used due to changes in exporting
functions. This was creating a warning
about an unused variable.

*In 519f301c, an attempt to add a
short-key for MacOS Settings was left in.
It did not work because "comma" should
be spelled out rather than using ",". This
patch removes the accelerator.
2024-05-28 16:16:29 +00:00
Alx Sa 1759174d9d pdb: Allow off-canvas guides with Script-fu
Commit 015f4946 allowed guides to be
placed off-canvas in the GUI. However,
the restrictions were not removed from
the Script-fu implementation.
This patch fixes the Script-fu parameters
and conditional checks to match the
GUI implementation.
2024-05-27 15:42:10 +00:00
Alx Sa c8049f2ed5 app/tools: Fix editing custom NDE filters
Resolves #11211

The code that moves the temporary "editing" filter
when modifying an NDE filter was not being run
on custom GIMP filters like Curves. This meant that
editing Curves would always place the temporary
"editing" filter at the top of the filter stack, giving
an incorrect preview of what the changes would do.

This patch moves the reorder code from being in
gimp_filter_tool_create_filter () to being in
gimp_filter_tool_set_config (), which always runs
when any filter is created.

This change also fixes a separate issue where the
filter mask would not be copied over for Curves.
2024-05-26 12:37:47 +00:00
Alx Sa 742ec5689d widgets: Block removing tool-based NDE filters
Currently, messing with filters that are
being managed by tools (like Warp or
Gradient) causes crashes. For now, we'll
prevent removing NDE filters which are
tool-based, and revist after 3.0 is released.
2024-05-22 19:59:40 +00:00
Cheesequake e4b1f37e4e tools: Improve Filter Tool UI for Blending Options...
...by having it stay in the same position when expanded
and closed rather than moving to the bottom afterwards.
2024-05-21 19:15:43 +00:00
Alx Sa acf2756e4a widgets: Update image display on imageview select
In the Image Dockable, clicking on an image will update the layers and 
navigation views. However, the actual canvas image will not update
unless you double-click the item.
This adds a select_item function so the canvas is updated on a single 
click as well.
2024-05-21 17:31:05 +00:00
Idriss Fekir 4a174206af text: Fix loading XCFs with XLFD fonts 2024-05-21 17:19:33 +01:00
Alx Sa 5f38c37b98 tools, core: Don't stroke/fill paths on pixel locked layers
Resolves #11568

Currently, the Stroke/Fill Paths options on
the Path tool disregard the Pixel Locked
flag for layers. This patch resolves this as
follows:

* On the Paths tool, the Stroke/Fill button
does not pull up a dialogue if a single
layer is selected and it's pixel locked.
* If multiple layers are selected, only those
that are not pixel-locked have the Fill/Stroke
applied to them.

In both cases, a warning is also displayed.
2024-05-21 12:57:55 +00:00
Alx Sa 519f301c65 actions: Use Settings rather than Preferences on MacOS
Per Lukas Oberhuber, Preferences should be called Settings
on MacOS, as it was before the GTK3 menu port.
2024-05-19 02:12:44 +00:00
Alx Sa 47dde0580a libgimpwidgets: Fix formatting from 8adcc0cd
Some minor code style issues remained 
that I missed in 8adcc0cd.
After further reflection, I also converted
the code to be a private/internal function.
gimp_prop_check_button_new () should
cover the majority of GtkCheckButtons,
and the function is currently only used
to fix the size of those widgets. We could
revisit it as a public function in the
future if more use cases are found.
2024-05-19 02:10:23 +00:00
Mark Sweeney 8adcc0cdcb libgimpwidgets: Fix GUI twitching due to bold label sizing
Resolves #10026

Selecting a checkbutton makes the label bold. This increases the
width of its label, and if it's the longest item in a box, this
causes minor "twitching" and resizing of the dialogue.
This patch calculates the size of the label when bold and then
requests the label width be set accordingly to resolve the issue.
2024-05-18 21:33:51 +00:00
Alx Sa e51a128acd text: Update font property to GimpFront
Resolves #11550
The import code for X Logical Font Description fontnames
was not updated to use GimpFont instead of strings.
This caused crashes when we tried to set GimpFont properties
with gchars. This patch updates the code to create a new
GimpFont object from the font name string.
Additionally, it increases the read length by one, as we were losing
the last character of each field as it was split on the "-" character.
2024-05-17 14:47:29 +00:00
Oleg Kapitonov 7ccfad1716 app: Fix localization language in Windows 2024-05-16 16:42:47 +00:00
Alx Sa aa30b40fee core, xcf: Prevent copying tool-based NDE filters
For now, we can't keep certain GEGL ops
like Gradient as NDE filters, since they are
connected to tools. If the layer is copied
or saved as an .XCF while the tool is still
active, it attempts to save it and causes a
crash.
This patch adds a check to make sure the
copied filter has been commited and that
it's not a tool-based NDE filter before
being copied. It also adds some NULL
checks where gimp_drawable_filter_duplicate
is used to prevent NULL from being
added to the filter stack.
2024-05-14 04:05:06 +00:00
Simon Budig 1b142eb604 app: don't leak the GeglColor in GimpPaletteEntries. 2024-05-06 00:35:51 +02:00
Simon Budig 32336a2350 app: avoid uninitialized memory for color names 2024-05-06 00:35:51 +02:00
Simon Budig 6877a3cd43 app: use the logical rectangle for positioning the splash text.
This avoids jiggeling baselines for texts with/without descenders.
2024-05-05 16:55:41 +02:00
Alx Sa 3260299f4a libgimp, plug-ins: Remove n_drawables parameter from gimp_file_save () 2024-05-03 15:22:39 +00:00
Alx Sa 443947c6aa plug-ins: Remove n_drawables parameter
Port all plug-ins to retrieve the layers
directly from the image rather than
having them passed in. This resolves some
issues with introspection and sets the
foundation for future API work.
2024-05-03 15:22:39 +00:00
Alx Sa 0b171e9bae core: Copy NDE filters in layer group children
Resolves #10765
This allows us to retain any filters that a
layer group's children might have when
copied or exported. They were previously
lost when the group layer was duplicated.
Note that an OR condition was added to
GimpDrawableFilter creation, to allow
one to be created if the layer was 
attached to a parent layer rather than the
image.
2024-04-29 20:51:36 +00:00
Cheesequake 10cc33b28e widgets: Deleting effects now deletes the selected effect instead of the topmost effect
Resolves #11404
Since the GimpContainer selected function automatically updates which filter is the
"active" selected filter, we can remove the code that sets it to NULL after a filter
is deleted. This fixes a bug where the top effect was always deleted in subsequent
attempts rather than the highlighted one.
A now unnecessary gimp_drawable_remove_last_filter () function was also removed.
2024-04-29 11:34:59 +00:00