Commit Graph

1224 Commits

Author SHA1 Message Date
Timm Bäder
24a4063645 scrollbar: Use a box layout
Makes a lot more sense than the intermediate box just for its layout.
2019-07-15 07:52:42 +02:00
Timm Bäder
b9b5072668 gl renderer: Fix opacity nodes with overlapping child nodes 2019-07-14 10:08:04 +02:00
Matthias Clasen
bda3c6c084 Merge branch 'wip/baedert/for-master' into 'master'
Improve the valgrind experience

See merge request GNOME/gtk!984
2019-07-09 19:39:13 +00:00
Robert Ancell
dbd2a81501 Change the few examples that use a full GTK_ enum value in .ui files.
Lowercase versions work just as well and are much more readable.
2019-07-08 15:52:28 +12:00
Timm Bäder
042f7d117f compare-render: Don't unref an invalid GFile
We already unref it when the g_file_make_directory_with_parents fails.
2019-07-07 07:24:00 +02:00
Matthias Clasen
b2f15a622d Merge branch 'wip/ebassi/constraint-layout' into 'master'
Add constraint-based layout manager

Closes #1090

See merge request GNOME/gtk!973
2019-07-02 14:01:01 +00:00
Benjamin Otte
129691f3a6 flattenlistmodeL: Compute items-changed position properly
The code previously forgot to include the left child of the model's
node. Which of course only happened if that child wasn't NULL, which is
a common case.

Found and test provided by Matthias Clasen.
2019-07-02 02:53:00 +02:00
Emmanuele Bassi
4dd1de4129 Use explicit values for constraint strength
Instead of playing games with mapping negative symbolic values to
positive ones, let's use the appropriate constants everywhere. This
allows us to use:

        GTK_CONSTRAINT_STRENGTH_WEAK * 2

Or

        GTK_CONSTRAINT_STRENGTH_STRONG + 1

In code using the public API.

We also store the strength values as integers, so we can compare them
properly, and only turn them into doubles when they are inserted into
the solver, just like every other variable.
2019-07-01 12:39:24 +01:00
Matthias Clasen
2f97134a08 Amend a constraint solver test
Make the 'repeat edit' test make more than to
suggestions in a single edit phase. It turns out
that this does not work, whereas just doing
two in a row does.
2019-07-01 00:10:11 +01:00
Emmanuele Bassi
6b308cd71e Add constraint solver
GtkConstraintSolver is an implementation of the Cassowary constraint
solving algorithm:

  http://constraints.cs.washington.edu/cassowary/

The Cassowary method allows to incrementally solve a tableau of linear
equations, in the form of:

  x = y × coefficient + constant

with different weights, or strengths, applied to each one.

These equations can be used to describe constraints applied to a layout
of UI elements, which allows layout managers using the Cassowary method
to quickly, and efficiently, lay out widgets in complex relations
between themselves and their parent container.
2019-06-30 23:42:44 +01:00
Matthias Clasen
f6a2678486 Add another grid layout test
This one will be used for comparison
with constraint layouts.
2019-06-28 19:21:21 +00:00
Matthias Clasen
e28ec2a3eb Some more grid layout tests
Add testcases for spanning children and homogeneity.
2019-06-28 18:07:23 +00:00
Matthias Clasen
c4fd786866 Add a test for the grid layout manager
Test some obvious conditions. This is mainly
to test the waters for more intesting tests
with other layout managers later.
2019-06-28 13:30:16 +00:00
Matthias Clasen
b903d8ee33 Add another action test
Test that disabled actions aren't activated.
2019-06-23 01:39:34 +00:00
Matthias Clasen
366e8da927 Add another test for action inheritance
This one checks for precedence between
class actions and inserted groups.
2019-06-22 23:30:22 +00:00
Matthias Clasen
135580108a Add a test for action introspection
This checks that gtk_widget_query_action works.
2019-06-22 23:11:49 +00:00
Matthias Clasen
4515604511 Add another test for action inheritance
Check that overlapping prefixes are handled
correctly.
2019-06-22 23:00:42 +00:00
Matthias Clasen
3ef8af3be9 Add a test for GtkText actions
Check that the class actions are there and work.
2019-06-21 03:58:21 +00:00
Matthias Clasen
fe6507f875 Add a test for gtk_widget_insert_action_group
This tests that action group inheritance
behaves as expected.
2019-06-21 03:58:13 +00:00
Daniel Boles
732630e0e2 testsuite/a11y/about: Fix exp. output per 31066a69
cherry-pick of commit e56a9e6ce5

Close #1949
2019-06-14 18:05:06 +01:00
Matthias Clasen
f63cec30a4 Add a focus-chain test for focusable containers 2019-06-11 17:15:02 +00:00
Matthias Clasen
1d93e38456 testsuite: Be robust against broken focus
When we start cycling on a subset, abort
after a while.
2019-06-11 17:14:42 +00:00
Matthias Clasen
cfebff5dcf testsuite: more focus-chain output
Differentiate between wrapping around and
stopping at the end of the focus chain.

Update the existing tests, and add two
new ones where the difference matters.
2019-06-11 14:56:38 +00:00
Matthias Clasen
436d7cc0d1 Add a focus chain test
Add a test that enumerates the focus chain by
emitting move-focus repeatedly, and compares
the result to expected output.

The test expects a ui file and a reference
file as input. The reference file can be created
using the --generate option.
2019-06-11 10:14:23 -04:00
Benjamin Otte
ec5854bb9b Merge branch 'for-master' into 'master'
testsuite: Make creating the output dir not racy

Closes #1942

See merge request GNOME/gtk!924
2019-06-09 21:35:15 +00:00
Benjamin Otte
062244ab71 testsuite: Make creating the output dir not racy
Fixes #1942
2019-06-09 23:17:10 +02:00
Matthias Clasen
8452b9a13d Expand focus tests 2019-06-09 17:38:54 +00:00
Benjamin Otte
24effe45cc testsuite: Add tests for printing/parsing transforms 2019-06-03 19:12:03 +02:00
Matthias Clasen
2f7047147d gsk: Add some more transform tests
Tests around identity. Seems trivial, but
still managed to find a bug.
2019-06-03 16:20:38 +00:00
Matthias Clasen
0ab4a232b7 Move transform tests to the gsk suite
That is where they belong.
2019-06-03 16:10:09 +00:00
Timm Bäder
05ca772631 GskTransform: Ignore identity transforms
We often end up with e.g. a scale of 1 or a translation by 0/0. Ignore
those transforms since they don't do anything.
2019-06-03 17:03:02 +02:00
Matthias Clasen
3788e1dea7 testsuite: Pass --output for gsk tests
We want to keep the output from ci runs.
So we now write the .out.png and .diff.png
files to build/testsuite/gsk/compare/$RENDERER.
2019-06-03 02:09:04 +00:00
Matthias Clasen
e0bf301d34 gsk tests: Add an --output option
This will be used to save artifacts in ci.
2019-06-03 02:09:04 +00:00
Matthias Clasen
c7387a8e7f gsk: Test huge glyphs
These don't fit in the glyph cache.
2019-06-03 02:08:36 +00:00
Matthias Clasen
1c1d4f32c8 gsk: Test big glyphs
These are big, but still fit in the glyph cache.
Therefore, the test succeeds.
2019-06-03 02:08:36 +00:00
Benjamin Otte
7e9cb07a92 Merge branch 'for-master' into 'master'
For master

See merge request GNOME/gtk!903
2019-06-03 00:22:40 +00:00
Benjamin Otte
5a0c8805fc transform: Coalesce similar transforms
If somebody does a transform like
  scale(5) scale(10) translate(1,1) translate(5,0)
store it instead as
  scale(50) translate(6,1)
This way, less memory is consumed and transforms are easier to read.

In particular, this simplifies the typical transforms we do in GTK,
which are just one translation after another.
2019-06-02 21:18:56 +02:00
Timm Bäder
db548ee2a0 gl renderer: Fix scale computation
We don't need to just look at the scale of the new modelview matrix, but
at the one we get when multiplying the new one with the current one.

Test case attached.
2019-06-02 10:25:39 +02:00
Timm Bäder
f1996783ec gl renderer: Fix rounded rect intersection code
Test case attached.

Fixes #1920
2019-06-02 08:31:44 +02:00
Matthias Clasen
0c7e567c32 Merge branch 'global-coords' into 'master'
Drop global coordinates

See merge request GNOME/gtk!899
2019-06-01 03:53:13 +00:00
Matthias Clasen
e31190cf7c Update css node results 2019-06-01 03:47:19 +00:00
Matthias Clasen
0a33d74c1b tests: Fix issues with menu shells
The menu shell is no longer the direct
parent of menu items.
2019-06-01 03:32:10 +00:00
Matthias Clasen
e64e9cd520 simplify: Add a testcase for templates 2019-05-31 19:42:18 +00:00
Matthias Clasen
21491d27bb simplify: Add a testcase for dialogs 2019-05-31 19:39:17 +00:00
Matthias Clasen
2eb0333017 Add a testcase
This tests the fix in 1e7225aa1c.
2019-05-30 14:12:07 -04:00
Benjamin Otte
53f23f8ae9 rendernodeparser: Handle empty Cairo nodes
Cairo nodes can contain a NULL surface if they have never been drawn to.
Make this the default Cairo node.
2019-05-30 15:32:36 +02:00
Benjamin Otte
1e0c0c0ba7 rendernodeparser: Parse cairo script
Use cairo-script-interpreter to parse the scripts that generate cairo
nodes.

This requires libcairoscriptinterpreter.so to work properly, but if
it isn't found we disable this (unimportant for normal functioning)
code and just emits a parser warning.
The testsuite requires it however or it will fail.

A new test is included that tests all of this.
2019-05-30 15:32:36 +02:00
Matthias Clasen
7f65e5f96b Rename GtkGestureMultiPress to GtkGestureClick
The name just made it hard for people to find the
right gesture to use.
2019-05-29 17:10:46 +00:00
Matthias Clasen
9abc7262b0 treeview column: Make final 2019-05-28 23:22:57 -04:00
Matthias Clasen
f0fd4843d5 iconview: Make final 2019-05-28 22:50:08 +00:00