Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FR: Add a blinking cursor for uiTextInput when user clicks on it #2150

Open
Kietyo opened this issue Feb 15, 2024 · 1 comment · May be fixed by #2154
Open

FR: Add a blinking cursor for uiTextInput when user clicks on it #2150

Kietyo opened this issue Feb 15, 2024 · 1 comment · May be fixed by #2154

Comments

@Kietyo
Copy link
Contributor

Kietyo commented Feb 15, 2024

Currently when u click in the input, no blinking cursor appears so it's not clear if it's currently being focused on.

Example when I click the text input for "Login" (no blinking cursor so u can't tell):

image
@soywiz
Copy link
Member

soywiz commented Feb 15, 2024

Feel free to make a PR:

Here's the relevant code:

private val caret = caretContainer.debugVertexView().also {
it.blendMode = BlendMode.INVERT
it.visible = false
}
var padding: Margin = Margin(3f, 2f, 2f, 2f)
set(value) {
field = value
onSizeChanged(this)
}
init {
closeables += textView.onNewAttachDetach(onAttach = {
this.stage.uiFocusManager
})
onSizeChanged(this)
}

Since you have the container view, you can attach an interval there that will be disposed automatically. That interval can change the alpha from 0 to 1 at the required interval. visible = true/false could be used but it is already used internally, while alpha is not.

@soywiz soywiz added this to Korlibs Feb 15, 2024
@github-project-automation github-project-automation bot moved this to Backlog in Korlibs Feb 15, 2024
@Kietyo Kietyo linked a pull request Feb 19, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Pending
Development

Successfully merging a pull request may close this issue.

2 participants