Commit Graph

4733 Commits

Author SHA1 Message Date
Alexandre Prokoudine 3364ee2af4 Create custom UI for GEGL-based Shadows-Highlights filter...
... and place it in menu
2018-01-05 05:56:08 +03:00
Michael Natterer 895c0f558f app: add small hack to make the generic operation tool always invisible
so it can't be added to the toolbox. It's entirely useless when
activated on its own.
2018-01-04 19:23:39 +01:00
Michael Natterer 1ce878ef47 Bug 791949 - Please ind Shift+T to the Unified Transform Tool
Clean up transform tool keyboard shortcuts (things move around by
stealing Shift+t from the scale tool):

Shift+T  Unified Transform (was Shift+L)
Shift+S  Scale             (was Shift+T)
Shift+H  Shear             (was Shift+S)
Shift+L  Handle Transform  (was Ctrl+Shift+H)
2018-01-03 18:02:28 +01:00
Michael Natterer 119f648a76 Bug 785001 - Enhanced smudge tool: Smudge with painting
Enable color picking with Ctrl-Click in the smudge tool because it now
uses the foreground color.
2018-01-03 02:29:33 +01:00
shark0r 32280a170b app: Add "No erasing effect" parameter to MyPaint brush
Last and unrelated patch of bug #785001.
2018-01-03 02:23:53 +01:00
Michael Natterer dce93c7d7e Bug 762443 - Levels tool Output Level sliders works incorrectly
Add "clamp-input" (which clamps the input values to [0..1])
and "clamp-output" (which clips the final result to [0..1]),
properties, parameters and GUI to:

- GimpLevelsConfig
- GimpOperationLevels
- The levels tool dialog
- The gimp_drawable_levels() PDB API

The old deprecated gimp_levels() PDB API now sets both clamping
options to TRUE which restores the 2.8 behavior.

Also reorder some stuff in GimpLevelsConfig and elsewhere so the
levels parameters are always in the same order.
2018-01-02 18:47:20 +01:00
Massimo Valentini 423ce6fca3 Bug 770689 - Custom transparency controller for dark...
...outside area of Crop Tool -> Highlight option

Add "highlight-opacity" property and turn the controlling GUI into an
expanding toggle that reveals an opacity slider.
2018-01-02 14:33:27 +01:00
Richard McLean 699b835c87 Bug 787321 - Editing shear tool values numerically can have no effect
If the user enters a value in the shear tool dialog, that value must
be honored. Always set the shear direction to the edited axis and
reset the other axis to 0.
2018-01-01 18:22:34 +01:00
Ell eded91e118 Bug 753412 - New Canvas rotation feature rotates brush.
Replace the "lock brush size to zoom" paint option with a "lock
brush to view" option, which links the entire brush transform to
the view transform, so that the brush remains invariant in display
space under scaling, rotation, and reflection.
2017-12-22 17:52:29 -05:00
Ell a0b73420ec app: add support for brush reflection
Add support for reflecting brushes as part of their transformation.
The reflection is performed as the last step of the transformation,
across the vertical axis.

The option to reflect the brush is not exposed in the UI, or
through the PDB, but is intended to be used for linking the brush
transformation to the view transformation, in the next commit.
2017-12-22 17:52:29 -05:00
Jehan 2069496af3 app: use the new gimp_display_shell_get_line_status() for measure...
... and paint tools (shift-click mode). The feature was already there
but reimplemented twice. Just replace the code to use the same function.
2017-12-22 23:24:24 +01:00
Ell 984ed6cefd app: constrain line angles in display space, not image space
Add an offset_angle parameter to gimp_constrain_line(), which
offsets the radial lines by a given angle.

Add gimpdisplayshell-utils.[ch], with two new functions:

  - gimp_display_shell_get_constrained_line_offset_angle():
    Returns the offset angle to be passed to
    gimp_constrain_line(), in order to constrain line angles in
    display space, according to the shell's rotation angle and
    flip mode.

  - gimp_display_shell_constrain_line():  A convenience function
    which calls gimp_constrain_line() with the said offset angle.

Use the new functions in all instances where we constrain line
angles, so that angles are constrained in display space, rather
than image space.

The only exception is GimpEditSelectionTool, which keeps
constraining angles in image space, since it's not entirely obvious
that we want to constrain angles of dragged layers/selections in
display space.
2017-12-22 06:32:24 -05:00
Thomas Manni 27512d802b Bug 791512 - make the selection boundary detection the same as 2.8
Replace the GIMP_BOUNDARY_HALF_WAY macro by two others : one for perceptual and
one for linear gamma.

Use the GIMP_BOUNDARY_HALF_WAY_LINEAR to compute channels and floating selection
boundaries.
2017-12-18 21:01:30 +01:00
Michael Natterer 1abd415a30 app: fix GimpForegroundSelectTool after GimpFreeSelectTool changes
The free select tool now commits on double click inside a closed
polygon, which caused the foreground select tool to switch modes in
the middle of a click, breaking both its own and its parent class'
state.

Fixed by detecting whether the commit was done by double click and
delaying the mode switch until after the parent class button release
code is done.

Unrelated: Don't call both COMMIT and HALT, the generic tool mechanism
does that automatically now, forgot to port this file.
2017-12-07 19:53:20 +01:00
Ell bf8b2f2e6b app: avoid CRITICAL when moving empty floating selection 2017-12-07 08:39:13 -05:00
Michael Natterer d60c237805 Bug 785781 - Additional Free Selection step (hitting Enter)...
...is a regression in common cases

Commit the free select tool on double click inside the polygon.

Done by implementing GimpCanvasItem::hit() in GimpCanvasPolygon, using
ugly code.
2017-12-01 22:19:42 +01:00
Ell f7d6805ebb */Makefile.am: add abbreviations to generated enum files
Update the dprod production of generated enum files to include
abbreviated value descriptions, as per the previous commits.

Add a comment for translators above the abbreviated descriptions,
specifying the full description they abbreviate.
2017-11-30 03:10:14 -05:00
Ell 5eb6187421 app, menus: add gegl:median-blur to the menus 2017-11-17 16:46:39 -05:00
Ell 945ef0de25 app: restore gradient when adding/removing stop on same blend-tool action
When a single blend-tool action adds and removes the same gradient
stop, restore the original gradient, rather than actually adding
and removing the stop, so that the affected midpoint returns to its
original state at the beginning of the action, rather than being
reset (and, consequently, so that the redo stack isn't lost.)
2017-11-16 11:55:13 -05:00
Ell 6036217d20 app: improve elimination of trivial blend-tool edit actions
... from the undo stack

When a blend-tool edit action modifies the gradient, do a deep
comparison of the original gradient against the current gradient,
to test if anything changed, instead of just assuming that
something did change.
2017-11-16 11:55:13 -05:00
Ell 6a6af19ff8 app: update image menu when starting a blend-tool edit action
... since we can't undo blend steps while an action is in progress.
2017-11-16 11:55:13 -05:00
Ell 2e9ab59d19 app: use matrix to determine if doing perspective transform in preview
In GimpCanvasTransformPreview, use the transform matrix to
determine if we're doing a perspective transform, rather than
relying on a separate property, so that we don't use the slow
perspective path unnecessarily.

Consequently, remove the does_perspective member of
GimpTransformTool, since it's no longer used.
2017-11-14 11:24:56 -05:00
Michael Natterer 0611ca1d50 app: remember the modes of the color picker info window's GimpColorFrames
Keep them in GimpColorPickerOptions.
2017-11-12 20:33:42 +01:00
Michael Natterer a5e1dd84fd app: implement GimpToolActiveModifiers in GimpTool
Change gimp_tool_set_active_modifier_state() to honor the new
GimpToolControlSetting. Explicitly set the mode to SEPARATE in
all tools that require modifier keys during a stroke.

And here comes the actual fix: change GimpTransformTool and
GimpToolTransformGrid to use SAME mode, and remove their
active_modifer_key() and hover_modifier() impls, so it makes no
difference whether a modifier is pressed before of after mouse button
press/release.
2017-10-29 16:42:53 +01:00
Michael Natterer dd30cc79b5 app: let tools control how they recieve modifier keys during a stroke
Add new enum GimpToolActiveModifiers { OFF, SAME, SEPARATE } and
new API gimp_tool_control_set,get_active_modifiers(), the default
value is OFF.

OFF: the tool gets no modifier keys at all during a stroke

SAME: all modifiers are always delivered via GimpTool::modifier_key(),
and no magic is applied whatsoever when a mouse button is pressed or
released.

SEPARATE: this is the "classic" way: modifiers while hovering and
while stroking are delivered separately, and hover modifiers don't
affect stroke modifiers.
2017-10-29 16:42:53 +01:00
Ell e4440e3fdb app: save custom gradient across sessions
Add a framework for saving and restoring internal data objects, in
gimp-internal-data.c.  Internal data objects are saved in separate
files under a new "internal-data" subdirectory of the user's gimp
directory.  The internal data is saved, restored, and cleared
together with the tool options.

Use this to save and restore the custom gradient.  In the future,
we might add similar writable internal data objects that we'd want
to save.
2017-10-29 10:19:07 -04:00
Ell e029795dfb app: add gimp_widget_blink(); use instead of gimp_dockable_blink()
gimp_dockable_blink() is used to attract the user's attention to a
specific dockable.  Generalize this to arbitrary widgets, by
replacing gimp_dockable_blink[_cancel]() with
gimp_widget_blink[_cancel](), in gimpwidgets-utils.c.
2017-10-28 10:07:10 -04:00
Ell 2bbb0f509b app: fix tentative gradient leak in the blend tool editor 2017-10-18 15:01:57 -04:00
Ell 6e5aeb4fbf app: indentation fix in the blend tool editor 2017-10-18 15:01:56 -04:00
Ell c5b88702e6 app: allow specifying a callback function for propgui pickers
Allow propgui constructors to specify an (optional) callback function
when creating pickers, to be called when a color/coordinate is picked,
similarly to controller callbacks.

Implement picker callback support in GimpFilterTool.  When the active
picker has an associated callback function, call it instead of the
class's color_picked() function.

Add lots of "#include <gegl.h>" to .c files that miss it, which is
now necessary, since this commit adds a Babl* parameter in
propgui-types.h.
2017-10-16 12:38:37 -04:00
Ell 862bb00478 app: clear tentative gradient when halting the blend tool
Currently, it should already be cleared at this point, but still.
2017-10-11 06:39:38 -04:00
Ell 9548d54e12 app: fix conversion of midpoints to stops in the blend tool, when ...
... the gradient is reversed, or offset > 0

Also, add a few assertions.
2017-10-10 05:58:46 -04:00
Ell 4bfa6e716e app: don't update blend tool filter upon irrelevant line changes
When one of the line widget's properties changes, only update the
blend tool filter if the property has an effect on the result.  In
particular, don't update the filter when only the selection
changes.
2017-10-09 12:48:55 -04:00
Ell 429bc5507c app: fix fg/bg color change handling in the blend tool
Separate the handling of changes to the FG/BG color from the gradient
dirty signal handling, so that the gradient editor doesn't purge the
history in response.  Additionally, correctly respond to such changes
whenever the gradient has segments that depend on the FG/BG colors,
even if the dependency is introduced after the gradient is selected.
2017-10-09 12:48:55 -04:00
Ell 4f6b4d27bc app: implement tool undo for gradient editing in the blend tool
Move the tool undo functionality of the blend tool to the editor,
and add support for undoing gradient edit operations.  Each undo
step that affects the gradient holds, in addition to the line
endpoint poisitions, a copy of the gradient at the beginning of the
operation, as well as necessary information to allow the selection
to "follow" undo.  When undoing the operation, the saved gradient
is copied back to the active gradient.

To avoid all kinds of complex scenarios, when the active gradient
changes, or when the gradient is modified externally (e.g., by the
(old) gradient editor), all undo steps that affect the gradient are
deleted from the history, while those that affect only the endpoint
positions are kept.
2017-10-09 12:48:55 -04:00
Ell 9469ac26f0 app, libgimpbase: implement blend tool gui for gradient midpoints
Allows setting the midpoint's position, blending function, and
coloring type.

The midpoint can be converted to a stop, and centered, through
editor buttons.
2017-10-09 12:48:55 -04:00
Ell 1aa4877426 app: implement blend tool gui for gradient stops
Allows setting the stop's position, and its left and right colors
and color types.  A chain button can be used to modify the two
colors (and color types) together.

The stop can be deleted through an editor button.
2017-10-09 12:48:55 -04:00
Ell 8d12fada8a app: implement blend tool gui for gradient endpoints
Allows setting the endpoint's position, its color, and its color
type.
2017-10-09 12:48:55 -04:00
Ell a9ca354d26 app: add tool gui to the blend tool
To be used by the blend tool gradient editor to edit the gradient
endpoint/stop/midpoint properties corresponding to the selected
handle.

The GUI is currently empty; the following commits add its contents.
2017-10-09 12:48:54 -04:00
Ell 420ea8037a app: convert midpoints to stops via double-click in the blend tool
When a midpoint is double-clicked, convert it into a gradient stop
(i.e., split the corresponding segment at the midpoint,) by
responding to the line's handle-clicked signal.
2017-10-09 12:48:54 -04:00
Ell 63c8fc73dd app: handle prepare-to-remove-slider signal in the blend tool
Add a tentative_gradient member to GimpBlendTool, which, when set,
is displayed instead of the current gradient.

Use this to show a version of the gradient with the currently
selected stop deleted, upon receiving a prepare-to-remove-slider
signal, i.e., when the slider is about to be removed.
2017-10-09 12:48:54 -04:00
Ell 9ae09fb03a app: add support for removing gradient stops to the blend tool
... by responding to the line's remove-slider signal.
2017-10-09 12:48:54 -04:00
Ell 29bae454a2 app: add support for adding gradient stops to the blend tool
... by responding to the line's can-add-slider and add-slider
signals.
2017-10-09 12:48:53 -04:00
Ell 690f51d4eb app: modify the gradient in response to blend-tool slider motion
Update the gradient's segment endpoint and midpoint positions,
according to the sliders.
2017-10-09 12:48:53 -04:00
Ell ac1b788787 app: add sliders for gradient stops and midpoints in the blend tool
They can't be used to modify the gradient yet, but soon...  Very
soon!
2017-10-09 12:48:53 -04:00
Ell 4f1195be29 app: add "modify active gradient" option to the blend tool
Add a boolean "modify active gradient" option to the blend tool.
when checked, the active gradient is modified in-place while edited.
When unchecked, the active gradient is copied to the internal
"custom" gradient upon editing, and the custom gradient becomes
subsequently active.

Show a hint when the option is checked, but the active gradient is
non-writable, and can't be edited directly.

This commit adds the new gimpblendtool-editor.[hc] files, which are
where the gradient-editing related functionality of the blend tool
is going to go.
2017-10-09 12:48:53 -04:00
Ell f95f8eb347 app: add "instant mode" option to the blend tool
Add a boolean "instant mode" option to the blend tool, togglable
using shift.  When checked, commit the gradient immediately when
the mouse is released.

When not in instant mode, don't commit the gradient when clicking
outside the line, since this will become easy to do accidentally
once we add on-canvas gradient editing.
2017-10-09 12:48:53 -04:00
Ell 02ad016b39 app: don't show a PLUS cursor modifier before starting the blend tool
We're going to use the PLUS modifier for adding gradient stops.
2017-10-09 12:48:52 -04:00
Jehan 55083baa98 app: also make options_box into a GWeakRef.
While I am at it, let's spread the improvement to options_box which was
also a weak pointer with g_object_add_weak_pointer(). Let's make it
rather a GWeakRef for the same reason as I did options_gui.
2017-10-05 00:11:36 +02:00
Jehan 7be856a47d app: use GWeakRef instead of g_object_add_weak_pointer().
Other than multi-threading (which here is not the problem), using
GWeakRef has the other advantage that it makes the type of pointer
obvious, hence avoiding the kind of errors as fixed in commit 12df796.
One can't just change the pointer value directly, and has to use
g_weak_ref_set(), so such problem won't happen again.
2017-10-04 23:38:24 +02:00