vlang / ui

A cross-platform UI library written in V

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Password inputs behave very oddly on windows

ChildishGiant opened this issue · comments

commented

V version: 0.2.2 (787a63dab6fe1e2b2b7fbfcee61e761359ed174b)
UI version: 0.0.4 (12593da)
OS: Windows

What did you do?

import ui

struct Ab {
mut:
	z string
}

fn main() {
	mut y := &Ab{}
	window := ui.window({}, [ui.textbox(text: &y.z, is_password: true, width: 300)])
	ui.run(window)
}

What did you expect to see?
An asterisk for each character, no 0 at the end and no flashing text

What did you see instead?

4dfBnxlYNB.mp4

This is intermittent but highly reproducible

Also, in the user example (as of this writing) having written something in the password field, keeping the text cursor in it and then moving the mouse around the window, the password field will flash random characters at the end of the input.

I think the problem is this line in gg.draw_text: C.fonsDrawText(ctx.ft.fons, x * scale, y * scale, &char(text_.str), 0).
Until now, none of my attempts to fix it worked tho.