Commit graph

6456 commits

Author SHA1 Message Date
lillolollo
52ffd75330 Issue #14689: Add translation context for Extensions
Extensions is used both for file extensions and for
GIMP's planned Extension format. This patch adds translation
context so translators know which one we're referring to.
2025-08-16 19:54:31 +00:00
Gabriele Barbero
b65bd2bd4c widgets: ignore GDK_MOD2_MASK when...
...remapping shortcuts with GDK_META_MASK

On macOS, the Command key is GDK_META_MASK. But when setting a shortcut,
GDK_MOD2_MASK is added too. This extra modifier makes it hard to check
if the shortcut is already in use. GIMP sees it as a different combination,
even if it's really the same. Now, when GDK_META_MASK is used, we remove
GDK_MOD2_MASK. This helps GIMP detect existing shortcuts correctly
and avoid duplicates.
2025-08-13 03:22:57 +00:00
Michael Natterer
9f789e68d5 app, tools, plug-ins: more #pragma once, and formatting cleanup where
I noticed the need.
2025-08-13 01:48:40 +02:00
Michael Natterer
124993d770 app: GimpRow: don't ref the viewable, use a weak ref instead. 2025-08-12 15:45:16 +02:00
Michael Natterer
f96a7192cd app: add GimpRowFilter and GimpRowDrawableFilter and port the filters
popover to GimpContainerListView.
2025-08-12 11:58:29 +02:00
Michael Natterer
2d57b1764d app: GimpRowSettings: forgot to remove some junk. 2025-08-11 16:39:30 +02:00
Michael Natterer
6651d4eb7f app: GimpRow's icon always exists, no need for if (priv->icon). 2025-08-11 16:23:54 +02:00
Michael Natterer
7fad4ad323 app: remove some #if 0'ed junk from GimpContainerListView, but leave
some there as a reminder.
2025-08-11 14:47:18 +02:00
Michael Natterer
9e2b378414 app: remove unused member from struct GimpContainerIconView 2025-08-11 14:41:23 +02:00
Michael Natterer
92e68453df app: set the container last in all GimpContainerView constructors, to
avoid traversing the just-filled view when "context" or "view-size"
changes.
2025-08-11 14:38:02 +02:00
Michael Natterer
c114e96096 app: gimp_container_view_set_container(): standardize a g_return_if_fail() 2025-08-11 14:37:25 +02:00
Michael Natterer
b4e27fbf83 app: create GimpRow with the view size of its GimpContainerView 2025-08-11 12:13:58 +02:00
Michael Natterer
33dfccde51 app: add GimpRowSeparator and GimpRowSettings and port
GimpSettingsEditor to GimpContainerListView.

The separator currently doesn't draw anything, maybe it needs some
CSS.
2025-08-11 12:07:11 +02:00
Michael Natterer
2f87f8e51e app: GimpRowDeviceInfo: add missing dot in comment 2025-08-11 12:06:00 +02:00
Michael Natterer
35383741f1 app: GimpContainerListView: preserve the selected items across
GimpContainer::reorder().
2025-08-09 12:42:33 +02:00
Michael Natterer
e9b2b1ad7b app: add "gint old_index" argument to GimpContainer::reorder() 2025-08-08 17:02:32 +02:00
Michael Natterer
007e8e6615 app: G_DECLARE_DERIVABLE_TYPE(GimpContainerListView) 2025-08-08 15:56:36 +02:00
Michael Natterer
d65d55d64a app: add dummy API gimp_container_list_view_set_search_entry() and
use it in GimpContainerPopup. Fixes #14613 but only the crash, the
feature is missing.
2025-08-08 15:48:29 +02:00
Michael Natterer
7f70656c05 app: GimpRow: guard against the row being destroyed during a rename
(happens on sorted containers). Rename member variables involved in
renaming to "rename_...".
2025-08-08 12:13:26 +02:00
Michael Natterer
b89ae68d07 app: GimpDeviceEditor: fix whitespace 2025-08-08 12:12:13 +02:00
Michael Natterer
bd33d8dd7e app: switch GimpDeviceEditor to GimpContainerListView, and add a
GimpRow subclass for GimpDeviceInfo objects.
2025-08-07 17:38:52 +02:00
Michael Natterer
170bd79572 app: formatting in GimpDeviceInfo 2025-08-07 17:38:52 +02:00
Michael Natterer
211d415f1c app: prepare GimpRow for subclassing: add protected accessors for its
child widgets, and more virtual functions.
2025-08-07 14:44:50 +02:00
Michael Natterer
04fa596dd1 app: move part of the freeze/thaw logic back from cruft to
GimpContainerView to the "refresh" logic of selecting the same item
works again.
2025-08-07 10:35:58 +02:00
Michael Natterer
8766a228af app: move more API to gimpcontainerview-cruft.[ch] and make
gimpcontainerview.c cruft-free.
2025-08-07 10:35:58 +02:00
Michael Natterer
3b6bb46d36 app: add gimp_viewable_has_preview() and use it in GimpRow, instead of
peeking around in GimpViewableClass manually.
2025-08-05 17:42:32 +02:00
Michael Natterer
33bfd5a12b app: implement GimpContainerListView, using a GtkListBox
It completely relies on GListModel and doesn't manage any list items
itself. The port should be pretty much feature-complete.

Add a ton of stuff to GimpRow in order to look and behave like a
GimpContainerTreeView row.

Add a playground switch to use the new widgets in all views that can
be switched between list and grid view (brushes, patterns etc.)

Please test!
2025-08-05 16:13:01 +02:00
Michael Natterer
4a9b772689 app: GimpRow: implement GtkWidget::style_updated() and ::query_tooltip().
Also add API gimp_row_monitor_changed() to be called from a future
container, because we don't want the logic of gimp_widget_track_monitor()
on each row.
2025-08-04 14:52:43 +02:00
Michael Natterer
7ea10c6475 app: forgot a #pragma once 2025-08-04 14:32:10 +02:00
Michael Natterer
78186c7a16 app: don't chain up to parent->constructed() in
gimp_container_box_finalize() /o\... it's a minor miracle that it just
warned and leaked instead of exploding completely. Fixes #14596.
2025-08-04 14:28:31 +02:00
Michael Natterer
a9f5694906 app: add "context", "view-size" and "view-border-width" to GimpRow.
Add a GimpView widget and virtual functions to prepare for subclasses.
The controller page of prefs looks a bit funny now, but it's a nice
temporary test case without disturbing general user experience.
2025-08-04 08:22:31 +02:00
Michael Natterer
0794087a67 app: move the entire zoom logic from GimpContainerTreeView to
GimpContainerBox so both grid and list views can zoom via scroll and
zoom gestures.
2025-08-01 17:01:53 +02:00
Michael Natterer
b416994ed0 app: make GimpContainerView behave like a normal widget
The old API to select stuff and its signals was doing unexpected
stuff and was very confusing. Change things to be "normal":

The selection API is now set_selected() and get_selected(), with no
internal data exposed, and set_selected() emitting the expected
signal.

The signals are now "selection-changed" and "item-activated".
"selection-changed" is always emitted in response to changing the
selection, be it via the API, or by changes in the model (the internal
callbacks in from e.g. GimpContext or GimpImage simply call set_selected()
and don't do any unxpected magic).
2025-08-01 10:02:37 +02:00
Michael Natterer
fc68405c45 app: remove the gimplayertreeview.h include from GimpDrawableTreeView 2025-07-30 18:25:40 +02:00
Alx Sa
7c949960a4 widgets: Don't freeze progress box on image load
To prevent people from making changes to setting while
in the middle of loading images, we turn off sensitivity to all
widgets in GimpFileDialog (except for the cancel button).
However, the progress box no longer shows the load percentage
when it is not sensitive. Therefore, this patch conditionally leaves
it enabled so we can see progress while loading large images.
2025-07-27 12:48:33 +00:00
Bruno Lopes
fe4cbb6512
Issue #14515: Fix stiff GIMP Debug Dialog
Closes: #14515

Also, make the dialog centered since it isn't modal to
the, for example, crashed GIMP, it is independent.
2025-07-22 10:57:39 -03:00
Alx Sa
0f79d3e850 widgets: Fix crosshair hotspot on Windows
On Windows, the crosshair cursor for brushes is
offset from the brush outline if you have a display
scale of 200% or more. This is because
gdk_cursor_new_from_surface () does not contain code
to scale the hotspot X/Y coordinates to match the surface
on Windows - so it expects you pass those values in
already scaled to the surface.
This patch adds conditional code to scale the hotspots on
Windows the same way we currently do on macOS (though
for opposite reasons).
2025-07-21 01:28:39 +00:00
Michael Natterer
3a2ca2b6ff app: split up GimpContainerView so the code to manually connect to the
GimpContainer is in a separate file, and called conditionally. We
don't need any of this when using GListModel-based views soon.
2025-07-19 13:50:54 +02:00
Michael Natterer
6eae69d2a4 app, pdb: rename gimp_container_get_children_type() to get_child_type() 2025-07-18 08:19:13 +02:00
Michael Natterer
d4e8ab0234 app: rename GimpContainer's "children-type" property to "child-type" 2025-07-18 08:19:13 +02:00
Michael Natterer
77bb857046 app: rename all "children_type" members and variables to "child_type" 2025-07-18 08:19:13 +02:00
Michael Natterer
e00afd9d54 app: rename gimp_data_factory_view_get_children_type() to _get_child_type() 2025-07-18 08:19:13 +02:00
Alx Sa
bb9d36d8ae dialogs, widgets: Check if animations are enabled...
...when setting animations for GtkStack.

Adds a check if gimp_widget_animation_enabled ()
is TRUE before setting an animation type in
gtk_stack_set_transition_type (). If it's FALSE,
then we turn off animations with
GTK_STACK_TRANSITION_TYPE_NONE.
This affects the Input Controller dialogue,
Preferences dialogue, and the Welcome
dialogue.
2025-07-17 20:56:16 +00:00
Michael Natterer
f1373373e6 app: in GimpRow, say e.g. "Rename Brush" instead of a generic
"Rename Item", using GimpViewableClass::default_name
2025-07-16 17:27:40 +02:00
Michael Natterer
df497b5ca6 app: move "default_name" from GimpItemClass to GimpViewableClass and
set default names for a lot of stuff. To be used by GimpRow soon.
2025-07-16 17:22:11 +02:00
Michael Natterer
03b9292d59 app: use g_set_object() in more set_property() implementations 2025-07-15 15:49:45 +02:00
Michael Natterer
0682a19213 app: implement object renaming in GimpRow, using either F2 or long press 2025-07-15 12:27:44 +02:00
Michael Natterer
a91cfe07ac app: set GimpViewableClass::name-editable to TRUE in GimpControllerInfo 2025-07-15 12:12:35 +02:00
Ondřej Míchal
dabe921ba1 app: Change container pop-up view size predictably
Instead of a blind multiplication/division use known and well defined
increments that also have no chance of overflowing the minimum/maximum
allowed sizes.

Closes https://gitlab.gnome.org/Teams/GIMP/Design/gimp-ux/-/issues/509
2025-07-13 11:44:57 -04:00
Michael Natterer
246f9d284f app, pdb, libgimp: use "#pragma once" instead of:
#ifndef __FOO_H__
 #define __FOO_H__

 /* declarations  */

 #endif /* __FOO_H__ */

And some cleanups while I saw the headers.
This is far from finished...
2025-07-13 03:21:37 +02:00