slint
slint copied to clipboard
Text cursor does not support corner radius
Bug Description
The Material3 specs and MacOS (images attached) support flashing text-cursors that also have a corner radius applied. This doesn't seem possible with Slint right now.
Reproducible Code (if applicable)
Environment Details
- Slint Version:
- Platform/OS:
- Programming Language:
- Backend/Renderer:
Product Impact
Cannot make components that look and behave like Material, MacOS and possibly other platforms text edit.
Is there an API that you'd propose for configuring this? Would you agree that this is a setting that's process-wide, possibly inherited from the windowing system, or do you think that this needs to be configured per text input?
Just a general question, but is there an alternative to the default pattern of an every growing list of root properties. As in it would be possible to have an api like this in the future?
TextInput {
cursor-style: {
color: blue;
width: 3px;
corner-radius: 0;
}
}
Yes that is very web like. But also its the case you often reuse certain styles over and over and being able to make several customisation objects { color: green, width: 3px } and reuse them easily across an app.
As in it would be possible to have an api like this in the future?
It's possible to have such an API today. A property <TextCursorStyle> cursor-style property.
Alternative design: make TextInput::cursor_visible property public and have something like
TextInput {
text_cursor_width: 0;
if self.cursor-visible: Rectangle {
x.parent.cursor-position.x; // Also implies a TextInput::cursor-position
y.parent.cursor-position.y;
height: // something with text metrics?
// ... do whatever you want as a design ...
}
}