Add rounded corners to the settings

Contributes to CURA-5941
This commit is contained in:
Diego Prado Gesto 2018-12-03 15:56:21 +01:00
parent 4e9c595bdd
commit d3b5b2717d
6 changed files with 81 additions and 75 deletions

View file

@ -32,6 +32,7 @@ SettingItem
anchors.fill: parent
radius: UM.Theme.getSize("setting_control_radius").width
border.width: Math.round(UM.Theme.getSize("default_lining").width)
border.color:
{
@ -81,10 +82,10 @@ SettingItem
Rectangle
{
anchors.fill: parent;
anchors.margins: Math.round(UM.Theme.getSize("default_lining").width);
anchors.fill: parent
anchors.margins: Math.round(UM.Theme.getSize("default_lining").width)
color: UM.Theme.getColor("setting_control_highlight")
opacity: !control.hovered ? 0 : propertyProvider.properties.validationState == "ValidatorState.Valid" ? 1.0 : 0.35;
opacity: !control.hovered ? 0 : propertyProvider.properties.validationState == "ValidatorState.Valid" ? 1.0 : 0.35
}
Label
@ -145,11 +146,11 @@ SettingItem
}
color: !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("setting_control_text")
font: UM.Theme.getFont("default");
font: UM.Theme.getFont("default")
selectByMouse: true;
selectByMouse: true
maximumLength: (definition.type == "str" || definition.type == "[int]") ? -1 : 10;
maximumLength: (definition.type == "str" || definition.type == "[int]") ? -1 : 10
clip: true; //Hide any text that exceeds the width of the text box.
validator: RegExpValidator { regExp: (definition.type == "[int]") ? /^\[?(\s*-?[0-9]{0,9}\s*,)*(\s*-?[0-9]{0,9})\s*\]?$/ : (definition.type == "int") ? /^-?[0-9]{0,10}$/ : (definition.type == "float") ? /^-?[0-9]{0,9}[.,]?[0-9]{0,3}$/ : /^.*$/ } // definition.type property from parent loader used to disallow fractional number entry
@ -158,7 +159,8 @@ SettingItem
{
target: input
property: "text"
value: {
value:
{
// Stacklevels
// 0: user -> unsaved change
// 1: quality changes -> saved change
@ -167,13 +169,15 @@ SettingItem
// 4: variant
// 5: machine_changes
// 6: machine
if ((base.resolve != "None" && base.resolve) && (stackLevel != 0) && (stackLevel != 1)) {
if ((base.resolve != "None" && base.resolve) && (stackLevel != 0) && (stackLevel != 1))
{
// We have a resolve function. Indicates that the setting is not settable per extruder and that
// we have to choose between the resolved value (default) and the global value
// (if user has explicitly set this).
return base.resolve;
} else {
return propertyProvider.properties.value;
return base.resolve
}
else {
return propertyProvider.properties.value
}
}
when: !input.activeFocus
@ -182,16 +186,17 @@ SettingItem
MouseArea
{
id: mouseArea
anchors.fill: parent;
anchors.fill: parent
cursorShape: Qt.IBeamCursor
onPressed: {
if(!input.activeFocus) {
base.focusGainedByClick = true;
input.forceActiveFocus();
if (!input.activeFocus)
{
base.focusGainedByClick = true
input.forceActiveFocus()
}
mouse.accepted = false;
mouse.accepted = false
}
}
}