Commit Graph

67384 Commits

Author SHA1 Message Date
Matthias Clasen
ca4d610bf2 Add operations
Allow setting the type of segments to move, line or
curve, from the context menu, and do the necessary
adjustments to maintain smoothness, in particular
between curve and line segments.
2020-11-21 08:47:33 -05:00
Matthias Clasen
8993756a84 Use a context menu
Move the toggling of smoothness to a context menu
on each point. This menu will carry more items in
the future.
2020-11-20 13:30:08 -05:00
Matthias Clasen
4c23a9fa6e Tweak editing some more 2020-11-20 11:11:23 -05:00
Matthias Clasen
93d2b8ba63 Change dragging of non-smooth point
Always move control points along. Feels more natural.
2020-11-20 09:52:12 -05:00
Matthias Clasen
6f45aaf9f4 curve: Introduce the concept of symmetric
Keep the distance of control points equal (ie symmetric)
when dragging control points, unless you hold Control
when initiating the drag.
2020-11-20 09:35:42 -05:00
Matthias Clasen
da503ea4b5 curve: Restructure data a bit
Introduce a separate PointData struct that is going
to hold per-segment information.
2020-11-20 08:45:38 -05:00
Matthias Clasen
8ce6690205 More curve editing
Make right-click on curve points toggle between
smooth and corner.
2020-11-20 00:55:51 -05:00
Matthias Clasen
0d8e052123 Play with paths
Add a simple demo for editing a poly-Bezier curve.
2020-11-19 23:38:20 -05:00
Benjamin Otte
4b04c859b6 gtk-demo: Add a text-on-path demo 2020-11-19 22:41:37 +01:00
Benjamin Otte
39093d5935 xxx: path_fill demo 2020-11-19 22:41:37 +01:00
Benjamin Otte
3abe33fc1d path: Add gsk_path_measure_get_point()
Allows querying the coordinates and direction of any specific point on a
path.
2020-11-19 22:41:37 +01:00
Benjamin Otte
6e7df513ab path: Add gsk_path_add_circle()
Adds a circle contour, too.
2020-11-19 22:41:37 +01:00
Benjamin Otte
3cf4bbc9d1 pathmeasure: Implement support for beziers
Instead of treating bezier curves as lines, we properly decompose them
into line segments now so that we can treat those as lines.
2020-11-19 22:41:37 +01:00
Benjamin Otte
eb63c33ce9 path: Implement gsk_path_to_cairo() using foreach() 2020-11-19 22:41:37 +01:00
Benjamin Otte
4aca0358b4 path: Add gsk_path_foreach() 2020-11-19 22:41:37 +01:00
Benjamin Otte
cf930d93e1 path: Collect flags
We don't need them yet, but maybe later.
2020-11-19 22:41:37 +01:00
Benjamin Otte
6f009aa6d7 testsuite: Add path tests 2020-11-19 22:41:37 +01:00
Benjamin Otte
9211e49dd2 pathmeasure: Add gsk_path_measure_add_segment()
This allows chunking paths, weeee.
2020-11-19 22:41:37 +01:00
Benjamin Otte
c7a061bfba path: Add gsk_path_builder_add_path() 2020-11-19 22:41:37 +01:00
Benjamin Otte
099cac301d gsk: Add GskPathMeasure
An object to do measuring operations on paths - determining their
length, cutting off subpaths, things like that.
2020-11-19 22:41:37 +01:00
Benjamin Otte
8924a0df00 path: Change data structure for standard path
Instead of the Cairo method and imitating cairo_path_data_t, use the
Skia method and keep points and operations separate.

That way we get a points array that includes the starting point -
because it's always the end point of the previous operation.
2020-11-19 22:41:37 +01:00
Benjamin Otte
0eb30556e9 popover: Use fill and stroke nodes instead of Cairo
... to render the arrow.

The arrow should really be turned into a real thing - maybe an icon?
2020-11-19 22:41:37 +01:00
Benjamin Otte
cd5822dd4c snapshot: Add gtk_snapshot_push_stroke() 2020-11-19 22:41:37 +01:00
Benjamin Otte
f155d7f8d3 gsk: Add GskStrokeNode 2020-11-19 22:41:37 +01:00
Benjamin Otte
c81e4a4fa6 demos: Add a simple demo filling a path 2020-11-19 22:41:36 +01:00
Benjamin Otte
7d4ac10fc3 snapshot: Add gtk_snapshot_push_fill() 2020-11-18 09:04:48 +01:00
Benjamin Otte
ecab2c0e24 gsk: Add GskFillNode
Take a rendernode as source and a GskPath and fill the region in the
path just like cairo_fill() would.
2020-11-18 09:04:48 +01:00
Benjamin Otte
396197340d gsk: Add GskPath 2020-11-18 09:04:48 +01:00
Matthias Clasen
b3243132a0 Merge branch 'wip/chergert/gdk-macos-for-master' into 'master'
macos: fix rendering artifacts with hover transitions

See merge request GNOME/gtk!2862
2020-11-18 03:04:01 +00:00
Christian Hergert
dd7f52c59a macos: fix rendering artifacts with hover transitions
Using an image surface seems to fix some rendering artifacts when
performing cross-fade CSS transitions.
2020-11-17 18:20:55 -08:00
Matthias Clasen
9128ad105b Merge branch 'wip/carlosg/for-master' into 'master'
gdk/wayland: Update to gtk_shell1 version 3

See merge request GNOME/gtk!2860
2020-11-18 00:13:17 +00:00
Carlos Garnacho
745cbc6c91 gdk/wayland: Update to gtk_shell1 version 3
Bring in line with gtk3, in terms of startup notification and
activation support.
2020-11-18 00:41:46 +01:00
Matthias Clasen
b635736ac2 Merge branch 'wip/chergert/gdk-macos-for-master' into 'master'
node-editor: fix length of text during save

See merge request GNOME/gtk!2859
2020-11-17 22:49:05 +00:00
Matthias Clasen
ba081bf119 Merge branch 'fix-doc-packtype' into 'master'
doc: Adapt GtkPackType documentation to GTK4 changes

See merge request GNOME/gtk!2858
2020-11-17 22:46:43 +00:00
Christian Hergert
3003f37e9d node-editor: fix length of text during save
The length parameter for g_file_replace_contents() is a gsize, so -1 is
unsuitable here. Just use strlen() directly.
2020-11-17 14:34:11 -08:00
Matthias Clasen
c1e05e7c52 Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

Closes #3278

See merge request GNOME/gtk!2856
2020-11-17 19:25:05 +00:00
Matthias Clasen
6b475aacd2 Merge branch 'wip/chergert/gdk-macos-for-master' into 'master'
inspector: handle differences in DPI between backends

See merge request GNOME/gtk!2857
2020-11-17 19:24:47 +00:00
vanadiae
bc4969ec42 doc: Adapt GtkPackType documentation to GTK4 changes
Since GTK4, the functions that used the GtkPackType enumeration,
`gtk_box_pack_{start,end}`, were replaced by `gtk_box_{append,prepend}`,
hence this enumeration isn't used anymore by any function within the
GtkBox type, and the child packing properties were also removed for GTK4.
So this commit adapts the documentation accordingly.
2020-11-17 20:19:16 +01:00
Benjamin Otte
1c7daece7a Merge branch 'wip/otte/for-master' into 'master'
Wip/otte/for master

See merge request GNOME/gtk!2855
2020-11-17 19:08:01 +00:00
Christian Hergert
37a8c138f9 inspector: handle differences in DPI between backends
This fixes an issue on macOS where the text gets much larger once opening
the inspector.
2020-11-17 10:45:25 -08:00
Matthias Clasen
34d547a2aa inspector: Limit the width of readonly properties
For readonly properties, we show the serialized value
in a label. If we don't take precautions, this can cause
our window to grow extremely wide, and break things.
So, ellipsize things at a reasonable size.

Fixes: #3278
2020-11-17 13:36:57 -05:00
Benjamin Otte
163c04c101 snapshot: Add cleanup function to snapshot state
Otherwise we're leaking data in error cases.
2020-11-17 19:04:39 +01:00
Benjamin Otte
f2284ff40f rendernode: Rename all gsk_render_node_peek_*() functions
Those are getters, they should be gsk_render_node_get_*() functions.
2020-11-17 19:04:39 +01:00
Benjamin Otte
eded9459df tests: Fix for new tranfer behavior of constructors
We were still unreffing a listmodel where the reference wasn't ours
anymore.
2020-11-17 19:04:39 +01:00
Benjamin Otte
8fd1530848 testsuite: Make defaultvalue test always get the property
Make the test not skip properties completely, just skip checking the
property.

This caught the last 2 commits.
2020-11-17 19:04:39 +01:00
Benjamin Otte
77f9efa747 textbuffer: Remove unused properties
The getters and setters were removed in
f53848c360 but the pspecs were forgotten.
2020-11-17 19:04:39 +01:00
Benjamin Otte
109ec523cb shortcut: Actions are objects 2020-11-17 19:04:39 +01:00
Emmanuele Bassi
5cc5022a8f Merge branch 'wip/chergert/gdk-macos-for-master' into 'master'
macos: bring forward quartz search engine updates

See merge request GNOME/gtk!2854
2020-11-17 17:58:14 +00:00
Emmanuele Bassi
3c769bb11d Merge branch 'ebassi/inout-args' into 'master'
Remove pointless inout arguments

See merge request GNOME/gtk!2853
2020-11-17 17:40:13 +00:00
Christian Hergert
33b07e4825 macos: bring forward quartz search engine updates
These were not cherry picked after GTK branched for 4 development.
2020-11-17 09:37:13 -08:00