Просмотр исходного кода

Show weights as well as lengths

CURA-1038
fieldOfView 8 лет назад
Родитель
Сommit
9171908c8b
1 измененных файлов с 11 добавлено и 5 удалено
  1. 11 5
      resources/qml/JobSpecs.qml

+ 11 - 5
resources/qml/JobSpecs.qml

@@ -195,15 +195,21 @@ Rectangle {
                 color: UM.Theme.getColor("text_subtext")
                 color: UM.Theme.getColor("text_subtext")
                 text:
                 text:
                 {
                 {
-                    var amounts = [];
+                    var lengths = [];
+                    var weights = [];
                     if(base.printMaterialLengths) {
                     if(base.printMaterialLengths) {
                         for(var index = 0; index < base.printMaterialLengths.length; index++) {
                         for(var index = 0; index < base.printMaterialLengths.length; index++) {
-                            amounts.push(base.printMaterialLengths[index].toFixed(2));
+                            if(base.printMaterialLengths[index] > 0) {
+                                lengths.push(base.printMaterialLengths[index].toFixed(2));
+                                weights.push(String(Math.floor(base.printMaterialWeights[index])));
+                            }
                         }
                         }
-                    } else {
-                        amounts = ["0.00"];
                     }
                     }
-                    return catalog.i18nc("@label", "%1 m").arg(amounts.join(" + "));
+                    if(lengths.length == 0) {
+                        lengths = ["0.00"];
+                        weights = ["0"];
+                    }
+                    return catalog.i18nc("@label", "%1 m / %2 g").arg(lengths.join(" + ")).arg(weights.join(" + "));
                 }
                 }
             }
             }
         }
         }