Restyling of the save to toolpath button

When the text is to long for the infobox, it is elided of the "Estimated print-time" message is not shown.

Contributes to #54
This commit is contained in:
Tamara Hogenhout 2015-06-25 16:49:57 +02:00
parent 21ec546ec5
commit a9f87d5d34
2 changed files with 10 additions and 5 deletions

View file

@ -82,11 +82,12 @@ Rectangle {
} else if (base.progress < 0.99) {
//: Save button label
return qsTr("Calculating Print-time");
} else if (base.progress > 0.99){
} else if (base.printDuration.days > 0 || base.progress == null){
return qsTr("");
}
else if (base.progress > 0.99){
//: Save button label
return qsTr("Estimated Print-time");
} else if (base.progress == null){
return qsTr("");
}
}
Label {
@ -104,8 +105,12 @@ Rectangle {
anchors.verticalCenter: parent.verticalCenter
anchors.left: printDurationLabel.right;
anchors.leftMargin: UM.Theme.sizes.save_button_text_margin.width;
color: UM.Theme.colors.save_button_printtime_text;
color: base.printDuration.days > 0 ? UM.Theme.colors.save_button_estimated_text : UM.Theme.colors.save_button_printtime_text;
font: UM.Theme.fonts.small;
property bool mediumLengthDuration: base.printDuration.hours > 9 && base.printMaterialAmount > 9.99 && base.printDuration.days == 0
width: mediumLengthDuration ? 50 : undefined
elide: mediumLengthDuration ? Text.ElideRight : Text.ElideNone
visible: base.progress < 0.99 ? false : true
//: Print material amount save button label
text: base.printMaterialAmount < 0 ? "" : qsTr("%1m material").arg(base.printMaterialAmount);

View file

@ -160,7 +160,7 @@
"tooltip_margins": [1.0, 1.0],
"save_button_border": [0.06, 0.06],
"save_button_text_margin": [0.6, 0.6],
"save_button_text_margin": [0.3, 0.6],
"save_button_slicing_bar": [0.0, 2.2],
"save_button_label_margin": [0.5, 0.5],
"save_button_save_to_button": [0.3, 2.7],