Browse Source

Merge branch 'feature_extra_gradual_infill_icon' of github.com:Ultimaker/Cura

Jaime van Kessel 7 years ago
parent
commit
51c08d4f53

+ 1 - 1
resources/definitions/fdmprinter.def.json

@@ -1346,7 +1346,7 @@
                     "description": "The height of infill of a given density before switching to half the density.",
                     "unit": "mm",
                     "type": "float",
-                    "default_value": 5.0,
+                    "default_value": 1.5,
                     "minimum_value": "0.0001",
                     "minimum_value_warning": "3 * resolveOrValue('layer_height')",
                     "maximum_value_warning": "100",

+ 48 - 11
resources/qml/SidebarSimple.qml

@@ -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

+ 102 - 0
resources/themes/cura/icons/gradual.svg

@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   viewBox="0 0 30 30"
+   id="svg3400"
+   version="1.1"
+   inkscape:version="0.91 r13725"
+   sodipodi:docname="gradual.svg">
+  <metadata
+     id="metadata3410">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <defs
+     id="defs3408" />
+  <sodipodi:namedview
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1"
+     objecttolerance="10"
+     gridtolerance="10"
+     guidetolerance="10"
+     inkscape:pageopacity="0"
+     inkscape:pageshadow="2"
+     inkscape:window-width="886"
+     inkscape:window-height="928"
+     id="namedview3406"
+     showgrid="false"
+     inkscape:zoom="9.8817513"
+     inkscape:cx="10.020815"
+     inkscape:cy="1.8198052"
+     inkscape:window-x="0"
+     inkscape:window-y="0"
+     inkscape:window-maximized="0"
+     inkscape:current-layer="svg3400"
+     inkscape:snap-bbox="true"
+     inkscape:snap-grids="true"
+     inkscape:snap-to-guides="true" />
+  <path
+     d="M0 0h1.2v30H0zm28.8 0H30v30h-1.2z"
+     id="path3402" />
+  <path
+     d="M0 28.8h30V30H0zM0 0h30v1.2H0z"
+     id="path3404" />
+  <path
+     style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+     d="M 0.50598318,0.65297532 29.347025,29.291624 Z"
+     id="path3463"
+     inkscape:connector-curvature="0" />
+  <path
+     style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+     d="M 29.144631,0.85536859 14.774709,14.921701 Z"
+     id="path3465"
+     inkscape:connector-curvature="0" />
+  <path
+     style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+     d="M 21.554884,7.8379365 14.977102,0.65297532 Z"
+     id="path3467"
+     inkscape:connector-curvature="0" />
+  <path
+     style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+     d="M 15.280692,1.2601551 8.2981242,8.3439197 Z"
+     id="path3475"
+     inkscape:connector-curvature="0" />
+  <path
+     style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+     d="M 11.73881,4.7008408 7.8933377,0.95656523 Z"
+     id="path3477"
+     inkscape:connector-curvature="0" />
+  <path
+     style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+     d="M 7.9945343,0.75417196 4.452652,4.3972509 Z"
+     id="path3479"
+     inkscape:connector-curvature="0" />
+  <path
+     style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+     d="M 18.620181,4.4984475 22.769243,0.75417196 Z"
+     id="path3481"
+     inkscape:connector-curvature="0" />
+  <path
+     style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+     d="M 25.805142,3.9924643 22.87044,0.95656523 Z"
+     id="path3483"
+     inkscape:connector-curvature="0" />
+  <path
+     style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+     d="M 28.942238,0.95656516 0.70837646,29.190427 Z"
+     id="path3342"
+     inkscape:connector-curvature="0" />
+</svg>