Commit graph

5155 commits

Author SHA1 Message Date
Tobias Hunger
d26707e41e Janitor: Fix clippy::bool_assert_comparison 2021-08-18 00:24:51 +02:00
Tobias Hunger
604f91681b Janitor: Fix clippy::needless_return 2021-08-18 00:24:51 +02:00
Tobias Hunger
a387c0f60f Janitor: Fix clippy::needless_borrow 2021-08-18 00:24:51 +02:00
Tobias Hunger
bbbf6460df Janitor: Fix clippy::redundant_closure 2021-08-18 00:24:51 +02:00
Tobias Hunger
c7d27d5ace Janitor: Fix clippy::redundant_clone 2021-08-18 00:24:51 +02:00
Tobias Hunger
8f5d3ab50f Document pre-commit setup in CONTRIBUTING.md 2021-08-17 22:38:16 +02:00
Tobias Hunger
aea4ecca99 Apply pre-commit hooks to all files 2021-08-17 22:38:16 +02:00
Tobias Hunger
892c4c0062 Add .pre-commit-config.yaml
This uses https://pre-commit.com/ to add git hooks

Short summary to get started:
 * Run `pip install pre-commit` to install the pre-commit binary
 * Run `pre-commit install` in the git repo to install the actual git hooks

Not sure all the tests make sense in this configuration, this is another
attempt to get the discussion started;-)

pre-commit will only look at updated files by default and will only run
the tests that make sense for that file. So runtime is reasonable with
the checks I am proposing. `pre-commit run --all-files` (which forces
the hooks to look at all files) takes below 4s on my machine. This will
be much longer if you start to add `cargo check` of course;-)

If you want to override a test for one commit, that is also pretty easy:
Just do `SKIP=test-name git commit`...
2021-08-17 22:38:16 +02:00
Olivier Goffart
a39dd6ac4f Interpreter API: preserve the dashes and underscore when listing properties 2021-08-17 18:47:41 +02:00
Olivier Goffart
77f441b395 vscode extension: add an option to set LSP commands line arguments 2021-08-17 17:01:08 +02:00
Olivier Goffart
2c1e39f00e Fix priority when merging two_way_binding
We should not increase the priority when merging two way binding, only when
inlining.

This fixes the iot-dashboard's devices widget which were sometimes not
transparent as they should have been.
This was not deterministic because the order in which the two way binding are
merged is not deterministic because of hash table, and sometimes one binding
ended up having a higher priority as it should have had.
2021-08-17 11:57:35 +02:00
Olivier Goffart
a2966bdafa Fix warning generating internal docs
references to non-existing items
2021-08-16 18:27:35 +02:00
Olivier Goffart
a094ce7a2a Add a warning on the internal crates documentation that we don't follow semver 2021-08-16 18:26:33 +02:00
Olivier Goffart
32cb50677a vtable: bump version 2021-08-16 11:24:40 +02:00
Olivier Goffart
8aac74d81d const-field-offset: Bump version and add ChangeLog 2021-08-16 11:20:39 +02:00
Olivier Goffart
4af34a8de1 const-field-offset: fix a bunch of clippy warnings in tests 2021-08-16 11:12:17 +02:00
Olivier Goffart
73ec3e6701 vtable: fix clippy warnings in tests
(ran with cargo clippy --tests)
2021-08-16 11:04:33 +02:00
Olivier Goffart
b40b1291e3 vtable: fix clippy warning about unneeded mut in a macro 2021-08-16 10:56:54 +02:00
Olivier Goffart
073447a47d Fix the clippy error about comparing address of virtual table
Fix one vtable_address_comparisons clippy link.
It is fine to only compare the data pointer.
Two different model with the same data pointer in a Rc could only be obtained
with tricks like transmute because each model is allocated on a different Rc.
2021-08-16 10:53:28 +02:00
Olivier Goffart
5ac8010346 NativeButton: set the right icon style 2021-08-13 18:13:16 +02:00
Olivier Goffart
ec529f088b Fix the native style drawn from the GL backend
Femtovg wants RGBA, not ARGB
2021-08-13 18:12:18 +02:00
Olivier Goffart
c296a00286 Preview in documentation: make sure the preview is not duplicated for C++ 2021-08-13 13:27:03 +02:00
Olivier Goffart
0b2fd617f0 Derive simple enum from Copy 2021-08-13 11:58:22 +02:00
Olivier Goffart
143510b593 Set the width of items in a ListView
Fixes #408
2021-08-13 11:57:56 +02:00
Olivier Goffart
4d496c2c44 Fix a table in the example README 2021-08-13 11:48:12 +02:00
Olivier Goffart
40afcd4070 Fix the spinner for the slide puzzle firefox
The layout of the html here is a bit different for the slize puzzle
than for other demo because it is using a display: grid.
As a result, placing the spinner in the grid would cause the canvas
to be resized when the spinner goes away, with firefox. Since we don't
get resize event when the canvas gets resized withtout the whole page
being resized, the scaling and coordinate were off.

So put the spinner outside of the grid
2021-08-13 10:19:42 +02:00
Olivier Goffart
f6e2b97aab Prospective fix for the double preview in the C++ docs 2021-08-12 20:37:31 +02:00
Olivier Goffart
7859e2f06e Fix opacity property at the root of a repeated element in layout
This fix the layout of the printing-queue in the printer demo
2021-08-12 20:10:21 +02:00
Simon Hausmann
761d1fcf37 Don't require a license header in a future /.pre-commit-config.yaml
cc #404
2021-08-12 18:33:21 +02:00
Simon Hausmann
144d1bed36 internal cleanup: replace use of imported function with qualified use 2021-08-12 18:07:58 +02:00
Simon Hausmann
e935e159ee Fix import of types with an underscore
In Exports::from_node() we use parser::identifier_text to extract the
names, which are normalized (with dashes). We need to do the same in

ImportedName::from_node() in order to allow something like

    export Main_Window := ...

and then

    import { Main-Window } from "foo.60";

or even just

    import { Main_Window } from "foo.60";

(that regressed)
2021-08-12 18:03:01 +02:00
Simon Hausmann
01e2a14322 Remove unused properties from globals
The fluent style has a bunch of unused global color properties, which can be removed - for example.
2021-08-12 16:33:37 +02:00
Olivier Goffart
a5689a6389 Flickable: Ignore repeated child elements in geometry computation to avoid compiler panic
This fixes a panic but ideally, we should merge the layout info of each children

cc #407
2021-08-12 16:17:13 +02:00
Olivier Goffart
429e5bdb07 Add link to SixtyFPS homepage from the wasm demo pages 2021-08-12 14:19:29 +02:00
Olivier Goffart
a5d230932b There was another reason than the duplicated id why this example was removed 2021-08-12 14:00:25 +02:00
Olivier Goffart
ff441d3db6 Improve a bit the preview in the documentation with nightly rustdoc
The example are in a layout so "float:right" doesn't have an effect in that div
Instread, just put the preview inside the example.

This also remove the "Preview:" text
2021-08-12 13:57:36 +02:00
Olivier Goffart
d5b1a95f74 Turn the "duplicated id" error into a warning
Just for compatibility reason with 0.1.0, this is going to be turned
back into an error at a later point
2021-08-12 13:47:11 +02:00
Simon Hausmann
386d61d648 Simplify Rust’s SharedVector::clear() when the vector is shared
Co-authored-by: Olivier Goffart <ogoffart@sixtyfps.io>
2021-08-12 13:41:08 +02:00
Simon Hausmann
a752c798b8 Changed C++'s SharedVector::clear() to not preserve capacity when shared 2021-08-12 13:41:08 +02:00
Simon Hausmann
d65af654d7 Changed Rust's SharedVector::clear() to not preserve capacity when shared 2021-08-12 13:41:08 +02:00
Simon Hausmann
511027dad0 Implement SharedVector::clear() for C++ 2021-08-12 13:41:08 +02:00
Simon Hausmann
856a049627 Implement SharedVector::clear() for Rust 2021-08-12 13:41:08 +02:00
Olivier Goffart
7cc13d78c3 C++ Make the stron_ref and weak_ref of VRc atomic
To match the equivalent in rust
2021-08-12 12:59:50 +02:00
Olivier Goffart
9b869f2dc0 C++ Add a few asserts that the non-thread safe API is not called in a thread 2021-08-12 12:59:50 +02:00
Olivier Goffart
220f8ec473 I forgot MSVC in the last commit
We need to disable the unicode test for MSVC because that doesn't work
2021-08-12 10:51:18 +02:00
Simon Hausmann
43eea7b655 Apply the loading spinner from the plotter example to the online preview 2021-08-12 10:50:09 +02:00
Olivier Goffart
1246b28006 Add test that unicode in identifier works
With GCC 10 and Rust 1.53, this is supported so just add a test for it
2021-08-12 10:20:26 +02:00
Simon Hausmann
efb4a03a9a Apply the loading spinner from the plotter example to the todo example 2021-08-12 10:17:00 +02:00
Simon Hausmann
bdf7912a4d Apply the loading spinner from the plotter example to the slide puzzle 2021-08-12 10:15:20 +02:00
Simon Hausmann
83afe6a4f2 Apply the loading spinner from the plotter example to the old printer demo 2021-08-12 10:13:37 +02:00