Replies: 2 comments 1 reply
-
Since we allowed indexed access into a model, I wonder if we should also permit indexed access into the items for a VerticalLayout {
for i in 10: Text {
text: i;
}
Button {
text: "Click me";
clicked => {
// I want to change the text of the 3rd Text item here...
}
}
} perhaps it could look like this: VerticalLayout {
text_items := for i in 10: Text {
text: i;
}
Button {
text: "Click me";
clicked => {
text_items[3].text = "Pressed";
}
}
} |
Beta Was this translation helpful? Give feedback.
-
I've implemented a simple prototype that provides basic spatial navigation: https://github.com/dngulin/slint-spatial-focus
UPD: See below. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm working on a project with game pad input (mapped to keyboard events), and I would like to implement focus traversal with arrow keys.
For fixed layouts I can do something like this:
But this approach doesn't work if I create items from a model or in a for loop. It also requires to write a lot of boilerplate code.
It would be great to have API to handle focus movement keys in the parent
FocusScope
:And use it this way:
I think it is implemented in a similar way for
Tab
/Shift+Tab
but internally.Beta Was this translation helpful? Give feedback.
All reactions