Enhancement: Add Disabled and Error states for UI elements
Enhancement request:
What should be added/changed?
UI elements should have the following added to them:
- a
disabledproperty to turn interaction on and off - disabled visual style option to configure their disabled appearances
- An error visual state to reflect that the current input is incorrect
- some method of tracking the current error
What would it help with?
Any game or application state where buttons are not currently enabled, or needs to highlight what is wrong with user input.
For a concrete example of the disabled state, it would be useful for a turn-based game where the player at the keyboard sometimes cannot take certain actions, such as when it is another player or a bot's turn.
Disable state implemented.
While a general error state might be interesting, it makes the most sense for components, which allow user input. Which is especially the UITextInput.
UITextInput does not support any style at the moment. So it would make sense to add the error and disabled state especially for this widget, with support for styling in general. I will dump some thoughts on this.
Not sure, which attributes should be changed by style and which by property.
I think an error state may still make sense for other widgets. For example, if you had two incompatible options selected and wanted to highlight this to the user.