Commit graph

23 commits

Author SHA1 Message Date
Simon Hausmann
27fea8b9f3 Fix rustdoc warnings with nightly
Use backticks as recommended by rustdoc for items that could be interpreted as HTML tags.
2022-10-12 17:29:46 +02:00
Olivier Goffart
6b88fc634d Fix partial renderer not rendering some dirty area that were clipped
During the rendering, if an area is clipped, it will not be rendered and
therefore will not be rendered as a dependency.

Consider this example:

```
    HorizontalBox {
        Rectangle {
           TouchArea{
              Rectangle { background: parent.pressed ? red : blue; }
           }
        }

        Rectangle {
           clip: true;
           TouchArea{
              Rectangle { background: parent.pressed ? red: blue; }
           }
        }
    }
}

```

Clicking on the first rectangle will make that area dirty and it will be
redrawn, but since the second one is clipped away, the renderer will not
visit the child items. And clicking on the second rectangle will not
make it re-drawn.

This patch makes sure we rejuster ad dependency of the window tracker
the non-dirty areas

This fix the printerdemo_mcu stopping to render in some cases
2022-09-08 16:22:13 +02:00
Olivier Goffart
8fba65a282 Rename and expose the unsafe-single-threaded feature 2022-08-25 16:47:53 +02:00
Olivier Goffart
c28c527e0e Split the properties.rs files in modules 2022-07-21 14:07:15 +02:00
Olivier Goffart
c41749fc12 Rename PropertyChangeHandler to PropertyDirtyHandler
The handler is called whenever the properties it depends on becomes dirty,
not when it changes.

This has caused confusion before, so rename it
2022-07-21 13:16:40 +02:00
Olivier Goffart
ced9504635 Fix warning in nightly rust
```
warning: unused return value of `alloc::boxed::Box::<T>::from_raw` that must be used
Warning:    --> internal/core/properties.rs:382:9
    |
382 |         Box::from_raw(_self as *mut BindingHolder<B>);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: call `drop(from_raw(ptr))` if you intend to drop the `Box`
```

Just do what the note says
2022-07-18 16:21:27 +02:00
Olivier Goffart
30f95e3aca Fix animation-tick() to register that there are running animation 2022-07-12 17:36:04 +02:00
Olivier Goffart
d48c590346 Add animation-tick() builtin function
Low level primitive allowing to build always running animations
2022-07-11 17:49:28 +02:00
Olivier Goffart
d89d62b6de Properties: Try to re-use the shared property if more than two property are linked
... via two ways bindings

Otherwise we could be in a case where we have an unbounded number of "shared" property
which might not be shared anymore if the original property goes out of scope
2022-07-08 19:05:54 +02:00
Olivier Goffart
fd44b2e651 Model: Do not register row data tracker if not needed
Make track_row_data_changes not register a dependency to the row
if there is currently no binding being evaluated.
2022-04-19 15:12:15 +02:00
Olivier Goffart
6c59cefa9d Property system: setting a binding must mark all dependent property as dirty
When resetting the binding, we need to mark dependent property as dirty.
It just hapenned that the current implementation always set all bindings
before starting to query the properties, so this problem was not seen
before. But there is an exception when setting the two_way bindings,
then we may set the binding after the property was querried because
setting a two way binding actually queries the property
2022-04-13 21:16:32 +02:00
Olivier Goffart
fa1fad931b Properties: Save one usize for each binding
Use a Cell instead of a RefCell
2022-03-18 09:23:52 +01:00
Olivier Goffart
24237377cf Don't register dependencies when computing the dirty geometry 2022-03-07 19:06:23 +01:00
Olivier Goffart
2fd4b4ccfb Print what property was marked as constant when we assert because of modifying non-const 2022-03-04 11:11:40 +01:00
Olivier Goffart
c941946f49 Debug: make sure that more properties have debug_name
The global properties, and base properties were not named

This adds a Property::new_named regardless if debug is enabled or not
2022-02-18 17:40:17 +01:00
Tobias Hunger
4230ac2572
Update copyright information to reflect name change
Also run resue over the codebase and fix complaints from that tool.
2022-02-09 10:27:47 +01:00
Tobias Hunger
de4e195280
Rename internal crates and add a README.md to them
The README.md contains the warning that used to be in lib.rs.

Add README.md files to all internal crates

... pointing to the official public crate to use instead.

Rename internal crates

fixup: README files

fixup rename
2022-02-07 13:12:48 +01:00
Simon Hausmann
125b90a64b Merge remote-tracking branch 'origin/master' into wip/rename
Conflicts:
	api/cpp/cbindgen.rs
	api/cpp/include/slint.h
	examples/CMakeLists.txt
	examples/imagefilter/Cargo.toml
	examples/plotter/main.rs
	internal/backends/mcu/lib.rs
2022-02-04 16:47:20 +01:00
Tobias Hunger
b348d1af44 PropertyAnimation: Make iteration-count: n run animations n times
Side-effect: The code handles invalid inputs to duration/delay better.
2022-02-04 10:42:25 +01:00
Olivier Goffart
d2d6a5cc6a Rename sixtyfps_ 2022-02-02 14:25:56 +01:00
Simon Hausmann
c846633708 Rename C ffi functions 2022-02-02 11:12:34 +01:00
Simon Hausmann
ad0c020aa4 Rename the sixtyfps-corelib crate 2022-02-01 18:04:30 +01:00
Tobias Hunger
e6b24bceec [reorg]: Set up and populate the internal directory
Move "internal" crates into the `internal` directory. This first batch
includes most of sixtyfps_runtime but leaves the rendering backends
alone for now.

pre-commit applied some cleanups to the moved files:
 - Consistent newline at end of file policy
 - trimming trailing whitespace
 - Formatting Cargo.toml files.
2022-01-31 16:00:50 +01:00
Renamed from sixtyfps_runtime/corelib/properties.rs (Browse further)