Commit graph

39 commits

Author SHA1 Message Date
Olivier Goffart
11dea135f7 Domain: slint-ui.com -> slint.dev 2023-06-16 10:55:08 +02:00
Aurindam Jana
039e54a5de
Add royalty free license to files except examples and docs (#2888) 2023-06-15 11:20:50 +02:00
Tobias Hunger
3ac01c3f07 clippy: Fix clippy warnings 2023-03-09 09:35:29 +01:00
Olivier Goffart
39aebc1f4e Use the std::ops::Range as range in the repeater
And fix the preview highlight to use that
2022-11-17 12:23:23 +01:00
Olivier Goffart
0d39e6f721 Make use of ItemRc::map_to_window 2022-11-17 12:23:23 +01:00
Simon Hausmann
c11b4305c1 Change Item::geometry() to return a LogicalRect 2022-10-13 17:02:18 +02:00
Simon Hausmann
8cba0622f5 Initial input method support for the winit backend and the FemtoVG/Skia renderers
Known caveats:

- winit doesn't forward mouse events to the IME, so clicking
  with the mouse while composing results in funny effects such
  as the pre-edit text following the cursor.
- With FemtoVG there's no text decoration support, thus no underlining
  of the preedit area.
2022-10-07 11:16:36 +02:00
Simon Hausmann
9d421de47d Remove remaining uses of LogicalRect::from_untyped 2022-09-30 13:00:37 +02:00
Simon Hausmann
cc8ff56d98 Remove more uses of LogicalRect::from_untyped() 2022-09-30 13:00:37 +02:00
Olivier Goffart
f91eac320d Refactor the mouse handling
Just make a single recursive function, it is easier to read than using
the visitor helper with a post and pre visit.

Also remove that function that visits with a post and pre visit as it is
no longer used
2022-09-16 08:45:46 +02:00
Simon Hausmann
fa956aca2d janitor: Fix nightly doc warnings about unused parentheses 2022-08-05 09:25:31 +02:00
Simon Hausmann
a5cd0a7173 Simplify window item interaction in the core library
Simlify the borrow_pin / downcast_pin dance a little by using VRcMapped.
2022-07-22 23:09:08 +02:00
Olivier Goffart
dfc87e7c33 Janitor: cleanup a function
no need to have two separate function for clipping items
2022-06-18 22:31:38 +02:00
Tobias Hunger
07ad20a09c
Basic Slint accessibility support (#1294)
Implement basic accessibility (a11y) support, using the Qt backend.

_This should get us started, but accessibility support is an additional way to interact with UIs that is very different from the "graphical way" most users will interact with the UI. No single PR will "make a toolkit accessibility", this needs to be an ongoing effort!_

Parts of this PR:

* Add functions to access a11y-related properties to Component
* Add helper functions to Item struct 
* Handle accessible- properties in the compiler
* Add documentation, add description, enforce some basic rules
* Make the Text element accessible by default
* Don't optimize away accessibility property in the LLR
* Ensure that accessibility property are marked as used
* Add some accessibility properties to the native style widgets
* Support for bool and integer `accessible` properties
* Implement basic support for accessibility
* Make basic widgets accessible by default
* Make slider focus-able and interactable with keyboard
* Tell a11y layer about value changes
* Generate QAccessible constants using bindgen
* Don't expose the `accessible` properties when using the MCU backend: There is no backend to make use of them
* Handle focus change based on keyboard focus of the window
* Report accessible widgets at correct positions
* Allow for (virtual) focus delegation at the a11y level
* Calculate value step size dynamically
* Make sure to not send notifications to a11y backend about dead objects
2022-06-08 20:42:10 +02:00
Tobias Hunger
55249c90de janitor: fix redundant clones 2022-05-22 11:59:00 +02:00
Tobias Hunger
186e7c0ff2
Fix focus of next item with empty components (#1247)
Handle empty components in the item tree when looking for the next item
to focus.
2022-05-09 12:46:10 +02:00
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)