snowkit / mint

A framework/renderer agnostic Minimal UI interface library for Haxe.
http://snowkit.github.io/mint/
MIT License
65 stars 19 forks source link

Some improvement on TextEdit #40

Closed Blist closed 8 years ago

Blist commented 8 years ago

I work on my game, on I found some miss feature on TextEdit.

For the first, i've make some thing on mint.TextEdit. I've add an another label, placeholder, and I only show it if text of TextEdit is empty. Is it in the philosophy of mint ?

ruby0x1 commented 8 years ago

Thanks for the thoughts.

placeholder
The placeholder is something that I think needs to be handled carefully, I am working on a way to allow additions without making the code bloated with lots of features. For textedit especially, it is very soon thousands of lines and trying to solve every use case for text. This is not what the library is designed to do well, it's meant to be minimal.

For now it's best to put the placeholder as a separate label, you can still parent the label to the text edit and listen for the focus events from your external code.

text view specifics
This is an issue yea, and something I'm considering the best options for. But it's important to note: This specific behaviour is handled by the rendering, mint doesn't know anything about the text or how it's drawn. It's simply logic only, and tells the rendering what changes are happening so it can update the visuals. This means that mint itself can't solve this issue, only the renderer can. I have some thoughts on making this a bit easier but it's not an issue that can be solved here for now.

Thanks!