CURA-4870 Check wether the current configuration matches one of the unique configurations available on the printer output device.

Improve some elements in the UI
This commit is contained in:
Diego Prado Gesto 2018-03-05 14:39:49 +01:00
parent f779a20a6e
commit a992487589
5 changed files with 46 additions and 12 deletions

View file

@ -12,11 +12,14 @@ Rectangle
id: configurationItem
property var configuration: null
property var selected: false
signal configurationSelected()
height: childrenRect.height
border.width: UM.Theme.getSize("default_lining").width
border.color: UM.Theme.getColor("sidebar_lining_thin")
color: selected ? UM.Theme.getColor("configuration_item_active") : UM.Theme.getColor("configuration_item")
property var textColor: selected ? UM.Theme.getColor("configuration_item_text_active") : UM.Theme.getColor("configuration_item_text")
Column
{
@ -43,6 +46,7 @@ Rectangle
{
width: Math.round(parent.width / 2)
printCoreConfiguration: modelData
mainColor: textColor
}
}
}
@ -54,7 +58,7 @@ Rectangle
visible: buildplateInformation.visible
width: parent.width - 2 * parent.padding
height: visible ? Math.round(UM.Theme.getSize("sidebar_lining_thin").height / 2) : 0
color: UM.Theme.getColor("sidebar_lining_thin")
color: textColor
}
Item
@ -73,8 +77,7 @@ Rectangle
sourceSize.width: width
sourceSize.height: height
source: UM.Theme.getIcon("buildplate")
color: "black"
color: textColor
}
Label
@ -84,6 +87,7 @@ Rectangle
anchors.verticalCenter: parent.verticalCenter
anchors.leftMargin: Math.round(UM.Theme.getSize("default_margin").height / 2)
text: configuration.buildplateConfiguration
color: textColor
}
}
}
@ -97,4 +101,11 @@ Rectangle
onEntered: parent.border.color = UM.Theme.getColor("primary_hover")
onExited: parent.border.color = "black"
}
Connections {
target: Cura.MachineManager
onCurrentConfigurationChanged: {
configurationItem.selected = Cura.MachineManager.matchesConfiguration(configuration)
}
}
}

View file

@ -11,6 +11,7 @@ Column
{
id: extruderInfo
property var printCoreConfiguration
property var mainColor: "black"
spacing: Math.round(UM.Theme.getSize("default_margin").height / 2)
height: childrenRect.height
@ -29,6 +30,7 @@ Column
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
font: UM.Theme.getFont("default")
color: mainColor
}
// Rounded item to show the extruder number
@ -46,11 +48,11 @@ Column
id: mainCircle
anchors.fill: parent
anchors.centerIn: parent
sourceSize.width: parent.width
sourceSize.height: parent.height
source: UM.Theme.getIcon("extruder_button")
color: extruderNumberText.color
color: mainColor
}
Label
@ -59,6 +61,7 @@ Column
anchors.centerIn: parent
text: printCoreConfiguration.position + 1
font: UM.Theme.getFont("default")
color: mainColor
}
}
}
@ -70,6 +73,7 @@ Column
elide: Text.ElideRight
width: parent.width
font: UM.Theme.getFont("default_bold")
color: mainColor
}
Label
@ -79,5 +83,6 @@ Column
elide: Text.ElideRight
width: parent.width
font: UM.Theme.getFont("default")
color: mainColor
}
}

View file

@ -9,7 +9,7 @@ import UM 1.2 as UM
Button
{
text: "Matched"
text: "No match"
width: parent.width
height: parent.height
@ -54,11 +54,11 @@ Button
text: control.text
elide: Text.ElideRight
anchors.left: parent.left
anchors.leftMargin: UM.Theme.getSize("default_margin").width * 2
anchors.leftMargin: UM.Theme.getSize("default_margin").width
anchors.right: downArrow.left
anchors.rightMargin: control.rightMargin
anchors.verticalCenter: parent.verticalCenter;
font: UM.Theme.getFont("large")
font: UM.Theme.getFont("medium_bold")
}
}
label: Label {}