Merge pull request #7223 from Ultimaker/CURA-7255_infill_only_dropdown

CURA-7255_infill_only_dropdown
This commit is contained in:
konskarm 2020-03-13 10:30:09 +01:00 committed by GitHub
commit 3d054a9400
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -49,18 +49,6 @@ Item
visibility_handler.addSkipResetSetting(currentMeshType)
}
function setOverhangsMeshType()
{
if (infillOnlyCheckbox.checked)
{
setMeshType(infillMeshType)
}
else
{
setMeshType(cuttingMeshType)
}
}
function setMeshType(type)
{
UM.ActiveTool.setProperty("MeshType", type)
@ -140,22 +128,39 @@ Item
verticalAlignment: Text.AlignVCenter
}
CheckBox
ComboBox
{
id: infillOnlyCheckbox
id: infillOnlyComboBox
width: parent.width / 2 - UM.Theme.getSize("default_margin").width
text: catalog.i18nc("@action:checkbox", "Infill only");
model: ListModel
{
id: infillOnlyComboBoxModel
style: UM.Theme.styles.checkbox;
Component.onCompleted: {
append({ text: catalog.i18nc("@item:inlistbox", "Infill mesh only") })
append({ text: catalog.i18nc("@item:inlistbox", "Cutting mesh") })
}
}
visible: currentMeshType === infillMeshType || currentMeshType === cuttingMeshType
onClicked: setOverhangsMeshType()
onActivated:
{
if (index == 0){
setMeshType(infillMeshType)
} else {
setMeshType(cuttingMeshType)
}
}
Binding
{
target: infillOnlyCheckbox
property: "checked"
value: currentMeshType === infillMeshType
target: infillOnlyComboBox
property: "currentIndex"
value: currentMeshType === infillMeshType ? 0 : 1
}
}