mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-23 22:54:01 -06:00
Add rounded corners to the settings
Contributes to CURA-5941
This commit is contained in:
parent
4e9c595bdd
commit
d3b5b2717d
6 changed files with 81 additions and 75 deletions
|
@ -19,8 +19,9 @@ SettingItem
|
|||
|
||||
model: Cura.ExtrudersModel
|
||||
{
|
||||
onModelChanged: {
|
||||
control.color = getItem(control.currentIndex).color;
|
||||
onModelChanged:
|
||||
{
|
||||
control.color = getItem(control.currentIndex).color
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -113,14 +114,15 @@ SettingItem
|
|||
{
|
||||
if (!enabled)
|
||||
{
|
||||
return UM.Theme.getColor("setting_control_disabled");
|
||||
return UM.Theme.getColor("setting_control_disabled")
|
||||
}
|
||||
if (control.hovered || base.activeFocus)
|
||||
{
|
||||
return UM.Theme.getColor("setting_control_highlight");
|
||||
return UM.Theme.getColor("setting_control_highlight")
|
||||
}
|
||||
return UM.Theme.getColor("setting_control");
|
||||
return UM.Theme.getColor("setting_control")
|
||||
}
|
||||
radius: UM.Theme.getSize("setting_control_radius").width
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
border.color:
|
||||
{
|
||||
|
@ -153,20 +155,18 @@ SettingItem
|
|||
elide: Text.ElideLeft
|
||||
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
|
||||
}
|
||||
}
|
||||
|
@ -219,20 +219,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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue