Replies: 2 comments
-
Could you perhaps use word-wrap on the Text so that it would be several lines? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hello,
Each move notation is independent and can be highlighted and clicked (and
perhaps tooltip-able in a next version).
For that they are put in different elements (see attached slint code).
this part :
```
for move in chess_move.moves : Rectangle {
HorizontalLayout {
Text {
text: move-desc(move);
}
Text {
text: MoveTreeModel.nag-str(move.nag);
}
Text {
text: " " + move.comment;
}
}
ta := TouchArea {
}
background: ta.has-hover ? #f5d4d4 : root.background;
}
```
so each line is not composed of a single Text control but a list of Rectangle containing several texts
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, I'm trying to implement a pgn reader in rust/slint where the user would be able to see chess positions accross different variants. I have the chessboard working fine and I've used the list view + the hack described here to make a tree view out of it. That part is working fine too.
Each item of my list view is a collection of moves. I've used an horizontal layout to display them :
now the problem is that if, in a variant, the list of moves is too long, it will be cut. See screenshot attached
if you look at the last line, there's more to display, but the listview does not have an horizontal scrollbar (which I think is better in my case). However, I'd still like to be able to see my entire line displayed.
Ideally, I'd like to keep a layout but have it automatically create a new row when all the horizontal display area has been consumed. It would be a little bit like if I was editing some text : when the sentence is too long it would insert a new line and render the rest of the text there.
Is there a solution for this ?
PS : love slint so far !
Beta Was this translation helpful? Give feedback.
All reactions