Commit graph

1537 commits

Author SHA1 Message Date
Simon Hausmann
13e8b36c33 Minor cleanup in C++ generator
Have one place to emit the m_window member
2021-10-28 15:52:29 +02:00
Simon Hausmann
14eb078335 Fix tests
Don't disable inlining by default
2021-10-28 15:52:29 +02:00
Simon Hausmann
6c42998a57 Make it possible to disabling inlining by environment variable
`SIXTYFPS_DISABLE_INLINING=true` will do that and subsequently apply all the optimizations passes
on all components instead of just the root.

In the future we'll flip this around make make inlining opt-in, instead
of opt-out.
2021-10-28 15:52:29 +02:00
Olivier Goffart
25dfc218b0 Collect globals before inlining 2021-10-28 15:52:29 +02:00
Olivier Goffart
f25a7cbc0a Do the apply_default_properties_from_style before inlining
Note: the extra parentheses allow to avoid rustfmt to split in many lines
2021-10-28 15:52:29 +02:00
Olivier Goffart
32668eed9c Fix a bunch of panic that might occur later as the optimizations happen per component 2021-10-28 15:52:29 +02:00
Olivier Goffart
fd8b97b228 Do the materialize_fake_properties before inlining 2021-10-28 15:52:29 +02:00
Olivier Goffart
2767ceb10b Make the visible pass work on the non-inlined tree 2021-10-28 15:52:29 +02:00
Olivier Goffart
8622dcb910 Do the default_geometry pass without inlining 2021-10-28 15:52:29 +02:00
Olivier Goffart
67dd409f87 Move a few more passes before inlining 2021-10-28 15:52:29 +02:00
Olivier Goffart
567c644a5f Fix PopupWindow position when all elements are not inlined
Pass a reference to the parent item in the show_popup function
so we can compute the exact location at runtime.
2021-10-28 15:52:29 +02:00
Olivier Goffart
5f07678478 Make the layout pass work on non-inlined tree 2021-10-28 15:52:29 +02:00
Olivier Goffart
7b41f8a4bc Do the popup window pass before inlining 2021-10-28 15:52:29 +02:00
Olivier Goffart
6e5596cdfc Make the repeater pass work on the non-inlined object tree 2021-10-28 15:52:29 +02:00
Olivier Goffart
171a23d7d1 Do the flickable and states passes before inlining 2021-10-28 15:52:29 +02:00
Olivier Goffart
fff6f04be0 Progressively work on pass so they work without inlining
Revert part of the previous commit that tries to do all the pass without inlining

Fixup the few first passes so they work without inlining, but still do a full
inlining for most passes

The goal is to make it work pass by pass until we can have everything without
requiring full inlining
2021-10-28 15:52:29 +02:00
Simon Hausmann
a318df522b Prepare for optional inlining
Even if we make inlining optional, there are *some* situations where we just
need to do the inlining anyway to avoid
needless complexity.
2021-10-28 15:52:29 +02:00
Olivier Goffart
72f022b3ed Document the test harness 2021-10-26 14:51:23 +02:00
ogoffart
b25ae6fbcd Bump version number to 0.1.5 2021-10-26 07:36:54 +00:00
Simon Hausmann
8f2e4f487e Expose window-background in the native StyleMetrics
It's also in the non-native metrics
2021-10-20 17:41:02 +02:00
Simon Hausmann
7d12fd7b4e Add support for tracking the length of a model in C++
Similar to the parent commit, the model tracks changes to the rows and
marks an internal property dirty. Since we have a base class this is a
little less intrusive.

cc #98
2021-10-20 15:25:28 +02:00
Simon Hausmann
63bf1af093 Add support for tracking the length of a model in Rust
This is done by exposing the ModelNotify to the caller via the new
ModelTracker trait, which has a function that allows "hooking" into the
dirty tracking of the size.

By extension, this also works in JavaScript.

cc #98
2021-10-20 15:25:28 +02:00
Olivier Goffart
520db86495
Don't set no-frame explicitly to false.
False is already the default. No need to create a binding for it.
2021-10-18 13:41:05 +02:00
James Blacklock
a3ba958197 remove cast 2021-10-18 10:21:06 +02:00
James Blacklock
1f0a5a6d7c fix formatting & cpp test case 2021-10-18 10:21:06 +02:00
James Blacklock
642e4b539a (hopefully) fix cpp generation 2021-10-18 10:21:06 +02:00
James Blacklock
cc4105e274 no need for InferredGenericType! 2021-10-18 10:21:06 +02:00
James Blacklock
ab665ba7b6 enable scripts to access the length of arrays 2021-10-18 10:21:06 +02:00
Olivier Goffart
9f3d02c319 Fixup previous commit
I got the condition wrong.

CC: #581
2021-10-15 17:20:10 +02:00
Olivier Goffart
19ce555d36 Don't hardcode ScrollArea's viewport size
The Flickable should already have sane default

But we need to make sure that the default binding don't override bindings
set with aliases. So we must use BindingsMap::set_binding_if_not_set which
sets the priority properly

Closes #581
2021-10-15 15:43:44 +02:00
Olivier Goffart
4436b422e5 Fix LineEdit.has-focus witht he native style
The property had the wrong name.

Also it is not a native-output
2021-10-14 15:34:25 +02:00
Olivier Goffart
bb4e5d8b55 Fix animation not starting when set from a callback
Two problems:
 - We were not marking the property as dirty, so dependent property would not
   update themselves
 - In the generated rust/c++ code, we would not call set_animated_value
2021-10-13 14:33:40 +02:00
Olivier Goffart
89c43bcd36 Workaround a rust-analyzer parse error in the generated code
Workaround for https://github.com/rust-analyzer/rust-analyzer/issues/10492
2021-10-12 21:13:07 +02:00
Robert Broketa
c3c7765f80 Add no-frame property for a borderless/frameless window 2021-10-11 10:21:21 +02:00
Olivier Goffart
85772d5bc5 Fix extra '}' when doing a debug() with an enum.
The code was copy-pasted from the code that output the structs
2021-10-08 17:29:32 +02:00
Olivier Goffart
b99ff1b766 Put filename in quote in import errors
So that the `debug_assert!` that fires when a error message ends with a
period does not crash the LSP when typing an incomplete filename that ends
with a '.'
2021-10-07 14:44:12 +02:00
ogoffart
77fcd5221b Bump version number to 0.1.4 2021-10-07 09:36:43 +00:00
Olivier Goffart
cc0d5e17a1 Fix materialized property being wrongly re-initilized when used within the same Element
Because the `bindings` field is taken in order not to keep the Element borrowed.

Fixes original report from #553
2021-10-07 09:23:24 +02:00
Simon Hausmann
8eda32cf3f Fix build / formatting 2021-10-06 22:03:01 +02:00
Simon Hausmann
bf6aaf4657 Rename the embed_resources pass to embed_images
... because that's what it does, it only looks at image references.
2021-10-06 21:28:35 +02:00
Simon Hausmann
7aa6545046 Enable support for gzipped SVG
usvg detects gzipped SVG by looking at the first bytes, and Qt supports it as well.
2021-10-06 21:24:44 +02:00
Olivier Goffart
72d556113f Visit globals when finding usages of structs
Otherwise some used struct might not be found, and they can cause
compilation failure in the generated C++ or Rust code

Fixes #549
2021-10-06 18:48:06 +02:00
Simon Hausmann
7102f9b997 Fix standard button OK text
Ok -> OK
2021-10-06 16:16:39 +02:00
Simon Hausmann
2ecf6c61d4 Minor cleanup: include the path in the error message when embedding an image fails 2021-10-06 09:44:06 +02:00
Olivier Goffart
d5ad9ebe0e Improve the macro from the previous commit
I have the feeling that having less 'write!' will lead to better code
2021-10-06 09:02:43 +02:00
Olivier Goffart
521bf192f8 Improve error message for parse error
print the literal token symbol instead of the internal token name
2021-10-06 08:54:14 +02:00
Simon Hausmann
517b731e7b Fix CI build
Turn message about inability to embed images into a warning for now

We do test our tutorial and in the CI build we enforce embedding,
so the icon paths there don't work.
2021-10-05 23:16:46 +02:00
Simon Hausmann
b3a5cfb74d Fix typo in about widget text 2021-10-05 23:16:46 +02:00
Simon Hausmann
29f9dd5f5c Minor cleanup in about widget
Remove the copyright statement, as it may give a misleading
impression about the copyright of the app.
2021-10-05 23:16:46 +02:00
Simon Hausmann
88ad176008 Improve diagnostics when images cannot be located for embedding
This is a two-stage change, that first centralizes the file I/O code
path for on-disk and builtin:/ files. Secondly the resource embedding
pass now produces diagnostics if a file cannot be located.
2021-10-05 23:16:46 +02:00