Change control border colour depending on validation state

The background colour was already changing, but the border colour was only depending on the hover state.

Contributes to issue CURA-4148.
This commit is contained in:
Ghostkeeper 2017-08-21 13:56:07 +02:00
parent d94956dd23
commit 5652bccc58
No known key found for this signature in database
GPG key ID: C5F96EE2BC0F7E75
2 changed files with 21 additions and 2 deletions

View file

@ -24,6 +24,17 @@ SettingItem
{
return UM.Theme.getColor("setting_control_disabled_border")
}
switch(propertyProvider.properties.validationState)
{
case "ValidatorState.Exception":
case "ValidatorState.MinimumError":
case "ValidatorState.MaximumError":
return UM.Theme.getColor("setting_validation_error_border");
case "ValidatorState.MinimumWarning":
case "ValidatorState.MaximumWarning":
return UM.Theme.getColor("setting_validation_warning_border");
}
//Validation is OK.
if(hovered || input.activeFocus)
{
return UM.Theme.getColor("setting_control_border_highlight")