mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 09:59:00 +08: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
@ -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…
x
Reference in New Issue
Block a user