-
Notifications
You must be signed in to change notification settings - Fork 188
Use PrimaryColor for floating watermark on TextBox #427
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
base: main
Are you sure you want to change the base?
Conversation
Indeed, floating watermark wasn't styled at all, I didn't know it exists. However, the current styling show problems, primarly because of the box size variation when starting to type that is not acceptable, because the textbox control remains an input control. So I have this proposition to handle the floating style : |
Yes, avalonia hides floating watermark if the input is null. This shouldn't be the default at all, it should allow us to configure the default behaviour: Username | Password As you type in the watermarks are going into labels, meaning now username have a label but all others don't, until you fill them. My suggestion: Leave floating watermark as it is, fix styling, and maybe remove the null-hide condition. This route also allows to have a label and a different watermark something like this:
While your concept lock us into use watermark only for label. |
We don't want to handle labels in the textbox style, it's the dev responsability to handle it as he wants, using a stackpanel and textblock for example. I merged my concept because I had simplified the style tree, so it's a better starting point anyway. I'm not against thinking about a style like this : But we need a better concept, especially about height variation. The last option is to force a bigger height on the floating textboxes but it will be ugly too. We need something better. |
I agree, however your solution does look like a label. If labels could be handed by extension, the only wise strategy was to stack vertically, as the horizontally will not align with multiple inputs.
IMO I think we should stick with avalonia concept of floatingWatermark but instead of hide when Text is null/empty, it's always visible, this will solve the dynamic height problem. In my mind doesn't make sense to hide it when text is empty because we are losing information in those case. |
Current style:
This PR:
Avalonia fluent theme follows same applying the primary color to floating watermark: