Commit Graph

5892 Commits

Author SHA1 Message Date
Luca Bacci 005b3a05b8 Make use of the gimp_bind_text_domain () util function 2023-01-24 14:48:44 +00:00
Jacob Boerema 9ac2178e6e app: update gimphelp-ids.h
Removed several help ids that are not in use anymore.
Fixed spelling of one help id, the spelling has also been fixed in
gimp-help.
2023-01-14 16:02:03 -05:00
Sabri Ünal 5d9f214cb8 app: Make a comment reachable
gettext cannot reach otherwise.
2022-12-30 12:43:41 +00:00
Jacob Boerema 8372220345 app: use pre-defined help id GIMP_HELP_COLORSELECTOR_PALETTE
Instead of using the string directly. This ensures that possible updates
in the string don't go unnoticed in gimp-help.
2022-12-23 13:01:11 -05:00
Jacob Boerema 469dfdcf11 app: update available help ids for gimp-help
Add several missing help ids, remove those that are not used anymore,
and update "gimp-colorselector-water" to "gimp-colorselector-watercolor".

Also add a comment why some help ids are not used directly.
2022-12-23 12:56:47 -05:00
Jehan 4acd18309a app: use our custom layer search entry with Ctrl-F in the Layers dockable.
GtkTreeView has an "interactive search" feature built-in, which basically kicks
in with the Ctrl-F shortcut by default. Let's hijack this feature and trigger
our own new search popover which is much more powerful (multi-item selection,
ability to use regexp or glob search by enabling these in Preferences, etc.).

This was an idea by Aryeom who wanted to be able to hit Ctrl-F to search for
layers.
2022-11-28 21:48:53 +01:00
Jehan 2912552263 app: make the "Anchor" tooltip depending on whether we are floating over…
… a layer or a layer mask.
2022-11-28 20:43:56 +01:00
Alx Sa cc3f7afb04 tools: auto-activate transform tools on canvas
This removes the need to click the canvas after selecting a transform
tool before you can start working on the transform.
2022-11-13 17:52:25 +00:00
Jehan 28457ce337 app: display the floating mask over the layer mask.
It would make using floating masks a lot easier as it is visually understandable
that it applies to the layer mask.
2022-11-09 02:15:41 +01:00
Jehan ddec8e2255 app: remove the last usage of gimp_image_get_active_layer().
The histogram is still not multi-drawable aware. In the future, it would be nice
to add ability to generate histogram for all selected layers (merged and as
separate images) as well as the whole visible image, therefore 3 possible cases.

But for now, it's alright like this (no more, but no less feature than before)
and at least we got rid of the last usage of functions assuming single item
selection.
2022-11-09 00:53:17 +01:00
Jehan 2b0928d895 app: big UI rework of the align/distribute tool.
- Adding a separate pivot widget to allow choosing which point of the items we
  align or distribute. E.g. until now, we could only align the right side of
  objects to the right side of the reference object, left to left and center to
  center. Now these are independent. Therefore I can align the left side of
  objects to the right border of a selection or a layer, and so on.
- Only keep 2 "distribute" buttons (for now). Most of the distribution actions
  were basically broken or extremely hard to understand. Also they were
  apparently mixing concepts of alignments with distributions. Now let's
  basically only keep the bases: horizontal or vertical distributions.
  Everything is still possible using a mix of alignment and distribution
  buttons, and it's much clearer.
- Since the GimpAlignmentType was used nearly only there (except for some usage
  like to store dock side or filter preview split direction, but these
  GIMP_ARRANGE_* values were unused there), I removed the various enum values
  which we don't use anymore.
- The Reference settings gets its own subsection in the Align tool options.
  Until now, it looked like it only applied to alignment, whereas it applies to
  distribution too.

Note: this is still work-in-progress, mostly some initial dev work to put some
algorithmic bases. We had some UI and specification discussions with Aryeom
already and some things might still change a lot.
2022-11-08 19:19:55 +01:00
Jehan 947130f2cb app: make a copy of selected items before gimp_container_view_select_items().
Otherwise the selected items might change and invalidate the pointer, eventually
leading to a segfault.
2022-11-01 22:57:21 +01:00
Michael Schumacher 149358021e app: Add GDK_SCROLL_MASK to gimpviewablebutton initialization.
This makes these buttons respond to scroll wheels again, a regression encountered in GIMP 2.99.x.
Code location and fix found by Massimo Valentini.

Fixes issue #6929.
2022-10-24 00:27:13 +02:00
Alx Sa 53202a70ed app: Disabled symmetry menu when no image is set
To improve discoverability, the symmetry dockable's combobox menu is now
shown (but disabled) when no image is set.
2022-10-17 14:42:22 +00:00
Jacob Boerema 28e0033ed2 app: fix string of GIMP_HELP_FILE_CREATE_TEMPLATE
Even though GIMP updated the name of the define for Create Template to
GIMP_HELP_FILE_CREATE_TEMPLATE, it did not change the id string.
In gimp-help this string was updated, causing help not found when asking
for help for Create Template.

This commit updates the string used for the help id to be the same as
used in gimp-help. It also removes the old define that is not used
anymore in GIMP.
2022-10-16 17:17:18 -04:00
Jacob Boerema 6cb58fbc8d app: remove duplicate GIMP_HELP_TOOL_CURVES define
This caused a missing documentation warning for help id gimp-tool-curves
in gimp-help.
2022-10-15 16:32:29 -04:00
Jacob Boerema 4b4dd5ec38 app: remove unused GIMP_HELP_TOOLS_DIALOG help id
This help id was used in the past but all references to it were removed
long ago with commit c53113d0cc.

Let's remove this define too since it causes a warning in gimp-help when
checking for help id's without documentation.
2022-10-15 14:05:03 -04:00
Alx Sa ca6b58e970 text: Add outline options to text editor
This ports Massimo’s code to work in the latest version of GIMP.
It adds new outline-related properties to GimpText and GimpTextOptions.
These are controlled via the Text Tool Editor.
Cairo is currently used to draw the outline around the text.
2022-10-12 22:00:40 +00:00
Jehan bee4dd0fc3 app: finally remove the get_active_item() and set_active_item() abstract…
… methods of GimpItemTreeView.

There were 2 last usages of get_active_item() which are now gone with this
commit.
2022-10-12 22:47:22 +02:00
Jehan 9fc8260c7c app: "vectors-copy" and "vectors-export" are now multi-paths aware. 2022-10-12 22:13:38 +02:00
Jehan 5df4875c88 app: do not depend on returned image for successful file_open_with_display().
We may return GIMP_PDB_SUCCESS with no image for generic file procedure, such as
is the case with .gex extension files.
file_open_image() already sanitizes the status returned by the plug-in, so at
this point, we should trust the returned status.

This fixes a crash when loading .gex files (GIMP_PDB_SUCCESS status yet a NULL
error).
2022-10-11 23:19:18 +02:00
Niels De Graef 27fe67814e app: initial work on moving to GtkApplication.
Reviewer's message (Jehan): This was a work-in-progress by Niels, which
we only keep in this state because Lukas worked over it. I have rebased
and fix-amended many broken part of this commit, because various things
had been changed in these areas of code since this commit was initially
written.
2022-10-09 16:12:07 +02:00
Jehan d3458a82d0 Issue #7023: icon size selection on GIMP 2.99.
This kinda reverts commit 6aebd30de1 ("app: remove
icon sizing preferences"), except that the code base is different enough since
this old commit was mainly for GIMP 2.10.x.
In any case, after initially thinking that GTK+3 handling for high density
display would be enough, we finally decide that adding back a Preferences-wide
setting for overriding the theme-set icon size is a good idea (additionally to
GTK+3 automatic support).

The base idea for removing the feature was that GTK+3 has high density display
support, through the "scale factor". Typically a high density display will
normally be set as using a ×2 scale factor so all icons will be double size.
Unfortunately it turns out it's not enough.

For instance, on very small screen estate, even with a scale factor of 1, if the
theme sets 24px toolbox icons, it may still take too much space.
Oppositely on huge screens, even with ×2 factor scale detected by the OS, the
icons may still feel too small (this is possibly what happens with #7023).

Furthermore there is also a matter of taste. Some people like small icons even
when they have the space. Others may want bigger icons, easy to click on.

Finally you can like a theme for its color scheme for instance, but it may not
have the icon size you want. Right now, we'd need to duplicate every theme in
small or bigger size. Instead of doing so, let's just have this global setting
overriding the theme rules.

Comparison with the 2.10 implementation:

- We still provide 4 sizes: small, medium, large and huge.
- We don't have the "Guess ideal size" setting anymore. Instead this is now a
  mix of the GTK+3 scale factor logic and the theme-set or custom size. I.e.
  that on a high density display with ×2 scale factor, we could have toolbox
  icons up to 96 pixels (48×2)!
- We now try to have less custom code in widgets as we append the CSS rules to
  the theme (similar to what we were already doing for dark theme or icon
  variants). What happens in widget code is mostly to connect to changes in
  themes and redraw the widgets which need to be.
- The custom size will now affect: toolbox icons, the FG/BG editor widget (in
  both the toolbox and the color dockable), dockable tab icons, the main
  dockable buttons, eye and lock header icons in item tree views, eye and lock
  cell icons in the item lists.

There are still a bunch of areas where it is not taken into account, such as
plug-ins, and various dialogs, but even in custom-made interface in dockables.
Ultimately it might be interesting to have a way to sync more buttons and
widgets to a global size settings.

Lastly, I fixed a bunch of existing bugs where we were updating icon sizes with
gtk_image_set_from_icon_name() using the const icon name taken from
gtk_image_get_icon_name(). As this was reusing the same string pointer, we were
ending with freeing the icon name.
2022-09-28 21:11:58 +02:00
Jehan 624493af4b app: properly resize the GimpFgBgEditor when changing icon size.
This is the needed improvements I was talking about in commit 00fbcbea0b. Right
now, when changing the icon size, the FG/BG color widget was not immediately
resizing. It needed a restart of GIMP.

Now it will properly react to "style-updated" signal, but also to "theme"
property of GimpGuiConfig.
The reset of the color icon pixbufs is also needed when GimpFgBgEditor size is
re-allocated.
2022-09-26 21:53:13 +02:00
Jehan dfbaf4d501 app: make sure the icon size and button relief are updated when changing theme.
When changing the theme, the style-updated signal is *usually* run, but not
always. For instance, moving from a theme with big icons to one with smaller
icons (or the other way around) sometimes work, and sometimes doesn't. I'm not
sure if it's to be considered a bug in GTK or if this signal depends on other
things. Anyway we have our own "theme" signal on the GimpGuiConfig and we know
exactly that we need to make sure that the icons are properly redrawn in such a
case. So let's just connect to this signal.
2022-09-26 21:10:30 +02:00
Jehan 08b7de3b13 Issue #8520: show devel download link when relevant.
This is shown in the About dialog when a new version is available, but
also in the debug dialog (also when a new version is available).

Of course, for stable versions, we should still show the main download
page (which I double-checked current code does).
2022-08-31 13:13:27 +02:00
Jehan ca230cb770 meson: fix warnings of deprecated features.
Now that we bumped our meson requirement, meson is complaining about
several features now deprecated even in the minimum required meson
version:

s/meson.source_root/meson.project_source_root/ to fix:

> WARNING: Project targets '>=0.56.0' but uses feature deprecated since '0.56.0': meson.source_root. use meson.project_source_root() or meson.global_source_root() instead.

s/meson.build_root/meson.project_build_root/ to fix:

> WARNING: Project targets '>=0.56.0' but uses feature deprecated since '0.56.0': meson.build_root. use meson.project_build_root() or meson.global_build_root() instead.

Fixing using path() on xdg_email and python ExternalProgram variables:

> WARNING: Project targets '>=0.56.0' but uses feature deprecated since '0.55.0': ExternalProgram.path. use ExternalProgram.full_path() instead

s/get_pkgconfig_variable *(\([^)]*\))/get_variable(pkgconfig: \1)/ to
fix:

> WARNING: Project targets '>=0.56.0' but uses feature deprecated since '0.56.0': dependency.get_pkgconfig_variable. use dependency.get_variable(pkgconfig : ...) instead
2022-08-31 01:29:37 +02:00
Jehan 2f83db70ff app: delete duplicate modifier rows in the modifiers editor.
When changing the modifiers of a mapping, we should delete any previous
row with the same modifiers.
2022-08-21 16:51:30 +02:00
Jehan 60d08c87f4 app: delete the previous mapping when changing modifier.
Previously, when updating a modifier mapping, we ended up with a
duplicate for the same action.
2022-08-21 12:50:17 +02:00
Jehan 00fbcbea0b app: size the GimpFgBgEditor relatively to the toolbox icon size.
Until now we were sizing the FG/BG area with hardcoded size ((40, 38)
which I'm not sure where it came from!). Now this allocation size will
depend on the toolbox icon size (I made so that the FG/BG area is more
or less the same size as former hardcoded values with large toolbar
icons).
I had to tweak a bit the size of the default FG/BG icons and the swap
icons, which were also hardcoded. They now also depend on the allocation
size, hence the icons size.

Note that this code still has a limitation: it won't resize when you
switch from a theme with one size to another size of icons. A restart
will be necessary. This is something we should improve.
2022-08-20 23:48:44 +02:00
Jehan 76ddf4421c app, po: remove GimpControllerMouse code.
The mouse controller had many limitations:

* It was not per-device.
* It was a long hard-coded list of events, which made its evolution
  annoying and scrolling the list boring.
* It was starting at button 8, while the first buttons were supposed to
  be hardcoded interactions. And it stopped at button 12, while some
  device might have more buttons nowadays. See !386.
* The "Grab event" does not seem to work in many cases, according to
  feedbacks.

The new GimpModifiersEditor will now handle any button (except the first
button, which is reserved for tools), you can even override or change
default canvas actions (panning, rotation, etc.). It should not be
limited with a max button number either (though I haven't tested with a
device really having a lot of buttons since I don't have any such device
but I did emulate huge button numbers on my stylus with xsetwacom and it
did work well; hopefully I'll get feedbacks). And now it can even run
custom actions.
So basically it should deprecate the mouse controller as the modifiers
editor can do everything the controller could, and more (unless I missed
anything).
2022-08-17 14:20:18 +02:00
Jehan dd012d11d2 app: now support custom actions as input device button + modifiers.
Custom actions are basically any action (currently GtkAction) which can
be assigned a shortcut. Now they can also be assigned to an input device
button (with modifier or not).
2022-08-17 14:20:18 +02:00
Jehan f7d7771038 app: try to make the button selection button more obvious.
From Aryeom's feedback, it's really not obvious enough how we start
customizing button's modifiers.
2022-08-17 14:20:18 +02:00
Jehan 89f55336a2 app: add a page in Preferences to set the canvas modifiers up.
Finally everything is getting assembled with this commit. It is now
possible to customize the modifiers which will be used on canvas.
2022-08-17 14:20:18 +02:00
Jehan 5167e5aa45 app: new GimpModifiersEditor widget.
This widget will be used to edit the GimpModifiersManager config class
with a graphical interface.
2022-08-17 14:20:18 +02:00
Jehan 100bdeddd9 app: store keys as keyval/modifiers rather than string.
There is really no need to make back and forth between a string and
int/enum representations, and it actually cause problems at times.

It's also a problem for the button representation where a modifier will
be represented as a key.
2022-08-17 14:20:18 +02:00
Jehan 924dea3a35 app, po: show proper instructions in GimpShortcutButton.
When no accelerator was set yet, display relevant information, and when
the button is toggled (waiting for shortcut input), display also
relevant info.
2022-08-17 14:20:18 +02:00
Jehan fe65b4d4c6 app: new GimpShortcutButton widget.
A widget to grab a shortcut provided interactively. It can also grab
modifier-only shortcuts so we will be able to use it for the new
on-canvas interaction customizability.

Maybe we'll use this later for the shortcuts dialog which should really
be improved some day and has a lot of known issues. We'll see.
2022-08-17 14:20:18 +02:00
Jehan a853052768 app: new "Canvas Interaction" setting.
Moving the "Space Bar", the "Snapping" and the new "Zoom" (MR !570)
settings there. The idea is that it will also be where we'll customize
more on-canvas related abilities, such as the new zooming behavior
preferences, but also possibility to customizing or disabling the
various canvas action, and finally customizing the new contextual
settings such as brush sizing or other.
2022-08-17 14:20:18 +02:00
Jehan 12be7bdc37 app: adding GimpDoubleAction types of actions.
These actions can be activated with a double value. These will be useful
to create new types of size action, which are based on accurate pixel
values instead of an enum hacked to set per-mille values between a
min/max.
2022-08-17 14:20:18 +02:00
Nikc 1c81c426ae Modules: Convert CMYK color selector to babl 2022-08-15 21:14:14 +00:00
Alx Sa 936954436a widgets: Use simulation intent API in ColorFrame
Uses the simulation rendering intent from GimpImage instead of
from GimpColorConfig. This affects the SamplePoint and Pointer dialogues
as well as the Color Info Window.
2022-08-15 01:26:47 +00:00
Alx Sa 94414c1ca8 core: Add simulation settings to Create New Image
Adds a dropdown for Simulation Profile, Intent, and BPC
to the Create a New Image dialog.
This allows users to assign a soft-proofing profile when the image is
first created. It defaults to "None", however. Users can also set the
default simulation rendering intent and BPC status per image.
These options are also removed from the Preferences dialog.
2022-08-14 17:25:25 +00:00
Alx Sa 0587a10543 core: Add simulation intent and BPC to GimpImage
Adds a simulation_bpc and simulation_intent to GimpImage to allow 
plug-ins to access it
for CMYK import/export.
Four pdb functions were added to enable this access:
image_get_simulation_bpc (), image_set_simulation_bpc (), 
image_get_simulation_intent (), and image_set_simulation_intent ().
Next, it updates menu options and code to support GimpImage's
internal simulation intent and bpc.
New 'simulation-intent-changed' and 'simulation-bpc-changed signal 
are emitted via
GimpColorManagedInterface so that relevant tools 
(such as the
CYMK color picker, GimpColorFrame, and future pop-overs)
 are aware of these changes.
2022-08-13 19:39:47 +00:00
Povilas Kanapickas 40743c90a2 widgets: Fix out of bounds zoom in gradient editor
When zooming using scroll events it is possible to zoom out of gradient
bounds because the check for out of bounds zoom happens with the zoom
value before the delta is applied. The correct way is to limit the zoom
value after the delta is applied.
2022-08-06 16:28:50 +00:00
Povilas Kanapickas ae3c4c3577 widgets: Implement zoom focus in gradient editor
Zoom focus centers the point that we're zooming into at the location of
the mouse pointer.

Default zoom focus value is 0.5 which results in previous behavior.
2022-08-06 16:28:50 +00:00
Povilas Kanapickas 8d0e6efa10 widgets: Reset view_last_x whevener gradient editor leaves focus 2022-08-06 16:28:50 +00:00
Povilas Kanapickas ecb2009960 widgets: Implement support for zoom by pitch in gradient editor 2022-08-06 16:28:50 +00:00
Povilas Kanapickas 62490218ee widgets: Fix support for smooth scrolling in gradient editor
Smooth scrolling requires that we keep the scroll (or zoom, as is in
this case) state as a floating-point number. The scroll deltas are often
less than one, thus storing scroll state as an integer will effectively
ignore most of the scroll events.
2022-08-06 16:28:50 +00:00
Povilas Kanapickas 86799f8762 app: Implement zooming via touchpad gestures on GimpContainerTreeView 2022-08-06 15:49:40 +00:00