CURA-4414 replace all Text elements for Label, make sure no half pixel anchors exist

This commit is contained in:
ChrisTerBeke 2017-10-04 13:34:24 +02:00 committed by Ghostkeeper
parent e9a8ae15f3
commit a8476c30ca
No known key found for this signature in database
GPG Key ID: C5F96EE2BC0F7E75

View File

@ -154,7 +154,7 @@ Item
} }
} }
Text Label
{ {
id: qualityRowTitle id: qualityRowTitle
text: catalog.i18nc("@label", "Layer Height") text: catalog.i18nc("@label", "Layer Height")
@ -171,11 +171,11 @@ Item
{ {
model: qualityModel model: qualityModel
Text Label
{ {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: UM.Theme.getSize("sidebar_margin").height / 2 anchors.topMargin: parseInt(UM.Theme.getSize("sidebar_margin").height / 2)
color: (Cura.MachineManager.activeMachine != null && Cura.ProfilesModel.getItem(index).available) ? UM.Theme.getColor("quality_slider_available") : UM.Theme.getColor("quality_slider_unavailable") color: (Cura.MachineManager.activeMachine != null && Cura.ProfilesModel.getItem(index).available) ? UM.Theme.getColor("quality_slider_available") : UM.Theme.getColor("quality_slider_unavailable")
text: text:
{ {
@ -194,13 +194,13 @@ Item
// Make sure the text aligns correctly with each tick // Make sure the text aligns correctly with each tick
if (qualityModel.totalTicks == 0) { if (qualityModel.totalTicks == 0) {
// If there is only one tick, align it centrally // If there is only one tick, align it centrally
return ((base.width * 0.55) - width) / 2 return parseInt(((base.width * 0.55) - width) / 2)
} else if (index == 0) { } else if (index == 0) {
return (base.width * 0.55 / qualityModel.totalTicks) * index return (base.width * 0.55 / qualityModel.totalTicks) * index
} else if (index == qualityModel.totalTicks) { } else if (index == qualityModel.totalTicks) {
return (base.width * 0.55 / qualityModel.totalTicks) * index - width return (base.width * 0.55 / qualityModel.totalTicks) * index - width
} else { } else {
return (base.width * 0.55 / qualityModel.totalTicks) * index - (width / 2) return parseInt((base.width * 0.55 / qualityModel.totalTicks) * index - (width / 2))
} }
} }
} }
@ -310,7 +310,7 @@ Item
} }
} }
Text Label
{ {
id: speedLabel id: speedLabel
anchors.top: speedSlider.bottom anchors.top: speedSlider.bottom
@ -322,7 +322,7 @@ Item
color: UM.Theme.getColor("text") color: UM.Theme.getColor("text")
} }
Text Label
{ {
anchors.bottom: speedLabel.bottom anchors.bottom: speedLabel.bottom
anchors.left: speedSlider.left anchors.left: speedSlider.left
@ -333,7 +333,7 @@ Item
horizontalAlignment: Text.AlignLeft horizontalAlignment: Text.AlignLeft
} }
Text Label
{ {
anchors.bottom: speedLabel.bottom anchors.bottom: speedLabel.bottom
anchors.right: speedSlider.right anchors.right: speedSlider.right
@ -360,7 +360,7 @@ Item
width: UM.Theme.getSize("sidebar").width * .45 - UM.Theme.getSize("sidebar_margin").width width: UM.Theme.getSize("sidebar").width * .45 - UM.Theme.getSize("sidebar_margin").width
Text Label
{ {
id: infillLabel id: infillLabel
text: catalog.i18nc("@label", "Infill") text: catalog.i18nc("@label", "Infill")
@ -482,7 +482,7 @@ Item
anchors.right: parent.right anchors.right: parent.right
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: UM.Theme.getSize("sidebar_margin").height / 2 anchors.topMargin: parseInt(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
@ -533,7 +533,7 @@ Item
property alias _hovered: enableGradualInfillMouseArea.containsMouse property alias _hovered: enableGradualInfillMouseArea.containsMouse
anchors.top: infillSlider.bottom anchors.top: infillSlider.bottom
anchors.topMargin: UM.Theme.getSize("sidebar_margin").height / 2 // closer to slider since it belongs to the same category anchors.topMargin: parseInt(UM.Theme.getSize("sidebar_margin").height / 2) // closer to slider since it belongs to the same category
anchors.left: infillCellRight.left anchors.left: infillCellRight.left
style: UM.Theme.styles.checkbox style: UM.Theme.styles.checkbox
@ -569,7 +569,7 @@ Item
Label { Label {
id: gradualInfillLabel id: gradualInfillLabel
anchors.left: enableGradualInfillCheckBox.right anchors.left: enableGradualInfillCheckBox.right
anchors.leftMargin: UM.Theme.getSize("sidebar_margin").width / 2 anchors.leftMargin: parseInt(UM.Theme.getSize("sidebar_margin").width / 2)
text: catalog.i18nc("@label", "Enable gradual") text: catalog.i18nc("@label", "Enable gradual")
font: UM.Theme.getFont("default") font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text") color: UM.Theme.getColor("text")
@ -624,13 +624,13 @@ Item
// //
// Enable support // Enable support
// //
Text Label
{ {
id: enableSupportLabel id: enableSupportLabel
visible: enableSupportCheckBox.visible visible: enableSupportCheckBox.visible
anchors.top: infillCellRight.bottom anchors.top: infillCellRight.bottom
anchors.topMargin: UM.Theme.getSize("sidebar_margin").height * 1.5 anchors.topMargin: parseInt(UM.Theme.getSize("sidebar_margin").height * 1.5)
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: UM.Theme.getSize("sidebar_margin").width anchors.leftMargin: UM.Theme.getSize("sidebar_margin").width
anchors.verticalCenter: enableSupportCheckBox.verticalCenter anchors.verticalCenter: enableSupportCheckBox.verticalCenter
@ -677,7 +677,7 @@ Item
} }
} }
Text Label
{ {
id: supportExtruderLabel id: supportExtruderLabel
visible: supportExtruderCombobox.visible visible: supportExtruderCombobox.visible
@ -753,7 +753,7 @@ Item
} }
Text Label
{ {
id: adhesionHelperLabel id: adhesionHelperLabel
visible: adhesionCheckBox.visible visible: adhesionCheckBox.visible
@ -839,12 +839,12 @@ Item
{ {
id: tipsCell id: tipsCell
anchors.top: adhesionCheckBox.visible ? adhesionCheckBox.bottom : (enableSupportCheckBox.visible ? supportExtruderCombobox.bottom : infillCellRight.bottom) anchors.top: adhesionCheckBox.visible ? adhesionCheckBox.bottom : (enableSupportCheckBox.visible ? supportExtruderCombobox.bottom : infillCellRight.bottom)
anchors.topMargin: UM.Theme.getSize("sidebar_margin").height * 2 anchors.topMargin: parseInt(UM.Theme.getSize("sidebar_margin").height * 2)
anchors.left: parent.left anchors.left: parent.left
width: parent.width width: parent.width
height: tipsText.contentHeight * tipsText.lineCount height: tipsText.contentHeight * tipsText.lineCount
Text Label
{ {
id: tipsText id: tipsText
anchors.left: parent.left anchors.left: parent.left