Commit graph

6046 commits

Author SHA1 Message Date
Jehan
1b3af8a89b Issue #9648: don't flush the image when selecting items.
This results in an infinite loop and there is no change done, so no reason to
flush anything. Mitch had a fix for this (probably the same, per the IRC
discussion), but I really wanted to just release GIMP 2.99.16. So Mitch, if you
read this, sorry for not waiting for you to push this one!
2023-07-04 22:10:40 +02:00
Alx Sa
8a53b7c219 widgets: Fix compiler warning in gimpcontainerview
Initialize "border" to 0 to remove a warning that
"'border' may be used uninitialized"
2023-06-26 14:12:42 +00:00
Niels De Graef
26f967e998 app: update relevant comments about Wayland hotspot 2023-06-25 22:21:37 +00:00
依云
edfded372d app: don't scale hotspot in Wayland
The hotspot coords are in the cairo surface's coords space, and the
cairo surface has half the size as the x2 pixbuf because of scale=2,
which makes the hotspot coords remain the same.

With regard to the referred code snippet in the comment[1], the coords
have been scaled in gdk_cursor_new_from_surface.

This fixes https://gitlab.gnome.org/GNOME/gimp/-/issues/9047.

[1]: https://gitlab.gnome.org/GNOME/gimp/-/merge_requests/545#note_1388777
2023-06-25 22:21:37 +00:00
Jehan
ff91a0ac3d Issue #9350: fix GimpMenu separator lines being randomly thick. 2023-06-25 19:04:37 +02:00
Alx Sa
ca3c709d56 core: Add color/pattern only fill options
Resolves issue with #8461.
This provides a conditional value for the fill options to only show
a color and pattern, rather than fore/background colors.
Currently only used for the text editor.
2023-06-24 19:42:58 +00:00
Alx Sa
ce6f7179ab core: Replace "Solid Colors" with "FG/BG Colors"
Replaces "Solid Colors" option in Fill Path with Foreground/Background
Colors options. This allows users to fill with either, rather than
having to switch the foreground color each time.
GIMP_CONTEXT_PROP_MASK_BACKGROUND was added to the fill and stroke
contexts to allow the background color to be recognized.
In places where Solid Color was used as a default, Foreground Color is
now used instead.
2023-06-22 18:46:14 +00:00
Jehan
b48ce94e6a app: replace g_action_map_lookup_action() by gimp_ui_manager_find_action().
With more recent logic, not all actions are inside the application's action map.
We need to look up actions in our GimpUIManager.
This fixes failing to find the actions with the "text-editor." prefix (in the
text tool editor's toolbar).
2023-06-21 22:17:09 +02:00
Alx Sa
bf1e125138 widgets: Fix RGB histogram pixel/count values
The RGB histogram shows three histograms overlaid on each other.
This multiples the pixel and count attributes by 3. To correct this,
the result of gimp_histogram_get_count () is divided by 3 for the
pixel and count displays.
2023-06-15 19:24:49 -04:00
Jehan
7f83b27c3c Issue #5601: help icon in the action search.
Additionally to the F1 shortcut, a secondary icon is now shown in the
action search entry. It works exactly the same as F1, i.e. that by
default, it shows the action search manual page (when nothing is
selected), or the manual page for the specific action currently selected
otherwise.
2023-06-11 23:56:55 +02:00
Jehan
a13289672a Issue #5601: F1 in action search to load the action help page.
The default F1 result (if no action is selected) is to show the generic
help page for the action search. If an action is selected, it will show
the specific help for this action.
2023-06-11 23:02:15 +02:00
Jehan
30c5e20ce7 Revert "app: fix bailout condition in gimp_menu_model_handles_subpath()"
This reverts commit 3a35974e3a.
This is not the right fix for the issue (which was happening on the
Quick Mask menu specifically) because root menu models are set with a
NULL path. So forbidding root menu models to handle new subpath means
preventing plug-ins to register new top-level menus.

The correct fix for the issue on the quick mask menu will happen in a
coming commit.
See issue #9586.
2023-06-09 17:15:38 +02:00
Alx Sa
e9fdd321cd widgets: Check if editor color is set before...
...trying to get the index. Resolve #9568.
The color picker tool calls this twice if you're in Add to Palette mode,
and the editor's color may not be set the first time it's run.
This adds a check to ensure the color is set before trying to retrieve
it from the palette to prevent a CRITICAL.
2023-06-07 12:19:56 +00: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
Jehan
0233531020 app: make sure the private variable is a valid object if set.
Though this doesn't make a problem in normal use (AFAICS), we have crash
in a unit test in CI because the action_factory object was apparently
invalid when calling gimp_action_factory_delete_group().
2023-06-06 22:30:03 +02:00
Michael Natterer
018d9fb615 app: remove draw() from GimpComboTagEntry
We don't need to maanually draw the arrow. Fixes #9498
2023-06-06 16:32:15 +02:00
Alx Sa
aa2a565d60 widgets: Load simulation intent/bpc in preferences
Resolves #9560.
The Simulation Intent and BPC widgets in the Preference Dialogue needed
to be connected to their properties with `gimp_prop_*` when created to
show the saved default image values.
2023-06-05 19:12:18 +00:00
Michael Natterer
26dce72d2c Remove autotools 2023-05-27 00:03:52 +02:00
Michael Natterer
0532cf31b9 app: move action/widget sensitivity logic from GimpMenu to GimpAction
This way we handle all kinds of proxies (particularly buttons).

Also add a small hack that prevents extended multiline tooltips of
GimpButton from being overwritten by gimp_action_update_proxy_tooltip().
2023-05-26 15:31:54 +02:00
Carlos Garnacho
467fa6c5e7 app: Avoid double gtk_drag_finish() call on GimpToolbox
According to the ::drag-drop GTK documentation: "The call to gtk_drag_finish()
can be done either directly or in a “drag-data-received” handler which gets
triggered by calling gtk_drag_get_data()"

The GimpToolbox's vbox handling DnD chooses however to do both, the drag-drop
handler is calling gtk_drag_get_data() and invariably calling gtk_drag_finish()
to hint that the DnD operation is ending. While this worked in practice in X11,
This is a harder either/or in Wayland resulting in the transfer being cancelled.

In order to behave better wrt the documentation, and make DnD into the toolbox
work on both X11 and Wayland, avoid the first gtk_drag_finish() if the data is
being requested, and only bail out if no offered target matches what the widget
can handle. The handling done indirectly through gimp_toolbox_dnd_init() and
gimp_dnd_*_dest_add() will take care of finalizing the DnD data transfers
successfully.

Closes: https://gitlab.gnome.org/GNOME/gimp/-/issues/7373
2023-05-26 10:24:05 +00:00
Michael Natterer
2e219bccf2 app: one more fix like in the last commit in GimpLayerTreeView 2023-05-26 00:09:01 +02:00
Michael Natterer
6fcf25b3de app: can't rely on a context being set on a GimpItemTreeView
In GimpLayerTreeView, set the action states using GimpActionGroup
instead of using gimp->app directly to look up the actions ( after
trying to get the Gimp from a NULL GimpContext).

Fixes #9433
2023-05-25 23:52:40 +02:00
Michael Natterer
c9700680fe app: Issue #9490: limit the width of the palette preview
to GIMP_VIEWABLE_MAX_PREVIEW_SIZE in gimppaletteeditor.c
2023-05-25 19:37:41 +02:00
Michael Natterer
afa2a5ca96 app: fix typo in gimphelp-ids.h, spotted by Wormnest 2023-05-25 17:30:50 +02:00
Michael Natterer
41894be71a app: make the rotation import dialog more similar to profile import
and some general cleanup in both dialogs.
2023-05-25 16:56:07 +02:00
Michael Natterer
e9e09ceec4 app: vertically center the top-left icon in GimpViewableDialog 2023-05-24 23:37:43 +02:00
Michael Natterer
a12339c890 app: increase preview size in gimpviewablebox.c
The height of the boxes was never determined by the preview but by the
label+entry, causing vertical padding around the preview. Now the
preview fills the area in more cases, at the cost of a few less
horizontal pixels for the entry.
2023-05-24 15:20:03 +02:00
Michael Natterer
82e4bf5792 app: fix "active" state management in GimpToggleAction
gimp_toggle_action_real_toggle(): set "active" before emitting
"change-state" so we don't infinitely try to set the state in case of
a recursion.

gimp_toggle_action_toggle(): add notify("active") because it wasn't
done anywhere.

Fixes #9392
2023-05-24 14:09:50 +02:00
Michael Natterer
3a35974e3a app: fix bailout condition in gimp_menu_model_handles_subpath()
Fixes plug-in menus being added to all a GimpUIManager's menus,
even if they didn't match the menu_path
2023-05-24 13:43:35 +02:00
Michael Natterer
1d393fb926 app: don't try to break up a NULL menu_path in gimp_action_set_menu_path() 2023-05-24 13:41:37 +02:00
Niels De Graef
89c359ce47 Remove GimpUint8Array in favor of GBytes
GLib has a specific type for byte arrays: `GBytes` (and it's underlying
GType `G_TYPE_BYTES`).

By using this type, we can avoid having a `GimpUint8Array` which is a
bit cumbersome to use for both the C API, as well as bindings. By using
`GBytes`, we allow other languages to pass on byte arrays as they are
used to, while the bindings will make sure to do the right thing.

In the end, it makes the API a little bit simpler for everyone, and
reduces confusion for people who are used to working with byte arrays
in other C/GLib based code (and not having 2 different types to denote
the same thing).

Related: https://gitlab.gnome.org/GNOME/gimp/-/issues/5919
2023-05-23 23:37:50 +02:00
Michael Natterer
9e79bb78a1 app: update the dialog and dockbook ui managers in gimp_dockbook_show_menu() 2023-05-23 16:31:57 +02:00
Michael Natterer
514042d57d app: don't leak the GSList connecting GimpRadioActions 2023-05-23 01:42:40 +02:00
Michael Natterer
4879589be6 app: use g_list_delete_link() not _remove_link() in GimpUIManager
so the list element actually gets freed.
2023-05-23 01:42:40 +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
Michael Natterer
3d5ea2eeb2 app: remove weak ref to action_factory in GimpMenuFactory 2023-05-22 14:11:48 +02:00
Michael Natterer
91fceebb1d app: improve readability in GimpMenuFactory 2023-05-22 14:11:06 +02:00
Michael Natterer
8f42731074 app: don't leave dangling GimpUIManager weak pointers around
in gimpmenumodel.c and gimpmenushell.c
2023-05-22 03:39:52 +02:00
Michael Natterer
bf15c9d128 app: also remove (not only add) the weak pointer in
gimp_action_impl_activate(), it's only there to guard one function
call
2023-05-22 03:39:52 +02:00
Michael Natterer
1d069d05b4 app: fix dangling weak pointers to GimpEditor->priv->ui_manager 2023-05-22 03:39:52 +02:00
Michael Natterer
ef0eb29e55 app: readability improvement in GimpActionFactory 2023-05-22 03:39:52 +02:00
Michael Natterer
ea61efe679 app: remove gtk_container_set_focus_chain(), it's deprecated and
our use cases were overengineering anyway.
2023-05-21 18:56:32 +02:00
Simon Budig
8cf388c17f gimpcellrendererdashes: fix type of a variable 2023-05-20 23:59:29 +02:00
Simon Budig
a100bb7fcf gimptagpopup: port to GtkStateFlags 2023-05-20 23:32:18 +02:00
Alx Sa
0790d6c9d5 widgets: Add Grayscale color picking mode 2023-05-14 10:19:54 +00:00
Jehan
d1118a5e15 app: missing break statement. 2023-05-11 14:19:37 +02:00
Jehan
f9993b85b6 app: use G_DECLARE_INTERFACE() to declare GimpAction interface.
Less boiler plate code so less reasons to mess up.
For this to be feasible, I also had to define a cleanup function for
GimpObject.
2023-05-11 12:46:57 +02: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
Shubham
de5c805cbb app: Modify stroke selection dialog
Changed stroke selection dialog to use GtkStackSwitcher instead of radio
buttons. Make options hidden under "Advanced options" visible by
default.
2023-04-25 12:59:35 +00:00