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

@ -116,6 +116,7 @@ SettingItem
}
return UM.Theme.getColor("setting_control");
}
radius: UM.Theme.getSize("setting_control_radius").width
border.width: UM.Theme.getSize("default_lining").width
border.color:
{
@ -148,20 +149,18 @@ SettingItem
elide: Text.ElideRight
verticalAlignment: Text.AlignVCenter
background: Rectangle
background: UM.RecolorImage
{
id: swatch
height: Math.round(UM.Theme.getSize("setting_control").height / 2)
height: Math.round(parent.height / 2)
width: height
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
anchors.margins: Math.round(UM.Theme.getSize("default_margin").width / 4)
border.width: UM.Theme.getSize("default_lining").width
border.color: enabled ? UM.Theme.getColor("setting_control_border") : UM.Theme.getColor("setting_control_disabled_border")
radius: Math.round(width / 2)
anchors.rightMargin: UM.Theme.getSize("thin_margin").width
sourceSize.width: width
sourceSize.height: height
source: UM.Theme.getIcon("extruder_button")
color: control.color
}
}
@ -215,20 +214,18 @@ SettingItem
verticalAlignment: Text.AlignVCenter
rightPadding: swatch.width + UM.Theme.getSize("setting_unit_margin").width
background: Rectangle
background: UM.RecolorImage
{
id: swatch
height: Math.round(UM.Theme.getSize("setting_control").height / 2)
height: Math.round(parent.height / 2)
width: height
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
anchors.margins: Math.round(UM.Theme.getSize("default_margin").width / 4)
border.width: UM.Theme.getSize("default_lining").width
border.color: enabled ? UM.Theme.getColor("setting_control_border") : UM.Theme.getColor("setting_control_disabled_border")
radius: Math.round(width / 2)
anchors.rightMargin: UM.Theme.getSize("thin_margin").width
sourceSize.width: width
sourceSize.height: height
source: UM.Theme.getIcon("extruder_button")
color: control.model.getItem(index).color
}
}