mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-25 07:33:57 -06:00
Use border only on active state
Contributes to issue CURA-9217.
This commit is contained in:
parent
35f5c3f959
commit
97e2d6a432
8 changed files with 65 additions and 29 deletions
|
@ -91,12 +91,12 @@ UM.TooltipArea
|
|||
{
|
||||
anchors.fill: parent
|
||||
|
||||
borderColor: (textFieldWithUnit.hovered || textFieldWithUnit.activeFocus) ? UM.Theme.getColor("text_field_border_hovered") : "transparent"
|
||||
borderColor: textFieldWithUnit.activeFocus ? UM.Theme.getColor("text_field_border_active") : "transparent"
|
||||
liningColor:
|
||||
{
|
||||
if (!textFieldWithUnit.enabled)
|
||||
{
|
||||
return UM.Theme.getColor("setting_control_disabled_border")
|
||||
return UM.Theme.getColor("setting_control_disabled_border");
|
||||
}
|
||||
switch (propertyProvider.properties.validationState)
|
||||
{
|
||||
|
@ -109,11 +109,15 @@ UM.TooltipArea
|
|||
return UM.Theme.getColor("setting_validation_warning")
|
||||
}
|
||||
// Validation is OK.
|
||||
if (textFieldWithUnit.hovered || textFieldWithUnit.activeFocus)
|
||||
if(textFieldWithUnit.activeFocus)
|
||||
{
|
||||
return UM.Theme.getColor("text_field_border_hovered")
|
||||
return UM.Theme.getColor("text_field_border_active");
|
||||
}
|
||||
return UM.Theme.getColor("border_field_light")
|
||||
if(textFieldWithUnit.hovered)
|
||||
{
|
||||
return UM.Theme.getColor("text_field_border_hovered");
|
||||
}
|
||||
return UM.Theme.getColor("border_field_light");
|
||||
}
|
||||
|
||||
color:
|
||||
|
|
|
@ -129,7 +129,6 @@ Item
|
|||
background: UM.UnderlineBackground
|
||||
{
|
||||
id: backgroundItem
|
||||
borderColor: intentSelection.hovered ? UM.Theme.getColor("text_field_border_hovered") : "transparent"
|
||||
liningColor: intentSelection.hovered ? UM.Theme.getColor("text_field_border_hovered") : UM.Theme.getColor("border_field_light")
|
||||
}
|
||||
|
||||
|
|
|
@ -125,18 +125,22 @@ SettingItem
|
|||
}
|
||||
return UM.Theme.getColor("setting_control")
|
||||
}
|
||||
borderColor: (base.hovered || control.activeFocus) ? UM.Theme.getSize("text_field_border_hovered") : "transparent"
|
||||
borderColor: control.activeFocus ? UM.Theme.getSize("text_field_border_active") : "transparent"
|
||||
liningColor:
|
||||
{
|
||||
if (!enabled)
|
||||
if(!enabled)
|
||||
{
|
||||
return UM.Theme.getColor("setting_control_disabled_border")
|
||||
return UM.Theme.getColor("setting_control_disabled_border");
|
||||
}
|
||||
if (base.hovered || control.activeFocus)
|
||||
if(control.activeFocus)
|
||||
{
|
||||
return UM.Theme.getColor("text_field_border_hovered")
|
||||
return UM.Theme.getColor("text_field_border_active");
|
||||
}
|
||||
return UM.Theme.getColor("border_field_light")
|
||||
if(base.hovered)
|
||||
{
|
||||
return UM.Theme.getColor("text_field_border_hovered");
|
||||
}
|
||||
return UM.Theme.getColor("border_field_light");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -126,18 +126,22 @@ SettingItem
|
|||
}
|
||||
return UM.Theme.getColor("setting_control")
|
||||
}
|
||||
borderColor: (base.hovered || control.activeFocus) ? UM.Theme.getColor("text_field_border_hovered") : "transparent"
|
||||
borderColor: control.activeFocus ? UM.Theme.getColor("text_field_border_active") : "transparent"
|
||||
liningColor:
|
||||
{
|
||||
if (!enabled)
|
||||
if(!enabled)
|
||||
{
|
||||
return UM.Theme.getColor("setting_control_disabled_border")
|
||||
return UM.Theme.getColor("setting_control_disabled_border");
|
||||
}
|
||||
if (base.hovered || control.activeFocus)
|
||||
if(control.activeFocus)
|
||||
{
|
||||
return UM.Theme.getColor("text_field_border_hovered")
|
||||
return UM.Theme.getColor("text_field_border_active");
|
||||
}
|
||||
return UM.Theme.getColor("border_field_light")
|
||||
if(base.hovered)
|
||||
{
|
||||
return UM.Theme.getColor("text_field_border_hovered");
|
||||
}
|
||||
return UM.Theme.getColor("border_field_light");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -32,12 +32,12 @@ SettingItem
|
|||
|
||||
anchors.fill: parent
|
||||
|
||||
borderColor: (hovered || input.activeFocus) ? UM.Theme.getColor("text_field_border_hovered") : "transparent"
|
||||
borderColor: input.activeFocus ? UM.Theme.getColor("text_field_border_active") : "transparent"
|
||||
liningColor:
|
||||
{
|
||||
if(!enabled)
|
||||
{
|
||||
return UM.Theme.getColor("text_field_border_disabled")
|
||||
return UM.Theme.getColor("text_field_border_disabled");
|
||||
}
|
||||
switch(propertyProvider.properties.validationState)
|
||||
{
|
||||
|
@ -51,11 +51,15 @@ SettingItem
|
|||
return UM.Theme.getColor("setting_validation_warning");
|
||||
}
|
||||
//Validation is OK.
|
||||
if(hovered || input.activeFocus)
|
||||
if(input.activeFocus)
|
||||
{
|
||||
return UM.Theme.getColor("text_field_border_hovered")
|
||||
return UM.Theme.getColor("text_field_border_active");
|
||||
}
|
||||
return UM.Theme.getColor("text_field_border")
|
||||
if(hovered)
|
||||
{
|
||||
return UM.Theme.getColor("text_field_border_hovered");
|
||||
}
|
||||
return UM.Theme.getColor("text_field_border");
|
||||
}
|
||||
|
||||
color: {
|
||||
|
|
|
@ -31,12 +31,22 @@ ComboBox
|
|||
},
|
||||
State
|
||||
{
|
||||
name: "highlighted"
|
||||
when: base.hovered || control.hovered || control.activeFocus
|
||||
name: "active"
|
||||
when: control.activeFocus
|
||||
PropertyChanges
|
||||
{
|
||||
target: background
|
||||
borderColor: UM.Theme.getColor("text_field_border_active")
|
||||
liningColor: UM.Theme.getColor("text_field_border_active")
|
||||
}
|
||||
},
|
||||
State
|
||||
{
|
||||
name: "highlighted"
|
||||
when: (base.hovered || control.hovered) && !control.activeFocus
|
||||
PropertyChanges
|
||||
{
|
||||
target: background
|
||||
borderColor: UM.Theme.getColor("text_field_border_hovered")
|
||||
liningColor: UM.Theme.getColor("text_field_border_hovered")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,14 +44,24 @@ TextField
|
|||
PropertyChanges { target: backgroundRectangle; color: UM.Theme.getColor("setting_validation_error_background")}
|
||||
},
|
||||
State
|
||||
{
|
||||
name: "active"
|
||||
when: control.activeFocus
|
||||
PropertyChanges
|
||||
{
|
||||
target: backgroundRectangle
|
||||
liningColor: UM.Theme.getColor("text_field_border_active")
|
||||
borderColor: UM.Theme.getColor("text_field_border_active")
|
||||
}
|
||||
},
|
||||
State
|
||||
{
|
||||
name: "hovered"
|
||||
when: control.hovered || control.activeFocus
|
||||
when: control.hovered && !control.activeFocus
|
||||
PropertyChanges
|
||||
{
|
||||
target: backgroundRectangle
|
||||
liningColor: UM.Theme.getColor("text_field_border_hovered")
|
||||
borderColor: UM.Theme.getColor("text_field_border_hovered")
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
|
@ -363,7 +363,8 @@
|
|||
|
||||
"text_field": "background_1",
|
||||
"text_field_border": [180, 180, 180, 255],
|
||||
"text_field_border_hovered": "border_accent_2",
|
||||
"text_field_border_hovered": "border_main",
|
||||
"text_field_border_active": "border_accent_2",
|
||||
"text_field_border_disabled": "background_2",
|
||||
"text_field_text": "text_default",
|
||||
"text_field_text_disabled": "text_disabled",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue