Commit graph

41 commits

Author SHA1 Message Date
Tobias Hunger
aeebbb1d96 Janitor: Fix remaining clippy::option_map_unit_fn 2021-07-21 19:44:57 +02:00
Olivier Goffart
673c0ce81c Add a as_any to the Model trait to allow getting a reference to the original model 2021-07-20 15:38:10 +02:00
Tobias Hunger
9608825eb2 Janitor: Use if let over Option::map returning () 2021-07-12 15:01:19 +02:00
Tobias Hunger
925afb2ba4 Janitor: Remove unnecessary lifetimes 2021-07-12 15:01:19 +02:00
Tobias Hunger
f24df0f94f Janitor: Typo fixes 2021-07-08 20:43:38 +02:00
Tobias Hunger
3f5ad42683 Janitor: Fix typo in comment 2021-07-08 06:47:05 +02:00
Tobias Hunger
9b929b287d Janitor: slice.iter().cloned().collect::<Vec<T>>() == slice.to_vec() 2021-07-05 09:48:29 +02:00
Olivier Goffart
13bd828b96 Update license date 2021-07-02 15:55:54 +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
ee00c9eb92 Rename maximum- and minimum- properties to max- and min-
Issue #259
2021-06-14 10:28:30 +02:00
Olivier Goffart
e7b75a2f2d ListView: Attempt to be a bit better as filling the element
Be sure to always instentiate at least enought element.
This is a problem if the items don't have the same height.

This only covers Rust and the interpreter
(The C++ code logic for the Listview currently instentiate all elements anyway)

Should help for issue #228
2021-06-01 17:27:09 +02:00
Olivier Goffart
76a42cd757 Added support for static constant z ordering
Just re-order the children at compile time
2021-05-14 16:17:34 +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
b463e3cca4 WIP refactor layout
This commit add support for the box layout
2021-05-11 14:59:57 +02:00
Olivier Goffart
9e6970abfe ListView: Fix panic when removing item that are not visible 2021-04-27 16:37:17 +02:00
Olivier Goffart
576eb116e8 Make the is_dirty flag a property so that changing it will force a repaint 2021-04-27 11:05:35 +02:00
Olivier Goffart
76befb63a3 Fix the dependency tracker not registering a dependency if it was not dirty
Also fix opening/closing the popup should refresh the window
2021-04-26 15:24:48 +02:00
Olivier Goffart
81b63c3b3f Small reformating fix 2021-02-12 09:56:37 +01:00
Simon Hausmann
d5e72b255a Fix build when structures contain models
The generated code for structs includes #[derive(Debug)],
which requires Debug for all fields. When the field is a ModelHandle
it's up to us to provide an implementation.
2021-01-25 14:20:13 +01:00
Olivier Goffart
dfa25b96f7 Rename SharedArray to SharedVector 2020-12-18 10:26:07 +01:00
Simon Hausmann
bdebb77f14 Implement Iterator for the Model in Rust 2020-12-02 12:04:32 +01:00
Simon Hausmann
276bcd6574 Implement Model for ModelHandle
This makes extracting model data out of .60 files a little easier
2020-12-01 16:14:43 +01:00
Olivier Goffart
8a64f10e84 Remove ComponentVtable::input_event
And the custom handling of the mouse grabber
2020-11-24 16:23:37 +01:00
Olivier Goffart
3f111ecd30 Fix a few doc typo 2020-11-23 11:47:16 +01:00
Simon Hausmann
89e0b57627 Rework and simplify the focus handling
Instead of determining the focus item through item tree traversal and
pointer comparison and storing the intermediate indices in the
components in the tree, remember the focus item by a pair of
VWeak<ComponentVTable, Dyn> and item_index: usize.

This speeds up determining the focus item as well as delivering events,
which can now be done directly after retrieving an ItemRef with
get_item_ref.

This also fixes the duplicate line edit focus in the 7gui cells
test case.
2020-11-20 15:33:15 +01:00
Olivier Goffart
af801b9879 Use the new get_item_ref function instead of visiting the root 2020-11-11 15:04:49 +01:00
Olivier Goffart
a1f1fcb3a6 Use VRc<ComponentVTable> in the rust generated code 2020-11-09 14:58:37 +01:00
Olivier Goffart
2ece3817cc Make ModelHandle a struct
Last commit broke for structures containing models, because models are not PartialEq.
So we need to implement PartialEq for ModelHandle. Which means a struct needs to
be created
2020-10-31 13:32:19 +01:00
Olivier Goffart
d2255327fe Properties: make sure that the falue is different before marking all dependencies dirty
Fix the animation of the gauge in the printer demo
2020-10-31 12:58:11 +01:00
Olivier Goffart
d339ead5dd support for within box layouts
Only rust implementation for now
2020-10-30 19:12:48 +01:00
Olivier Goffart
5face45c51 Rename Component::compute_layout to apply_layout
And pass the expected rectangle.
This is currently not used yet but will be needed when we can have
repeated elements within a box layout
2020-10-29 19:08:52 +01:00
Olivier Goffart
9f08492258 Make sure that the ListView is not scrolled when there is enough room for all contents
Fixes #93
2020-10-21 09:47:33 +02:00
Olivier Goffart
14198052ac ArrayModel support in JS 2020-10-17 13:33:22 +02:00
Olivier Goffart
58193ff1c3 Fix resizing of listview should recompute the layout 2020-10-16 11:09:12 +02:00
Olivier Goffart
4169254169 StandardListView in rust 2020-10-08 16:22:16 +02:00
Olivier Goffart
3bdd71b36f Start working on the Native ListView
Currently only the interpret part
2020-10-08 15:51:33 +02:00
Olivier Goffart
2314e59ab2 Refactor the repeater in the interpreter
Use the same Repeater as the rust backend
2020-10-02 21:26:47 +02:00
Olivier Goffart
1b506a1b03 Move ther model code from the rust API to the corelib
We will need it in the dynamic component
2020-10-02 18:11:35 +02:00
Olivier Goffart
58cdaeb8dd Update license header to mention that commertial option are available 2020-08-26 13:23:42 +02:00
Simon Hausmann
2823f32692 Apply license headers to all non-binary/non-json sources 2020-08-17 17:55:20 +02:00
Simon Hausmann
df4e837b04 Move model placeholder module out of abi 2020-08-04 08:27:34 +02:00
Renamed from sixtyfps_runtime/corelib/abi/model.rs (Browse further)