slint-ui / slint

Slint is a declarative GUI toolkit to build native user interfaces for Rust, C++, or JavaScript apps.
https://slint.dev
Other
16.01k stars 526 forks source link

Add char-wrap functionality to text wrapping #5381

Closed danielstuart14 closed 2 weeks ago

danielstuart14 commented 3 weeks ago

As discussed in here https://github.com/slint-ui/slint/issues/5374, this PR adds the possibility of using character wrapping (aka wrap anywhere) with text. Prior to this, it was only possible to wrap at word boundaries.

This commit adds this functionality to both Qt and software renderer, with skia and femtovg missing it for now (falling back to word-wrap).

The trait RendererSealed had to be changed to pass to text_size if using this new kind of wrapping.

This was based on GTK wrap mode which has the following options:

CLAassistant commented 3 weeks ago

CLA assistant check
All committers have signed the CLA.

danielstuart14 commented 2 weeks ago

@tronical there seems to have happened an error during the Qt download for the automated tests. Is it possible to rerun the tests?

tronical commented 2 weeks ago

Yes, sure :)

tronical commented 2 weeks ago

There seems to be an overall issue with GH actions right now. I'll try again later.

tronical commented 2 weeks ago

If you’d like you can rebase your changes, but I think the CI part is fine. The failures are unrelated I think.

tronical commented 2 weeks ago

Thank you :)