From 9a0926b0099a0037552dfed0698f9bdd05b3635a Mon Sep 17 00:00:00 2001 From: alekseisasin Date: Fri, 22 Sep 2017 13:50:31 +0200 Subject: [PATCH 1/2] Check undefined text CURA-4182 --- resources/qml/SidebarSimple.qml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/resources/qml/SidebarSimple.qml b/resources/qml/SidebarSimple.qml index e3b0f21056..4063af322a 100644 --- a/resources/qml/SidebarSimple.qml +++ b/resources/qml/SidebarSimple.qml @@ -165,7 +165,18 @@ Item anchors.top: parent.top 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") - 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: { // Make sure the text aligns correctly with each tick @@ -244,14 +255,12 @@ Item //Draw Available line groove: Rectangle { implicitHeight: 2 - anchors.verticalCenter: qualitySlider.verticalCenter color: UM.Theme.getColor("quality_slider_available") radius: 1 } handle: Item { Rectangle { id: qualityhandleButton - anchors.verticalCenter: qualitySlider.verticalCenter anchors.centerIn: parent color: control.enabled ? UM.Theme.getColor("quality_slider_available") : UM.Theme.getColor("quality_slider_unavailable") implicitWidth: 10 From e1f8676cacd94196468422fa4ebfb0c16ee6db27 Mon Sep 17 00:00:00 2001 From: alekseisasin Date: Fri, 22 Sep 2017 14:02:13 +0200 Subject: [PATCH 2/2] Removed tooltip translation in SidebarSimple CURA-4182 --- resources/qml/SidebarSimple.qml | 43 --------------------------------- 1 file changed, 43 deletions(-) diff --git a/resources/qml/SidebarSimple.qml b/resources/qml/SidebarSimple.qml index 70500e0041..4063af322a 100644 --- a/resources/qml/SidebarSimple.qml +++ b/resources/qml/SidebarSimple.qml @@ -491,49 +491,6 @@ Item } } } - - MouseArea { - id: enableGradualInfillMouseArea_1 - - anchors.fill: parent - hoverEnabled: true - enabled: true - - onEntered: { - - var selectedStep = parseInt(infillSlider.value) / parseInt(infillSlider.stepSize) - - var tooltipText = "" - - if( enableGradualInfillCheckBox.checked){ - tooltipText = catalog.i18nc("@label", "Gradual infill will gradually increase the amount of infill towards the top."); - } - else{ - - switch(selectedStep){ - case 0: tooltipText = catalog.i18nc("@label", "Empty infill will leave your model hollow with low strength."); break; - case 1: - case 2: - case 3: - case 4: tooltipText = catalog.i18nc("@label", "Light infill will give your model an average strength."); break; - case 5: - case 6: - case 7: - case 8: tooltipText = catalog.i18nc("@label", "Dense infill will give your model an above average strength."); break; - case 9: - case 10: tooltipText = catalog.i18nc("@label", "Solid infill will make your model completely solid."); break; - } - } - - if(tooltipText != "") - base.showTooltip(base, Qt.point(0,infillCellRight.y + infillIcon.y),tooltipText) - } - - onExited: { - base.hideTooltip() - } - - } } // Gradual Support Infill Checkbox