Ell
bfb51b0782
app: don't compute slider values for 0-length lines while dragging
...
... to avoid getting NaNs.
2017-07-04 10:43:01 -04:00
Ell
04b407a019
app: s/slider_count/n_sliders/ in GimpToolLine and firends
...
Yep yep yep.
2017-07-03 18:10:30 -04:00
Ell
60586a8817
app: add sliders to GimpToolLine; add slider-line controller
...
Add supprt for placing sliders on a GimpToolLine -- handles that can
be dragged over the line. The sliders are accesible through a new
"sliders" property, and via the gimp_tool_line_{get,set}_sliders()
functions.
Add a slider-line controller, which works like a line controller,
but whose callback also supplies/takes an array of sliders.
Note that the data type for individual sliders is called
GimpControllerSlider (in particular, it's not line specific), so
that we may use it with other controller/tool-widget types in the
future.
2017-07-03 15:10:47 -04:00
Michael Natterer
e8ee5475b7
app: move all propgui files from app/widgets/ to new folder app/propgui/
...
We are getting more and app/widgets/ is already too large.
2017-07-03 12:29:41 +02:00
Michael Natterer
2da59e7ba3
app: add a "status-title" string property to GimpToolLine
...
which defaults to "Line: ". Set it to "Blend: " in the blend tool.
2017-07-03 01:02:23 +02:00
Piotr Drąg
ddee27f6d4
Fix typos in translatable strings
2017-07-02 17:47:08 +02:00
Michael Natterer
e8c6382302
app: re-enable GimpRectangleTool's "suppress_updates" keyboard moving hack
...
so a handle can be moved with the cursor keys even if it moves away
from under the mouse pointer.
2017-06-29 22:02:48 +02:00
Michael Natterer
56d87724a3
app: don't base GimpToolRectangle's new "is_first" on rectangle extents
...
they also get set externally so are broken to use. Instead, simply set
"is_first" to TRUE in init() and to FALSE in button_release().
2017-06-29 20:48:41 +02:00
Michael Natterer
2aff5b0a5a
app: add new string property "status-title" to GimpToolRectangle
...
and use it for the statusbar message instead of just always "Rectangle: ".
2017-06-29 20:37:17 +02:00
Michael Natterer
c9abe09440
app: improve GimpToolRectangle's statusbar messages
2017-06-29 20:21:02 +02:00
Michael Natterer
9dc6d4f515
app: improve button release behavior or GimpToolRectangle a lot
...
- introduce new state "boolean is_first" which tracks if the currently
drawn rectangle is the first with this instance
- cancel the widget if there was no movement when creating the first
rectangle
- undo to the previous rectangle if the user created a zero-extent
rectangle
- also undo to the previous rectangle if a newly drawn rectangle is
canceled with button-3 release
2017-06-29 20:01:08 +02:00
Michael Natterer
5c8c30112a
app: treat a NO_MOTION release like NORMAL one in GimpToolRectangle
...
which stops unexpected behavior that was there even before the new
code (like a rectangle without a selection).
2017-06-29 16:48:02 +02:00
Michael Natterer
e7964e499c
app: we were leaking a reference in gimp_tool_rectangle_button_release()
...
because of bailing out early after emitting "response". Instead, don't
ref the object around this function, and move the "response" emission
to the end of the function.
2017-06-29 15:04:13 +02:00
Michael Natterer
a562860eed
app: add boolean property "force-narrow-mode" to GimpToolRectangle
...
which allows to force outside handles without resorting to hacks.
2017-06-28 14:23:51 +02:00
Michael Natterer
719f96d89a
app: fix gimp_tool_rectangle_frame_item()
...
it was setting double properties from integers, boom.
2017-06-28 14:13:10 +02:00
Michael Natterer
94bb1a78c1
app: some cleanup and fixes in GimpToolRectangle
...
- unset "rect_adjusting" before bailing out on button_release()
- update the integer rectangle when the double properties change
- don't try to show handles with a size of < 3
- remove unused members
- shorten some variable names
2017-06-27 17:46:47 +02:00
Michael Natterer
8a1d782b42
app: add optional round corners to GimpToolRectangle
2017-06-27 14:19:18 +02:00
Michael Natterer
75871cfa64
app: add the options to draw an ellipse within GimpToolRectangle
2017-06-27 00:46:55 +02:00
Michael Natterer
9d042e4de9
app: add gimp_canvas_arc_set()
2017-06-27 00:46:24 +02:00
Michael Natterer
c07a5f0a61
app: add gimp_tool_widget_add_arc()
2017-06-27 00:45:45 +02:00
Michael Natterer
3a0aab71b6
app: gimp_tool_widget_get_cursor(): rename "cursor_modifier" to just "modifier"
...
The same in all subclasses.
2017-06-26 22:13:00 +02:00
Michael Natterer
a3acb7422d
app: move status message setting from GimpBlendTool to GimpToolLine
2017-06-26 21:48:43 +02:00
Michael Natterer
068f850c03
app: dispatch to the right vfunc in gimp_tool_widget_hover_modifier()
...
it was copy-paste dispatching to motion_modifier().
2017-06-26 21:39:51 +02:00
Michael Natterer
be63a4a836
app: add new GimpToolWidget subclass GimpToolRectangle
...
which is a replacement for GimpRectangleTool. It's a massive piece of
code and I'm not sure everyting works as it should, but it seems to do
crop stuff without any glitches.
2017-06-26 19:19:16 +02:00
Michael Natterer
1ebf905ed3
app: change gimp_tool_widget_add_corner() to take x, y, width, height
...
instead of x1, y1, x2, y2.
2017-06-26 19:19:16 +02:00
Michael Natterer
00ea73f29a
app: add a generic GimpToolWidget::response() signal
...
and a default key_press() handler that emits CONFIRM, CANCEL and RESET
responses. Remove code with the same purpose from all subclasses.
Change tools feed key_press() to the widget and connect to its
"response" instead of implementing key_press() themselves. This will
only be better and less code after the tool side of this is done
generically.
2017-06-25 23:23:27 +02:00
Michael Natterer
d27359cca2
app: add gimp_tool_widget_add_rectangle(), _rectangle_guides(), _corner()
2017-06-25 21:07:24 +02:00
Michael Natterer
84e1f757ce
app: store the snap offsets in GimpToolWidget
...
Rename gimp_tool_widget_snap_offsets() to set_snap_offsets(),
and add gimp_tool_widget_get_snap_offsets().
Also rename gimp_tool_widget_status() to set_status(), and
add new function and signal set_status_coords().
2017-06-24 21:09:18 +02:00
Michael Natterer
d089aa629b
app: rename enum GimpRectangleToolFixedRule to GimpRectangleFixedRule
2017-06-24 19:48:09 +02:00
Michael Natterer
6e2e8a6f08
app: move the rectangle tool enums from tools-enums to display-enums
2017-06-24 19:48:09 +02:00
Michael Natterer
9c3a2b5021
app: add gimp_canvas_corner_set() which sets everything except the anchor
2017-06-24 19:48:09 +02:00
Michael Natterer
2192f520da
app: add new GimpToolWidget subclass GimpToolPolygon
...
which is the free select curve.
2017-06-23 01:57:21 +02:00
Michael Natterer
9e2a3c7aee
app: add gimp_tool_widget_add_polygon() and add_polygon_from_coords()
2017-06-23 01:44:56 +02:00
Michael Natterer
9d8f94375e
app: add gimp_canvas_polygon_set_points()
...
and allow NULL points in both this function and new().
2017-06-23 01:40:35 +02:00
Michael Natterer
3ab92c7290
app: add GimpToolWidget subclass GimpToolPath, a complete vectors editor
2017-06-21 23:27:20 +02:00
Michael Natterer
c4d5693903
app: add various handle and vectors hit tests to gimpcanvasitems-utils.[ch]
...
1:1 copies of the same functions in gimpdrawtool.[ch].
2017-06-21 23:21:26 +02:00
Michael Natterer
1aca558867
app: forgot to #include "gimptoolpath.h" in gimptoolwidget.c
2017-06-21 02:16:11 +02:00
Michael Natterer
82e2fa2e5e
app: add gimp_tool_widget_add_path(), not used yet
2017-06-21 00:32:14 +02:00
Michael Natterer
91deb61475
app: add virtual functions GimpToolWidget::key_press() and ::key_release()
...
and api to call them. Not used anywhere yet.
2017-06-20 23:01:18 +02:00
Michael Natterer
d2bfbfb748
app: some more cleanup in GimpToolLine
...
it was already working perfectly, but it's so simple I'd like to make
it "perfect" as a GimpToolWidget implementation example.
2017-06-20 19:07:24 +02:00
Michael Natterer
625ec4b773
app: add utility function gimp_canvas_handle_calc_size()
...
which is the code that calculates handle size based on pointer
proximity. Use the new function in GimpToolHandleGrid and
GimpToolLine, and clean up some stuff in GimpToolLine.
2017-06-20 01:02:23 +02:00
Michael Natterer
6560e3895b
app: clear GimpToolTransformGrid's status when we leave proximity
2017-06-20 00:23:25 +02:00
Michael Natterer
77d516b588
app: another copy/paste error broke moving in GimpToolHandleGrid
2017-06-19 23:45:35 +02:00
Michael Natterer
055ca325f2
app: manage the preview opacity with an object binding too
2017-06-19 23:39:37 +02:00
Michael Natterer
0411801765
app: manage the transform tools' grid properties in GimpTransformTool
...
Simply use g_object_bind_property() to connect the grid properties of
GimpTransformOoptions and GimpToolTransformGrid and remove all other
grid property setting code.
2017-06-19 23:06:39 +02:00
Michael Natterer
96da8c1505
app: add status message to the handle transform tool
...
and fix a few glitches from tool widget porting.
2017-06-19 22:53:30 +02:00
Michael Natterer
546bbe1e14
app: add a transform matrix to GimpCanvasPolygon and all API using it
2017-06-19 21:53:49 +02:00
Michael Natterer
3ddfd107b9
app: add some newlines in gimpcanvasboundary.c
2017-06-19 21:53:20 +02:00
Michael Natterer
b1dddcdc8f
app: add #defines of standard handle sizes to gimpcanvashandle.h
...
The same values as in gimpdrawtool.h, tool widgets in display/ must
not include the draw tool header from tools/.
2017-06-19 10:46:05 +02:00
Michael Natterer
3b21c08b41
app: add proximity-sensitive handles to the handle transform tool
...
as known from the blend tool.
2017-06-19 08:02:12 +02:00