diff --git a/resources/qml/PrintSetupSelector/Recommended/InfillSlider.qml b/resources/qml/PrintSetupSelector/Recommended/InfillSlider.qml index 6cde19c2a9..4cc80a835f 100644 --- a/resources/qml/PrintSetupSelector/Recommended/InfillSlider.qml +++ b/resources/qml/PrintSetupSelector/Recommended/InfillSlider.qml @@ -15,9 +15,18 @@ RowLayout anchors { - left: infillRowTitle.right + left: strengthSection.right right: parent.right - verticalCenter: infillRowTitle.verticalCenter + verticalCenter: strengthSection.verticalCenter + } + + UM.SettingPropertyProvider + { + id: infillDensity + containerStackId: Cura.MachineManager.activeStackId + key: "infill_sparse_density" + watchedProperties: [ "value" ] + storeIndex: 0 } UM.Label { Layout.fillWidth: false; text: "0" } diff --git a/resources/qml/PrintSetupSelector/Recommended/RecommendedPrintSetup.qml b/resources/qml/PrintSetupSelector/Recommended/RecommendedPrintSetup.qml index cf8e9e4e2a..7e25785c74 100644 --- a/resources/qml/PrintSetupSelector/Recommended/RecommendedPrintSetup.qml +++ b/resources/qml/PrintSetupSelector/Recommended/RecommendedPrintSetup.qml @@ -86,9 +86,7 @@ Item RecommendedStrengthSelector { width: parent.width - labelColumnWidth: parent.firstColumnWidth Layout.fillWidth: true - Layout.rightMargin: UM.Theme.getSize("default_margin").width } RecommendedSupportSelector diff --git a/resources/qml/PrintSetupSelector/Recommended/RecommendedSettingItem.qml b/resources/qml/PrintSetupSelector/Recommended/RecommendedSettingItem.qml index ec777b13d6..87a95a12e8 100644 --- a/resources/qml/PrintSetupSelector/Recommended/RecommendedSettingItem.qml +++ b/resources/qml/PrintSetupSelector/Recommended/RecommendedSettingItem.qml @@ -18,6 +18,7 @@ Item property alias settingControl: settingContainer.children property alias settingName: settingLabel.text + property string tooltipText: "" UM.Label { diff --git a/resources/qml/PrintSetupSelector/Recommended/RecommendedStrengthSelector.qml b/resources/qml/PrintSetupSelector/Recommended/RecommendedStrengthSelector.qml index be4b0dbf0b..82fcd64bb9 100644 --- a/resources/qml/PrintSetupSelector/Recommended/RecommendedStrengthSelector.qml +++ b/resources/qml/PrintSetupSelector/Recommended/RecommendedStrengthSelector.qml @@ -5,108 +5,39 @@ import QtQuick 2.7 import QtQuick.Controls 2.15 import UM 1.5 as UM -import Cura 1.0 as Cura +import Cura 1.7 as Cura -// -// Infill -// -Item +RecommendedSettingSection { - id: infillRow - height: childrenRect.height + id: strengthSection - property real labelColumnWidth: Math.round(width / 3) + title: catalog.i18nc("@label", "Strength") + icon: UM.Theme.getIcon("Hammer") + enableSectionVisible: false + enableSectionEnabled: false - // Here are the elements that are shown in the left column - Cura.IconWithText - { - id: infillRowTitle - anchors.top: parent.top - anchors.left: parent.left - source: UM.Theme.getIcon("Infill1") - text: `${catalog.i18nc("@label", "Infill")} (%)` - font: UM.Theme.getFont("medium") - width: labelColumnWidth - iconSize: UM.Theme.getSize("medium_button_icon").width - tooltipText: catalog.i18nc("@label", "Gradual infill will gradually increase the amount of infill towards the top.") - } - - InfillSlider - { - id: infillSliderContainer - height: childrenRect.height - } - - // Gradual Support Infill Checkbox - UM.CheckBox - { - id: enableGradualInfillCheckBox - property alias _hovered: enableGradualInfillMouseArea.containsMouse - - anchors.top: infillSliderContainer.bottom - anchors.topMargin: UM.Theme.getSize("default_margin").height - anchors.left: infillSliderContainer.left - - text: catalog.i18nc("@label", "Gradual infill") - enabled: recommendedPrintSetup.settingsEnabled - visible: infillSteps.properties.enabled == "True" - checked: parseInt(infillSteps.properties.value) > 0 - - MouseArea + contents: [ + RecommendedSettingItem { - id: enableGradualInfillMouseArea - - anchors.fill: parent - hoverEnabled: true - enabled: true - - property var previousInfillDensity: parseInt(infillDensity.properties.value) - - onClicked: + settingName: catalog.i18nc("@action:label", "Infill Density") + tooltipText: catalog.i18nc("@label", "Gradual infill will gradually increase the amount of infill towards the top.") + settingControl: InfillSlider { - // Set to 90% only when enabling gradual infill - var newInfillDensity; - if (parseInt(infillSteps.properties.value) == 0) - { - previousInfillDensity = parseInt(infillDensity.properties.value) - newInfillDensity = 90 - } else { - newInfillDensity = previousInfillDensity - } - Cura.MachineManager.setSettingForAllExtruders("infill_sparse_density", "value", String(newInfillDensity)) - - var infill_steps_value = 0 - if (parseInt(infillSteps.properties.value) == 0) - { - infill_steps_value = 5 - } - - Cura.MachineManager.setSettingForAllExtruders("gradual_infill_steps", "value", infill_steps_value) + height: UM.Theme.getSize("combobox").height + width: parent.width } + }, + RecommendedSettingItem + { + settingName: catalog.i18nc("@action:label", "Infill Pattern") - onEntered: base.showTooltip(enableGradualInfillCheckBox, Qt.point(-infillSliderContainer.x - UM.Theme.getSize("thick_margin").width, 0), - catalog.i18nc("@label", "Gradual infill will gradually increase the amount of infill towards the top.")) - - onExited: base.hideTooltip() + settingControl: Cura.SingleSettingComboBox + { + width: parent.width + height: UM.Theme.getSize("combobox").height + settingName: "infill_pattern" + } } - } - - UM.SettingPropertyProvider - { - id: infillDensity - containerStackId: Cura.MachineManager.activeStackId - key: "infill_sparse_density" - watchedProperties: [ "value" ] - storeIndex: 0 - } - - UM.SettingPropertyProvider - { - id: infillSteps - containerStackId: Cura.MachineManager.activeStackId - key: "gradual_infill_steps" - watchedProperties: ["value", "enabled"] - storeIndex: 0 - } + ] } diff --git a/resources/themes/cura-light/icons/default/Hammer.svg b/resources/themes/cura-light/icons/default/Hammer.svg new file mode 100644 index 0000000000..62823682be --- /dev/null +++ b/resources/themes/cura-light/icons/default/Hammer.svg @@ -0,0 +1,8 @@ + + + + +