Change Text to Label and cast all sizes to int

CURA-4437
This commit is contained in:
Mark 2017-10-11 12:48:42 +02:00 committed by ChrisTerBeke
parent 92e931e02e
commit 00205996da
9 changed files with 60 additions and 60 deletions

View file

@ -24,20 +24,20 @@ Column
{
id: connectedPrinterHeader
width: parent.width
height: childrenRect.height + UM.Theme.getSize("default_margin").height * 2
height: parseInt(childrenRect.height + UM.Theme.getSize("default_margin").height * 2)
color: UM.Theme.getColor("setting_category")
Text
Label
{
id: connectedPrinterNameLabel
text: connectedPrinter != null ? connectedPrinter.name : catalog.i18nc("@info:status", "No printer connected")
font: UM.Theme.getFont("large")
color: UM.Theme.getColor("text")
anchors.left: parent.left
anchors.top: parent.top
anchors.margins: UM.Theme.getSize("default_margin").width
text: connectedPrinter != null ? connectedPrinter.name : catalog.i18nc("@info:status", "No printer connected")
}
Text
Label
{
id: connectedPrinterAddressLabel
text: (connectedPrinter != null && connectedPrinter.address != null) ? connectedPrinter.address : ""
@ -47,7 +47,7 @@ Column
anchors.right: parent.right
anchors.margins: UM.Theme.getSize("default_margin").width
}
Text
Label
{
text: connectedPrinter != null ? connectedPrinter.connectionText : catalog.i18nc("@info:status", "The printer is not connected.")
color: connectedPrinter != null && connectedPrinter.acceptsCommands ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text")
@ -82,10 +82,10 @@ Column
{
id: extruderRectangle
color: UM.Theme.getColor("sidebar")
width: index == machineExtruderCount.properties.value - 1 && index % 2 == 0 ? extrudersGrid.width : extrudersGrid.width / 2 - UM.Theme.getSize("sidebar_lining_thin").width / 2
width: index == machineExtruderCount.properties.value - 1 && index % 2 == 0 ? extrudersGrid.width : parseInt(extrudersGrid.width / 2 - UM.Theme.getSize("sidebar_lining_thin").width / 2)
height: UM.Theme.getSize("sidebar_extruder_box").height
Text //Extruder name.
Label //Extruder name.
{
text: ExtruderManager.getExtruderName(index) != "" ? ExtruderManager.getExtruderName(index) : catalog.i18nc("@label", "Extruder")
color: UM.Theme.getColor("text")
@ -95,7 +95,7 @@ Column
anchors.margins: UM.Theme.getSize("default_margin").width
}
Text //Target temperature.
Label //Target temperature.
{
id: extruderTargetTemperature
text: (connectedPrinter != null && connectedPrinter.hotendIds[index] != null && connectedPrinter.targetHotendTemperatures[index] != null) ? Math.round(connectedPrinter.targetHotendTemperatures[index]) + "°C" : ""
@ -127,7 +127,7 @@ Column
}
}
}
Text //Temperature indication.
Label //Temperature indication.
{
id: extruderTemperature
text: (connectedPrinter != null && connectedPrinter.hotendIds[index] != null && connectedPrinter.hotendTemperatures[index] != null) ? Math.round(connectedPrinter.hotendTemperatures[index]) + "°C" : ""
@ -162,8 +162,8 @@ Column
Rectangle //Material colour indication.
{
id: materialColor
width: materialName.height * 0.75
height: materialName.height * 0.75
width: parseInt(materialName.height * 0.75)
height: parseInt(materialName.height * 0.75)
radius: width / 2
color: (connectedPrinter != null && connectedPrinter.materialColors[index] != null && connectedPrinter.materialIds[index] != "") ? connectedPrinter.materialColors[index] : "#00000000"
border.width: UM.Theme.getSize("default_lining").width
@ -195,7 +195,7 @@ Column
}
}
}
Text //Material name.
Label //Material name.
{
id: materialName
text: (connectedPrinter != null && connectedPrinter.materialNames[index] != null && connectedPrinter.materialIds[index] != "") ? connectedPrinter.materialNames[index] : ""
@ -227,7 +227,7 @@ Column
}
}
}
Text //Variant name.
Label //Variant name.
{
id: variantName
text: (connectedPrinter != null && connectedPrinter.hotendIds[index] != null) ? connectedPrinter.hotendIds[index] : ""
@ -278,7 +278,7 @@ Column
height: machineHeatedBed.properties.value == "True" ? UM.Theme.getSize("sidebar_extruder_box").height : 0
visible: machineHeatedBed.properties.value == "True"
Text //Build plate label.
Label //Build plate label.
{
text: catalog.i18nc("@label", "Build plate")
font: UM.Theme.getFont("default")
@ -287,7 +287,7 @@ Column
anchors.top: parent.top
anchors.margins: UM.Theme.getSize("default_margin").width
}
Text //Target temperature.
Label //Target temperature.
{
id: bedTargetTemperature
text: connectedPrinter != null ? connectedPrinter.targetBedTemperature + "°C" : ""
@ -319,7 +319,7 @@ Column
}
}
}
Text //Current temperature.
Label //Current temperature.
{
id: bedCurrentTemperature
text: connectedPrinter != null ? connectedPrinter.bedTemperature + "°C" : ""
@ -397,7 +397,7 @@ Column
color: UM.Theme.getColor("setting_control_highlight")
opacity: preheatTemperatureControl.hovered ? 1.0 : 0
}
Text //Maximum temperature indication.
Label //Maximum temperature indication.
{
text: (bedTemperature.properties.maximum_value != "None" ? bedTemperature.properties.maximum_value : "") + "°C"
color: UM.Theme.getColor("setting_unit")
@ -475,7 +475,7 @@ Column
visible: preheatCountdown.visible
source: UM.Theme.getIcon("print_time")
anchors.right: preheatCountdown.left
anchors.rightMargin: UM.Theme.getSize("default_margin").width / 2
anchors.rightMargin: parseInt(UM.Theme.getSize("default_margin").width / 2)
anchors.verticalCenter: preheatCountdown.verticalCenter
}
@ -500,7 +500,7 @@ Column
}
}
}
Text
Label
{
id: preheatCountdown
text: connectedPrinter != null ? connectedPrinter.preheatBedRemainingTime : ""
@ -595,7 +595,7 @@ Column
}
}
Text
Label
{
id: actualLabel
anchors.centerIn: parent
@ -708,22 +708,22 @@ Column
Row
{
height: UM.Theme.getSize("setting_control").height
width: base.width - 2 * UM.Theme.getSize("default_margin").width
width: parseInt(base.width - 2 * UM.Theme.getSize("default_margin").width)
anchors.left: parent.left
anchors.leftMargin: UM.Theme.getSize("default_margin").width
Text
Label
{
width: parent.width * 0.4
width: parseInt(parent.width * 0.4)
anchors.verticalCenter: parent.verticalCenter
text: label
color: connectedPrinter != null && connectedPrinter.acceptsCommands ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text")
font: UM.Theme.getFont("default")
elide: Text.ElideRight
}
Text
Label
{
width: parent.width * 0.6
width: parseInt(parent.width * 0.6)
anchors.verticalCenter: parent.verticalCenter
text: value
color: connectedPrinter != null && connectedPrinter.acceptsCommands ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text")
@ -742,7 +742,7 @@ Column
width: base.width
height: UM.Theme.getSize("section").height
Text
Label
{
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left