Add character wrapping for Qt Backend

This adds a new wrapping mode called `char-wrap`, which allows for wrapping at any character.
Currently, it only supports the Qt backend, with the other backends falling back to `word-wrap` when this option is selected.
This commit is contained in:
Daniel Stuart 2024-06-09 15:40:00 -03:00 committed by Simon Hausmann
parent eb60c26398
commit 9f63d157d1
13 changed files with 66 additions and 28 deletions

View file

@ -61,7 +61,7 @@ export component TextEditBase inherits Rectangle {
y: root.scroll-view-padding;
width: parent.width - 2 * root.scroll-view-padding;
height: parent.height - 2 * root.scroll-view-padding;
viewport-width: root.wrap == TextWrap.word-wrap ? self.visible-width : max(self.visible-width, text-input.preferred-width);
viewport-width: root.wrap == TextWrap.no-wrap ? max(self.visible-width, text-input.preferred-width) : self.visible-width;
viewport-height: max(self.visible-height, text-input.preferred-height);
text-input := TextInput {