mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-12-10 15:28:56 -07:00
Merge branch 'feature_extra_gradual_infill_icon' of github.com:Ultimaker/Cura
This commit is contained in:
commit
51c08d4f53
3 changed files with 151 additions and 12 deletions
|
|
@ -30,6 +30,7 @@ Item
|
|||
id: infillCellLeft
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
||||
width: base.width * .45 - UM.Theme.getSize("default_margin").width
|
||||
height: childrenRect.height
|
||||
|
||||
|
|
@ -47,7 +48,7 @@ Item
|
|||
}
|
||||
}
|
||||
|
||||
Flow
|
||||
Row
|
||||
{
|
||||
id: infillCellRight
|
||||
|
||||
|
|
@ -63,10 +64,11 @@ Item
|
|||
id: infillListView
|
||||
property int activeIndex:
|
||||
{
|
||||
var density = parseInt(infillDensity.properties.value)
|
||||
var density = parseInt(infillDensity.properties.value);
|
||||
var steps = parseInt(infillSteps.properties.value);
|
||||
for(var i = 0; i < infillModel.count; ++i)
|
||||
{
|
||||
if(density > infillModel.get(i).percentageMin && density <= infillModel.get(i).percentageMax )
|
||||
if(density > infillModel.get(i).percentageMin && density <= infillModel.get(i).percentageMax && steps > infillModel.get(i).stepsMin && steps <= infillModel.get(i).stepsMax)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
|
|
@ -85,7 +87,7 @@ Item
|
|||
{
|
||||
id: infillIconLining
|
||||
|
||||
width: (infillCellRight.width - 3 * UM.Theme.getSize("default_margin").width) / 4;
|
||||
width: (infillCellRight.width - ((infillModel.count - 1) * UM.Theme.getSize("default_margin").width)) / (infillModel.count);
|
||||
height: width
|
||||
|
||||
border.color:
|
||||
|
|
@ -150,6 +152,7 @@ Item
|
|||
if (infillListView.activeIndex != index)
|
||||
{
|
||||
infillDensity.setPropertyValue("value", model.percentage)
|
||||
infillSteps.setPropertyValue("value", model.steps)
|
||||
}
|
||||
}
|
||||
onEntered:
|
||||
|
|
@ -181,37 +184,61 @@ Item
|
|||
Component.onCompleted:
|
||||
{
|
||||
infillModel.append({
|
||||
name: catalog.i18nc("@label", "Hollow"),
|
||||
name: catalog.i18nc("@label", "Empty"),
|
||||
percentage: 0,
|
||||
steps: 0,
|
||||
percentageMin: -1,
|
||||
percentageMax: 0,
|
||||
text: catalog.i18nc("@label", "No (0%) infill will leave your model hollow at the cost of low strength"),
|
||||
stepsMin: -1,
|
||||
stepsMax: 0,
|
||||
text: catalog.i18nc("@label", "Empty infill will leave your model hollow with low strength"),
|
||||
icon: "hollow"
|
||||
})
|
||||
infillModel.append({
|
||||
name: catalog.i18nc("@label", "Light"),
|
||||
percentage: 20,
|
||||
steps: 0,
|
||||
percentageMin: 0,
|
||||
percentageMax: 30,
|
||||
stepsMin: -1,
|
||||
stepsMax: 0,
|
||||
text: catalog.i18nc("@label", "Light (20%) infill will give your model an average strength"),
|
||||
icon: "sparse"
|
||||
})
|
||||
infillModel.append({
|
||||
name: catalog.i18nc("@label", "Dense"),
|
||||
percentage: 50,
|
||||
steps: 0,
|
||||
percentageMin: 30,
|
||||
percentageMax: 70,
|
||||
stepsMin: -1,
|
||||
stepsMax: 0,
|
||||
text: catalog.i18nc("@label", "Dense (50%) infill will give your model an above average strength"),
|
||||
icon: "dense"
|
||||
})
|
||||
infillModel.append({
|
||||
name: catalog.i18nc("@label", "Solid"),
|
||||
percentage: 100,
|
||||
steps: 0,
|
||||
percentageMin: 70,
|
||||
percentageMax: 100,
|
||||
percentageMax: 9999999999,
|
||||
stepsMin: -1,
|
||||
stepsMax: 0,
|
||||
text: catalog.i18nc("@label", "Solid (100%) infill will make your model completely solid"),
|
||||
icon: "solid"
|
||||
})
|
||||
infillModel.append({
|
||||
name: catalog.i18nc("@label", "Gradual"),
|
||||
percentage: 90,
|
||||
steps: 5,
|
||||
percentageMin: 0,
|
||||
percentageMax: 9999999999,
|
||||
stepsMin: 0,
|
||||
stepsMax: 9999999999,
|
||||
infill_layer_height: 1.5,
|
||||
text: catalog.i18nc("@label", "This will gradually increase the amount of infill towards the top"),
|
||||
icon: "gradual"
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -220,7 +247,7 @@ Item
|
|||
{
|
||||
id: helpersCell
|
||||
anchors.top: infillCellRight.bottom
|
||||
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
||||
anchors.topMargin: UM.Theme.getSize("default_margin").height * 2
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
height: childrenRect.height
|
||||
|
|
@ -392,7 +419,7 @@ Item
|
|||
property alias _hovered: adhesionMouseArea.containsMouse
|
||||
|
||||
anchors.top: supportExtruderCombobox.bottom
|
||||
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
||||
anchors.topMargin: UM.Theme.getSize("default_margin").height * 2
|
||||
anchors.left: adhesionHelperLabel.right
|
||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||
|
||||
|
|
@ -467,7 +494,7 @@ Item
|
|||
{
|
||||
id: tipsCell
|
||||
anchors.top: helpersCell.bottom
|
||||
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
||||
anchors.topMargin: UM.Theme.getSize("default_margin").height * 2
|
||||
anchors.left: parent.left
|
||||
width: parent.width
|
||||
height: childrenRect.height
|
||||
|
|
@ -480,7 +507,7 @@ Item
|
|||
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
||||
wrapMode: Text.WordWrap
|
||||
//: Tips label
|
||||
text: catalog.i18nc("@label", "Need help improving your prints? Read the <a href='%1'>Ultimaker Troubleshooting Guides</a>").arg("https://ultimaker.com/en/troubleshooting");
|
||||
text: catalog.i18nc("@label", "Need help improving your prints?<br>Read the <a href='%1'>Ultimaker Troubleshooting Guides</a>").arg("https://ultimaker.com/en/troubleshooting");
|
||||
font: UM.Theme.getFont("default");
|
||||
color: UM.Theme.getColor("text");
|
||||
linkColor: UM.Theme.getColor("text_link")
|
||||
|
|
@ -498,6 +525,16 @@ Item
|
|||
storeIndex: 0
|
||||
}
|
||||
|
||||
UM.SettingPropertyProvider
|
||||
{
|
||||
id: infillSteps
|
||||
|
||||
containerStackId: Cura.MachineManager.activeStackId
|
||||
key: "gradual_infill_steps"
|
||||
watchedProperties: [ "value" ]
|
||||
storeIndex: 0
|
||||
}
|
||||
|
||||
UM.SettingPropertyProvider
|
||||
{
|
||||
id: platformAdhesionType
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue