slint-ui / slint

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

`TextInput`'s selection colors should depend on style #6326

Closed Enyium closed 2 days ago

Enyium commented 6 days ago

There's no dedicated widget equivalent to the built in element Text. It's used en masse alongside widgets. So, you can expect for it to render according to the applying style with the appropriate Palette colors or whatever. And, in fact, its docs say:

color (in brush): The color of the text. (default value: depends on the style)

For the built in TextInput's color, the same is documented. But its selection-background-color and selection-foreground-color are improper, not style-related colors (in all styles):

text-input-builtin

I want to use TextInput with read-only: true; as a Text alternative that allows the end user to select and copy the text.

TextInput should behave like the TextEdit widget with regard to its selection colors:

text-edit-widget

FloVanGH commented 6 days ago

Hi and thank you for the report. That is definitively a bug and should work as you described.