CURA-4303 infill slider icon color, border, alignment

This commit is contained in:
ChrisTerBeke 2017-09-21 14:28:22 +02:00
parent 4d99fb067f
commit cdc1b9ba66

View File

@ -509,21 +509,23 @@ Item
} }
} }
Item Rectangle
{ {
id: infillIcon id: infillIcon
width: (infillCellRight.width / 5) - (UM.Theme.getSize("sidebar_margin").width) width: (parent.width / 5) - (UM.Theme.getSize("sidebar_margin").width)
height: width height: width
anchors.right: infillCellRight.right anchors.right: parent.right
anchors.top: infillSlider.top anchors.top: parent.top
anchors.topMargin: UM.Theme.getSize("sidebar_margin").height / 2
// we loop over all density icons and only show the one that has the current density and steps // we loop over all density icons and only show the one that has the current density and steps
Repeater Repeater
{ {
id: infillIconList id: infillIconList
model: infillModel model: infillModel
anchors.fill: parent
property int activeIndex: { property int activeIndex: {
for (var i = 0; i < infillModel.count; i++) { for (var i = 0; i < infillModel.count; i++) {
@ -541,20 +543,21 @@ Item
return -1 return -1
} }
Item { Rectangle
{
anchors.fill: parent anchors.fill: parent
visible: infillIconList.activeIndex == index
Rectangle { border.width: UM.Theme.getSize("default_lining").width
border.color: UM.Theme.getColor("quality_slider_available")
UM.RecolorImage {
anchors.fill: parent anchors.fill: parent
visible: infillIconList.activeIndex == index anchors.margins: 2
sourceSize.width: width
UM.RecolorImage { sourceSize.height: width
anchors.fill: parent source: UM.Theme.getIcon(model.icon)
sourceSize.width: width color: UM.Theme.getColor("quality_slider_unavailable")
sourceSize.height: width
source: UM.Theme.getIcon(model.icon)
color: UM.Theme.getColor("quality_slider_available")
}
} }
} }
} }