mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-16 03:07:53 -06:00
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:
parent
d94956dd23
commit
5652bccc58
2 changed files with 21 additions and 2 deletions
|
@ -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")
|
||||
|
|
|
@ -81,9 +81,17 @@ QtObject {
|
|||
border.width: Theme.getSize("default_lining").width
|
||||
border.color:
|
||||
{
|
||||
if (control_enabled)
|
||||
if (control.enabled)
|
||||
{
|
||||
if (control.hovered)
|
||||
if (control.valueError)
|
||||
{
|
||||
return Theme.getColor("setting_validation_error_border");
|
||||
}
|
||||
else if (control.valueWarning)
|
||||
{
|
||||
return Theme.getColor("setting_validation_warning_border");
|
||||
}
|
||||
else if (control.hovered)
|
||||
{
|
||||
return Theme.getColor("setting_control_border_highlight");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue