Commit graph

285 commits

Author SHA1 Message Date
Simon Hausmann
01c3347d19 Make fluent the new default style
It's not ugly :-)
2021-08-10 15:56:38 +02:00
Tobias Hunger
9dcd107e84 Janitor: Fix clippy::single_match 2021-08-09 13:19:34 +02:00
Olivier Goffart
16325d5474 Remove dbg! 2021-08-09 12:40:21 +02:00
Olivier Goffart
8728052578 Fix panic when typing into the line edit in the gallery
The problem was that the item array's parent was not properly
computed. Leading to corrupted item when getting the parent of the
focus item.
2021-08-09 12:00:17 +02:00
Olivier Goffart
c58ffe1589 Better panic message when we reference a property that does not exist 2021-08-06 15:58:13 +02:00
Tobias Hunger
04738a900f Janitor: Fix clippy::map_clone 2021-08-04 22:50:35 +02:00
Tobias Hunger
ce976a1dbb Janitor: Fix clippy::useless_conversion 2021-08-04 22:50:35 +02:00
Tobias Hunger
c74565a883 Janitor: Fix clippy::needless_return 2021-08-04 22:50:35 +02:00
Tobias Hunger
24a2021226 Janitor: Fix clippy::needless_borrow 2021-08-04 22:50:35 +02:00
Simon Hausmann
29f5853332 Provide sixtyfps::Window by reference in the Rust API
This also removes Clone from the Window again, to avoid having to face
the question: Does cloning a window duplicate it on the screen?
2021-08-03 10:32:04 +02:00
Olivier Goffart
6a32a8b37a Don't error on empty documents 2021-07-29 17:40:20 +02:00
Olivier Goffart
ba32777cab Refactoring: move the animation in the PropertyBinding struct
Since they always belong together.

This will help for issue #193
2021-07-23 15:25:53 +02:00
Tobias Hunger
97be634b9b Janitor: Fix clippy::match_like_matches_macro 2021-07-23 13:48:52 +02:00
Tobias Hunger
3e0534afea Janitor: Fix clippy::needless_lifetimes 2021-07-23 13:48:52 +02:00
Tobias Hunger
8b022cd917 Janitor: Fix remaining instance of clippy::iter_cloned_collect 2021-07-21 19:44:57 +02:00
Simon Hausmann
1c285694d7 internal cleanup: Remove the use of ComponentWindow in the interpreter 2021-07-21 17:41:12 +02:00
Simon Hausmann
77ea5b7a15 API cleanup: hide the rest of the ComponentWindow "internals" 2021-07-21 17:41:12 +02:00
Simon Hausmann
4c1d9dc03e internal cleanup: Remove the poup functions from ComponentWindow
Use WindowHandleAccess instead. Also the clone()
isn't needed anymore since the function take a self reference instead of an Rc<Self> by value.
2021-07-21 17:41:12 +02:00
Simon Hausmann
e005058285 internal cleanup: remove free_graphics_resource from the public ComponentWindow API
Use the WindowHandleAccess backdoor instead.
2021-07-21 17:41:12 +02:00
Simon Hausmann
492af0f67c Rename the implementation of the Window item to WindowItem
If we were to add `sixtyfps:🪟:Window` to the re_exports, then
this clashes. We might rename the former, but this is a cleaner naming
in any case.

Relates to #333
2021-07-20 17:50:17 +02:00
Tobias Hunger
efc0d63e8b Janitor: iter().cloned().collect() on a slice to create a Vec == to_vec()
This is clippy::iter_cloned_collect
2021-07-15 07:55:06 +02:00
Olivier Goffart
a987b225b5 Collect all used components before inlining
And do some passes before inlining

We will need the list of components before inlining in order to generate
them if we disable inlining

So we can do some passes on each component before they are inlining

I tried to put the flickable pass in that list, but it did not work
if the Flickable itself is the root of a component
2021-07-07 17:58:43 +02:00
Olivier Goffart
13bd828b96 Update license date 2021-07-02 15:55:54 +02:00
Simon Hausmann
53ef31f0c1 Fix wrong text rendering with popups in the interpreter and the GL backend
The interpreter created an intermediate window for the component but
the regular parent window is used for rendering. This resulted in the situation
where the layout computation was done before rendering with the intermediate window,
the text layout was calculated and cached in the Text's cached rendering data.
That in turn is just an index into the window's rendering cache (arena),
which is also later used for rendering. The index is local to the window, so
during layout the index was assigned for the intermediate window and
when rendering it seemed valid and happened to also refer to a Text item in the
cache of the real window, but with the wrong size/data.

Fixes #278
2021-06-29 11:27:33 +02:00
Tobias Hunger
13d7f5e7bd Janitor: Fix typos in comments and user-facing strings
Also adapt tests for error messages containing the fixed strings.

No behavior change is intended!
2021-06-28 08:32:25 +02:00
Tobias Hunger
c482cd7a29 Janitor: Fix typo in local function name
No behavior change is intended!
2021-06-28 08:32:00 +02:00
Tobias Hunger
87460c4ac8 Janitor: Fix typo in struct field name
No behavior change is intended here!
2021-06-28 08:32:00 +02:00
Simon Hausmann
596912a521 Fix panic in preview.html when loading images
Binding expressions may end up calling sixtyfps::Image:size(), which
requires a graphics backend to be set.

The wasm interpreter code path circumvents the
sixtyfps_corelib::backend::instance_or_init call and went straight to
the GL backend, so we need an extra call to ensure its creation.
2021-06-21 15:09:01 +02:00
Olivier Goffart
a97bcd5ae1 Use BTreeMap unstead of HashMap to store the bindings
Because the order is important to keep deterministic error and output
2021-06-18 21:47:00 +02:00
Olivier Goffart
deaa0fddb0 WIP layout: split vertical and horizontal cache
Split the vertical and horizontal pass into different property cache
This will allow to implement "height for with"

This patch does not port the Rust or C++ binding yet
2021-06-16 15:14:07 +02:00
Olivier Goffart
522e78915f Fix the tests 2021-06-07 20:40:36 +02:00
Olivier Goffart
ce34ff87d0 Finish support for callback aliases
cc #111
2021-06-07 20:40:36 +02:00
Olivier Goffart
4b00f42324 Fix clicking on the home page in the interpreted printerdemo
Turns out the declared `clicked` callback was overriding the TouchArea one
since the refctor of the interpreted global components
2021-05-28 18:32:05 +02:00
Olivier Goffart
0b3fecf300 WIP: API to expose image loading from C++ and Rust 2021-05-28 17:05:16 +02:00
Olivier Goffart
4584c40544 Rename items::Image to ImageItem
Because there will be soon a sixtyfps::Image and the names
can't clash
2021-05-28 17:05:16 +02:00
Olivier Goffart
236011d17c Make ComponentDefinition::properties only list the public properties as it should
Fixes #242
2021-05-25 15:48:22 +02:00
Olivier Goffart
edfa6319b2 Fix alias to globals with the interpreter 2021-05-21 16:03:57 +02:00
Olivier Goffart
896336c5c6 interpreter: Make GlobalComponent actual dynamic component
Will be required to fix the bug setting two way binding to global
poprerties
2021-05-21 15:25:56 +02:00
Olivier Goffart
2265dd04e4 interpreter: wrap ComponentDescription in a ErasedComponentDescription
I'll need that for globals
2021-05-21 12:25:37 +02:00
Olivier Goffart
2a1c7a9154 Mark aliased property of public api as set
So we don't optimize away binding that points to them

Fix the two_way_simple.60 test
2021-05-20 13:40:51 +02:00
Olivier Goffart
ff368db505 Interpreter: make sure that the properties are initialized in the right order 2021-05-20 13:40:51 +02:00
Olivier Goffart
fbdbe69fe7 Window: make hight and width fixed size, preferred-* property set the initial size
Issue #227
2021-05-18 10:23:06 +02:00
Olivier Goffart
720001a223 Remove the solve_layout from the component vtable
no longer required
2021-05-11 14:59:57 +02:00
Olivier Goffart
f6b71b36a7 Interpreter: fix layout_info for repeated component
We need to look at the layout_info_prop of the root element
2021-05-11 14:59:57 +02:00
Olivier Goffart
b463e3cca4 WIP refactor layout
This commit add support for the box layout
2021-05-11 14:59:57 +02:00
Olivier Goffart
21a80f4562 WIP: Layout refactoring
Instead of using a solve_layout function in the component, use property to hold
a layout cache.

This commit only implement the GridLayout and only the interpreter part
2021-05-11 14:59:57 +02:00
Olivier Goffart
91ed04a72c Make length (still the default for all property) be the logical length
And a new `physical_length` is now the physical_length unit

Note: this does not change the runtime part yet
2021-04-21 17:15:19 +02:00
Olivier Goffart
7ae850d564 Rename Type::Length -> Type::PhysicalLength 2021-04-21 17:15:19 +02:00
Olivier Goffart
ba2f2d5719 Add an Opacity element that does nothing 2021-04-15 10:17:52 +02:00
Olivier Goffart
a712f515fa Make the viewport element of the flickable a real Element in the object_tree 2021-04-09 19:14:48 +02:00