mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 04:59:00 +08:00
Merge branch 'master' of https://github.com/Ultimaker/Cura
This commit is contained in:
commit
22feb03d88
@ -8,8 +8,7 @@ import QtQuick.Layouts 1.1
|
|||||||
|
|
||||||
import UM 1.1 as UM
|
import UM 1.1 as UM
|
||||||
|
|
||||||
Rectangle
|
Rectangle {
|
||||||
{
|
|
||||||
id: base;
|
id: base;
|
||||||
|
|
||||||
property real progress: UM.Backend.progress;
|
property real progress: UM.Backend.progress;
|
||||||
@ -17,34 +16,27 @@ Rectangle
|
|||||||
Behavior on progress { NumberAnimation { duration: 250; } }
|
Behavior on progress { NumberAnimation { duration: 250; } }
|
||||||
property int totalHeight: childrenRect.height
|
property int totalHeight: childrenRect.height
|
||||||
|
|
||||||
|
UM.I18nCatalog { id: catalog; name:"cura"}
|
||||||
|
|
||||||
property variant printDuration: PrintInformation.currentPrintTime;
|
property variant printDuration: PrintInformation.currentPrintTime;
|
||||||
property real printMaterialAmount: PrintInformation.materialAmount;
|
property real printMaterialAmount: PrintInformation.materialAmount;
|
||||||
UM.I18nCatalog { id: catalog; name:"cura"}
|
|
||||||
Rectangle
|
Rectangle{
|
||||||
{
|
id: printJobRow
|
||||||
id: background
|
|
||||||
implicitWidth: base.width;
|
implicitWidth: base.width;
|
||||||
implicitHeight: parent.height;
|
implicitHeight: UM.Theme.sizes.sidebar_header.height
|
||||||
color: UM.Theme.colors.save_button_background;
|
anchors.top: parent.top
|
||||||
border.width: UM.Theme.sizes.save_button_border.width
|
color: UM.Theme.colors.sidebar_header_bar
|
||||||
border.color: UM.Theme.colors.save_button_border
|
Label{
|
||||||
|
id: printJobTextfieldLabel
|
||||||
Rectangle
|
text: catalog.i18nc("@label","Printjob name");
|
||||||
{
|
|
||||||
id: infoBox
|
|
||||||
width: parent.width - UM.Theme.sizes.default_margin.width * 2;
|
|
||||||
height: UM.Theme.sizes.save_button_slicing_bar.height
|
|
||||||
|
|
||||||
anchors.top: parent.top
|
|
||||||
anchors.topMargin: UM.Theme.sizes.default_margin.height;
|
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.leftMargin: UM.Theme.sizes.default_margin.width;
|
anchors.leftMargin: UM.Theme.sizes.default_margin.width;
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
//font: UM.Theme.fonts.default;
|
font: UM.Theme.fonts.default;
|
||||||
color: UM.Theme.colors.text_white
|
color: UM.Theme.colors.text_white
|
||||||
}
|
}
|
||||||
TextField
|
TextField {
|
||||||
{
|
|
||||||
id: printJobTextfield
|
id: printJobTextfield
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.rightMargin: UM.Theme.sizes.default_margin.width;
|
anchors.rightMargin: UM.Theme.sizes.default_margin.width;
|
||||||
@ -53,23 +45,18 @@ Rectangle
|
|||||||
height: UM.Theme.sizes.sidebar_inputFields.height
|
height: UM.Theme.sizes.sidebar_inputFields.height
|
||||||
property int unremovableSpacing: 5
|
property int unremovableSpacing: 5
|
||||||
text: "UM2" + "_" + "filename" ///TODO KOMT NOG
|
text: "UM2" + "_" + "filename" ///TODO KOMT NOG
|
||||||
onEditingFinished:
|
onEditingFinished: {
|
||||||
{
|
if (printJobTextfield.text != ''){
|
||||||
if (printJobTextfield.text != '')
|
|
||||||
{
|
|
||||||
printJobTextfield.focus = false
|
printJobTextfield.focus = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
validator: RegExpValidator
|
validator: RegExpValidator {
|
||||||
{
|
|
||||||
regExp: /^[0-9a-zA-Z\_\-]*$/
|
regExp: /^[0-9a-zA-Z\_\-]*$/
|
||||||
}
|
}
|
||||||
style: TextFieldStyle
|
style: TextFieldStyle{
|
||||||
{
|
|
||||||
textColor: UM.Theme.colors.setting_control_text;
|
textColor: UM.Theme.colors.setting_control_text;
|
||||||
font: UM.Theme.fonts.default;
|
font: UM.Theme.fonts.default;
|
||||||
background: Rectangle
|
background: Rectangle {
|
||||||
{
|
|
||||||
radius: 0
|
radius: 0
|
||||||
implicitWidth: parent.width
|
implicitWidth: parent.width
|
||||||
implicitHeight: parent.height
|
implicitHeight: parent.height
|
||||||
@ -80,14 +67,12 @@ Rectangle
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle
|
Rectangle {
|
||||||
{
|
|
||||||
id: specsRow
|
id: specsRow
|
||||||
implicitWidth: base.width
|
implicitWidth: base.width
|
||||||
implicitHeight: UM.Theme.sizes.sidebar_specs_bar.height
|
implicitHeight: UM.Theme.sizes.sidebar_specs_bar.height
|
||||||
anchors.top: printJobRow.bottom
|
anchors.top: printJobRow.bottom
|
||||||
Item
|
Item{
|
||||||
{
|
|
||||||
id: time
|
id: time
|
||||||
width: (parent.width / 100 * 45) - UM.Theme.sizes.default_margin.width * 2
|
width: (parent.width / 100 * 45) - UM.Theme.sizes.default_margin.width * 2
|
||||||
height: parent.height
|
height: parent.height
|
||||||
@ -95,8 +80,7 @@ Rectangle
|
|||||||
anchors.leftMargin: UM.Theme.sizes.default_margin.width
|
anchors.leftMargin: UM.Theme.sizes.default_margin.width
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
visible: base.printMaterialAmount > 0 ? true : false
|
visible: base.printMaterialAmount > 0 ? true : false
|
||||||
UM.RecolorImage
|
UM.RecolorImage {
|
||||||
{
|
|
||||||
id: timeIcon
|
id: timeIcon
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
@ -107,26 +91,23 @@ Rectangle
|
|||||||
color: UM.Theme.colors.text_hover
|
color: UM.Theme.colors.text_hover
|
||||||
source: UM.Theme.icons.print_time;
|
source: UM.Theme.icons.print_time;
|
||||||
}
|
}
|
||||||
Label
|
Label{
|
||||||
{
|
|
||||||
id: timeSpec
|
id: timeSpec
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
anchors.left: timeIcon.right
|
anchors.left: timeIcon.right
|
||||||
anchors.leftMargin: UM.Theme.sizes.default_margin.width/2
|
anchors.leftMargin: UM.Theme.sizes.default_margin.width/2
|
||||||
font: UM.Theme.fonts.default
|
font: UM.Theme.fonts.default
|
||||||
color: UM.Theme.colors.text
|
color: UM.Theme.colors.text
|
||||||
text: (!base.printDuration || !base.printDuration.valid) ? "" : catalog.i18nc("@label","%1 h:m").arg(base.printDuration.getDisplayString(UM.DurationFormat.Short))
|
text: (!base.printDuration || !base.printDuration.valid) ? "" : catalog.i18nc("@label", "%1 m").arg(base.printDuration.getDisplayString(UM.DurationFormat.Short))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Item
|
Item{
|
||||||
{
|
|
||||||
width: parent.width / 100 * 55
|
width: parent.width / 100 * 55
|
||||||
height: parent.height
|
height: parent.height
|
||||||
anchors.left: time.right
|
anchors.left: time.right
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
visible: base.printMaterialAmount > 0 ? true : false
|
visible: base.printMaterialAmount > 0 ? true : false
|
||||||
UM.RecolorImage
|
UM.RecolorImage {
|
||||||
{
|
|
||||||
id: lengthIcon
|
id: lengthIcon
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
@ -137,8 +118,7 @@ Rectangle
|
|||||||
color: UM.Theme.colors.text_hover
|
color: UM.Theme.colors.text_hover
|
||||||
source: UM.Theme.icons.category_material;
|
source: UM.Theme.icons.category_material;
|
||||||
}
|
}
|
||||||
Label
|
Label{
|
||||||
{
|
|
||||||
id: lengthSpec
|
id: lengthSpec
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
anchors.left: lengthIcon.right
|
anchors.left: lengthIcon.right
|
||||||
@ -150,8 +130,7 @@ Rectangle
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Item
|
Item{
|
||||||
{
|
|
||||||
id: saveRow
|
id: saveRow
|
||||||
implicitWidth: base.width / 100 * 55
|
implicitWidth: base.width / 100 * 55
|
||||||
implicitHeight: saveToButton.height + (UM.Theme.sizes.default_margin.height / 2) // height + bottomMargin
|
implicitHeight: saveToButton.height + (UM.Theme.sizes.default_margin.height / 2) // height + bottomMargin
|
||||||
@ -159,8 +138,7 @@ Rectangle
|
|||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.rightMargin: UM.Theme.sizes.default_margin.width
|
anchors.rightMargin: UM.Theme.sizes.default_margin.width
|
||||||
|
|
||||||
Button
|
Button {
|
||||||
{
|
|
||||||
id: saveToButton
|
id: saveToButton
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
tooltip: UM.OutputDeviceManager.activeDeviceDescription;
|
tooltip: UM.OutputDeviceManager.activeDeviceDescription;
|
||||||
@ -171,15 +149,12 @@ Rectangle
|
|||||||
|
|
||||||
text: UM.OutputDeviceManager.activeDeviceShortDescription;
|
text: UM.OutputDeviceManager.activeDeviceShortDescription;
|
||||||
|
|
||||||
style: ButtonStyle
|
style: ButtonStyle {
|
||||||
{
|
background: Rectangle {
|
||||||
background: Rectangle
|
|
||||||
{
|
|
||||||
color: control.hovered ? UM.Theme.colors.load_save_button_hover : UM.Theme.colors.load_save_button
|
color: control.hovered ? UM.Theme.colors.load_save_button_hover : UM.Theme.colors.load_save_button
|
||||||
Behavior on color { ColorAnimation { duration: 50; } }
|
Behavior on color { ColorAnimation { duration: 50; } }
|
||||||
|
|
||||||
Label
|
Label {
|
||||||
{
|
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
color: UM.Theme.colors.load_save_button_text
|
color: UM.Theme.colors.load_save_button_text
|
||||||
font: UM.Theme.fonts.default
|
font: UM.Theme.fonts.default
|
||||||
@ -191,10 +166,9 @@ Rectangle
|
|||||||
onClicked: UM.OutputDeviceManager.requestWriteToDevice(UM.OutputDeviceManager.activeDevice)
|
onClicked: UM.OutputDeviceManager.requestWriteToDevice(UM.OutputDeviceManager.activeDevice)
|
||||||
}
|
}
|
||||||
|
|
||||||
Button
|
Button {
|
||||||
{
|
|
||||||
id: deviceSelectionMenu;
|
id: deviceSelectionMenu;
|
||||||
tooltip: catalog.i18nc("@action:button","Select the active output device");
|
tooltip: catalog.i18nc("@info:tooltip","Select the active output device");
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
width: UM.Theme.sizes.save_button_save_to_button.height
|
width: UM.Theme.sizes.save_button_save_to_button.height
|
||||||
height: UM.Theme.sizes.save_button_save_to_button.height
|
height: UM.Theme.sizes.save_button_save_to_button.height
|
||||||
@ -225,20 +199,16 @@ Rectangle
|
|||||||
label: Label{ }
|
label: Label{ }
|
||||||
}
|
}
|
||||||
|
|
||||||
menu: Menu
|
menu: Menu {
|
||||||
{
|
|
||||||
id: devicesMenu;
|
id: devicesMenu;
|
||||||
Instantiator
|
Instantiator {
|
||||||
{
|
|
||||||
model: devicesModel;
|
model: devicesModel;
|
||||||
MenuItem
|
MenuItem {
|
||||||
{
|
|
||||||
text: model.description
|
text: model.description
|
||||||
checkable: true;
|
checkable: true;
|
||||||
checked: model.id == UM.OutputDeviceManager.activeDevice;
|
checked: model.id == UM.OutputDeviceManager.activeDevice;
|
||||||
exclusiveGroup: devicesMenuGroup;
|
exclusiveGroup: devicesMenuGroup;
|
||||||
onTriggered:
|
onTriggered: {
|
||||||
{
|
|
||||||
UM.OutputDeviceManager.setActiveDevice(model.id);
|
UM.OutputDeviceManager.setActiveDevice(model.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user