mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-29 05:41:05 -07:00
Check undefined text
CURA-4182
This commit is contained in:
parent
358077c726
commit
9a0926b009
1 changed files with 12 additions and 3 deletions
|
|
@ -165,7 +165,18 @@ Item
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.topMargin: UM.Theme.getSize("sidebar_margin").height / 2
|
anchors.topMargin: 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: Cura.MachineManager.activeMachine != null ? Cura.ProfilesModel.getItem(index).layer_height_without_unit : ""
|
text:
|
||||||
|
{
|
||||||
|
var result = ""
|
||||||
|
if(Cura.MachineManager.activeMachine != null){
|
||||||
|
|
||||||
|
var result = Cura.ProfilesModel.getItem(index).layer_height_without_unit
|
||||||
|
|
||||||
|
if(result == undefined)
|
||||||
|
result = ""
|
||||||
|
}
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
x: {
|
x: {
|
||||||
// Make sure the text aligns correctly with each tick
|
// Make sure the text aligns correctly with each tick
|
||||||
|
|
@ -244,14 +255,12 @@ Item
|
||||||
//Draw Available line
|
//Draw Available line
|
||||||
groove: Rectangle {
|
groove: Rectangle {
|
||||||
implicitHeight: 2
|
implicitHeight: 2
|
||||||
anchors.verticalCenter: qualitySlider.verticalCenter
|
|
||||||
color: UM.Theme.getColor("quality_slider_available")
|
color: UM.Theme.getColor("quality_slider_available")
|
||||||
radius: 1
|
radius: 1
|
||||||
}
|
}
|
||||||
handle: Item {
|
handle: Item {
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: qualityhandleButton
|
id: qualityhandleButton
|
||||||
anchors.verticalCenter: qualitySlider.verticalCenter
|
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
color: control.enabled ? UM.Theme.getColor("quality_slider_available") : UM.Theme.getColor("quality_slider_unavailable")
|
color: control.enabled ? UM.Theme.getColor("quality_slider_available") : UM.Theme.getColor("quality_slider_unavailable")
|
||||||
implicitWidth: 10
|
implicitWidth: 10
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue