Commit graph

23 commits

Author SHA1 Message Date
Olivier Goffart
2a55daff32 Focus: fix looping in repeater when the repeater ends with a repeater 2022-04-29 17:27:59 +02:00
Olivier Goffart
36313e8182 Fix focus navigation involving repeater at the end of the chain
The parent_node function doesn't reset its argument if it is already
set while calling the function
2022-04-29 16:35:46 +02:00
Olivier Goffart
da82ecf29e janitor: Remove outdated comment 2022-04-26 08:10:35 +02:00
Tobias Hunger
ddc21cb8e5
Make ItemRc::parent_item(...) return an Option<ItemRc> (#1189) 2022-04-22 14:27:34 +02:00
Tobias Hunger
a9bb0065b0 Fix forward focus movement with nested components
This used to pick the wrong node, which was then detected as a
focus loop, which in turn prevented the window from moving focus
forward.
2022-04-22 12:05:32 +02:00
Tobias Hunger
3404a20135 Split up tests to get a better overview over issues 2022-04-22 12:05:32 +02:00
Tobias Hunger
4611c33470 Add test case for nested component focus traversal 2022-04-22 12:05:32 +02:00
Tobias Hunger
416aa42d90 Component: Replace parent_item to parent_node
Remove the `parent_item` function. After the recent changes that did not
return an item anymore and since the item tree is exposed, this function
was only used to find the repeater a component was created by.

So replace the old function with a new one that only returns the parent
node in the parent component.

This saves a few lines of generated code that is not used anymore.

Co-authored-by: Simon Hausmann <hausmann@gmail.com>
2022-04-20 14:29:18 +02:00
Simon Hausmann
1b656ecb0d Clean up optimization to skip layers for opacity elements 2022-04-13 17:38:56 +02:00
Olivier Goffart
1b91158b46 corelib: allow to use i32 for coordinate instead of f32 2022-04-11 17:46:50 +02:00
Olivier Goffart
17fd446905 Get rid of a call to unsafe in the test 2022-04-07 16:59:38 +02:00
Olivier Goffart
0429e11cf7 Refactor: Move ItemRc and ItemWeak to item_tree.rs
Keep items.rs for the implementation of items, and move the logic
that helprs navigating the tree to the item_tree.rs module
2022-04-07 16:59:38 +02:00
Tobias Hunger
18ea9d302b Add test for default focus chain implementation 2022-04-05 16:34:16 +02:00
Tobias Hunger
f85812135c Add some basic tests for ComponentItemTree walking 2022-04-05 16:34:16 +02:00
Tobias Hunger
03e6f104be Make ComponentItemTree::new take a ComponentRefPin 2022-03-28 14:13:36 +02:00
Tobias Hunger
c1bb22bd00 Add helper struct to work with the ItemTree reported by the Component
Just a bit of convenience code to walk the ItemTree.
2022-03-28 14:13:36 +02:00
Tobias Hunger
095537e3fd Remove item from ItemTreeNode
... and make ItemTreeNode non-generic this way.

The Item is now only in the extra ItemArray struct and we are free to
expose the ItemTree further.
2022-03-14 09:43:50 +01:00
Tobias Hunger
b95342551b Add index into item_array into ItemTreeNode 2022-03-14 09:43:50 +01:00
Tobias Hunger
227ce31992 Use component::get_item_ref to access items 2022-03-14 09:43:50 +01:00
Tobias Hunger
7210ea5448
Fix doc strings
Use singular form when refering to one child only.
2022-02-17 13:06:00 +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
Simon Hausmann
c846633708 Rename C ffi functions 2022-02-02 11:12:34 +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/item_tree.rs (Browse further)