mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-13 06:59:03 +08:00
Implement the time/quality slider in SidebarSimple
This commit is contained in:
parent
aaeb00ed7a
commit
d2a8ec0898
@ -6,12 +6,17 @@ import QtQuick.Layouts 1.1
|
||||
import UM 1.0 as UM
|
||||
|
||||
Item {
|
||||
id: base;
|
||||
|
||||
anchors.fill: parent;
|
||||
anchors.leftMargin: UM.Theme.sizes.default_margin.width;
|
||||
anchors.rightMargin: UM.Theme.sizes.default_margin.width;
|
||||
|
||||
property Action configureSettings;
|
||||
|
||||
property variant minimumPrintTime: PrintInformation.minimumPrintTime;
|
||||
property variant maximumPrintTime: PrintInformation.maximumPrintTime;
|
||||
|
||||
ColumnLayout {
|
||||
anchors.fill: parent;
|
||||
|
||||
@ -22,15 +27,33 @@ Item {
|
||||
Label {
|
||||
anchors.left: parent.left;
|
||||
anchors.verticalCenter: parent.verticalCenter;
|
||||
text: "00:00";
|
||||
text:Qt.formatTime(base.minimumPrintTime, "hh:mm");
|
||||
font: UM.Theme.fonts.timeslider_time;
|
||||
color: UM.Theme.colors.primary;
|
||||
}
|
||||
Label { anchors.centerIn: parent; text: "Estimated Print Time"; color: UM.Theme.colors.text; font: UM.Theme.fonts.default; }
|
||||
Label {
|
||||
anchors.centerIn: parent;
|
||||
text: {
|
||||
if (UM.Backend.progress < 0)
|
||||
{
|
||||
return qsTr("No Model Loaded");
|
||||
}
|
||||
else if (base.minimumPrintTime == null || base.maximumPrintTime == null)
|
||||
{
|
||||
return qsTr("Calculating...")
|
||||
}
|
||||
else
|
||||
{
|
||||
return qsTr("Estimated Print Time");
|
||||
}
|
||||
}
|
||||
color: UM.Theme.colors.text;
|
||||
font: UM.Theme.fonts.default;
|
||||
}
|
||||
Label {
|
||||
anchors.right: parent.right;
|
||||
anchors.verticalCenter: parent.verticalCenter;
|
||||
text: "21:00";
|
||||
text: Qt.formatTime(base.maximumPrintTime, "hh:mm");
|
||||
font: UM.Theme.fonts.timeslider_time;
|
||||
color: UM.Theme.colors.primary;
|
||||
}
|
||||
@ -43,6 +66,9 @@ Item {
|
||||
minimumValue: 0;
|
||||
maximumValue: 100;
|
||||
|
||||
value: PrintInformation.timeQualityValue;
|
||||
onValueChanged: PrintInformation.setTimeQualityValue(value);
|
||||
|
||||
style: UM.Theme.styles.slider;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user