Merge branch 'master' into CURA-8640_PyQt6

# Conflicts:
#	cura/CuraApplication.py
#	resources/qml/Preferences/Materials/MaterialsSyncDialog.qml
#	resources/qml/Preferences/Materials/MaterialsView.qml
This commit is contained in:
Jelle Spijker 2022-03-24 11:53:44 +01:00
commit 3f8907d02a
No known key found for this signature in database
GPG key ID: 6662DC033BE6B99A
582 changed files with 8061 additions and 9724 deletions

View file

@ -3,7 +3,6 @@
import QtQuick 2.3
import QtQuick.Controls 2.4
import QtQuick.Controls.Styles 1.3
import UM 1.3 as UM
import Cura 1.0 as Cura
@ -19,7 +18,7 @@ Button
{
anchors.fill: parent
radius: 0.5 * width
color: parent.enabled ? (parent.hovered ? UM.Theme.getColor("monitor_secondary_button_hover") : "transparent") : UM.Theme.getColor("monitor_icon_disabled")
color: parent.enabled ? (parent.hovered ? UM.Theme.getColor("monitor_card_hover") : "transparent") : UM.Theme.getColor("monitor_icon_disabled")
}
UM.RecolorImage

View file

@ -1,14 +1,13 @@
// Copyright (c) 2019 Ultimaker B.V.
// Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import UM 1.2 as UM
import UM 1.5 as UM
import Cura 1.5 as Cura
import QtQuick 2.2
import QtQuick.Controls 1.1
import QtQuick.Controls 2.9
import QtQuick.Layouts 1.1
import QtQuick.Window 2.1
import QtQuick.Dialogs 1.2
Cura.MachineAction
{
@ -36,32 +35,27 @@ Cura.MachineAction
id: discoverUM3Action
spacing: UM.Theme.getSize("default_margin").height
SystemPalette { id: palette }
UM.I18nCatalog { id: catalog; name:"cura" }
Label
UM.Label
{
id: pageTitle
width: parent.width
text: catalog.i18nc("@title:window", "Connect to Networked Printer")
wrapMode: Text.WordWrap
renderType: Text.NativeRendering
font.pointSize: 18
}
Label
UM.Label
{
id: pageDescription
width: parent.width
wrapMode: Text.WordWrap
renderType: Text.NativeRendering
text: catalog.i18nc("@label", "To print directly to your printer over the network, please make sure your printer is connected to the network using a network cable or by connecting your printer to your WIFI network. If you don't connect Cura with your printer, you can still use a USB drive to transfer g-code files to your printer.") + "\n\n" + catalog.i18nc("@label", "Select your printer from the list below:")
}
Row
{
spacing: UM.Theme.getSize("default_lining").width
spacing: UM.Theme.getSize("thin_margin").width
Button
Cura.SecondaryButton
{
id: addButton
text: catalog.i18nc("@action:button", "Add");
@ -71,7 +65,7 @@ Cura.MachineAction
}
}
Button
Cura.SecondaryButton
{
id: editButton
text: catalog.i18nc("@action:button", "Edit")
@ -82,7 +76,7 @@ Cura.MachineAction
}
}
Button
Cura.SecondaryButton
{
id: removeButton
text: catalog.i18nc("@action:button", "Remove")
@ -90,7 +84,7 @@ Cura.MachineAction
onClicked: manager.removeManualDevice(base.selectedDevice.key, base.selectedDevice.ipAddress)
}
Button
Cura.SecondaryButton
{
id: rediscoverButton
text: catalog.i18nc("@action:button", "Refresh")
@ -109,70 +103,61 @@ Cura.MachineAction
width: Math.round(parent.width * 0.5)
spacing: UM.Theme.getSize("default_margin").height
ScrollView
ListView
{
id: objectListContainer
frameVisible: true
id: listview
width: parent.width
height: base.height - contentRow.y - discoveryTip.height
Rectangle
ScrollBar.vertical: UM.ScrollBar {}
clip: true
model: manager.foundDevices
currentIndex: -1
onCurrentIndexChanged:
{
parent: viewport
anchors.fill: parent
color: palette.light
base.selectedDevice = listview.model[currentIndex];
// Only allow connecting if the printer has responded to API query since the last refresh
base.completeProperties = base.selectedDevice != null && base.selectedDevice.getProperty("incomplete") != "true";
}
Component.onCompleted: manager.startDiscovery()
ListView
delegate: UM.Label
{
id: listview
model: manager.foundDevices
width: parent.width
currentIndex: -1
onCurrentIndexChanged:
{
base.selectedDevice = listview.model[currentIndex];
// Only allow connecting if the printer has responded to API query since the last refresh
base.completeProperties = base.selectedDevice != null && base.selectedDevice.getProperty("incomplete") != "true";
}
Component.onCompleted: manager.startDiscovery()
delegate: Rectangle
{
height: childrenRect.height
color: ListView.isCurrentItem ? palette.highlight : index % 2 ? palette.base : palette.alternateBase
width: parent.width
Label
{
anchors.left: parent.left
anchors.leftMargin: UM.Theme.getSize("default_margin").width
anchors.right: parent.right
text: listview.model[index].name
color: parent.ListView.isCurrentItem ? palette.highlightedText : palette.text
elide: Text.ElideRight
renderType: Text.NativeRendering
}
id: printNameLabel
width: listview.width
height: contentHeight
anchors.left: parent.left
anchors.leftMargin: UM.Theme.getSize("default_margin").width
MouseArea
anchors.right: parent.right
text: listview.model[index].name
elide: Text.ElideRight
MouseArea
{
anchors.fill: parent;
onClicked:
{
anchors.fill: parent;
onClicked:
if(!parent.ListView.isCurrentItem)
{
if(!parent.ListView.isCurrentItem)
{
parent.ListView.view.currentIndex = index;
}
parent.ListView.view.currentIndex = index;
}
}
}
background: Rectangle
{
color: parent.ListView.isCurrentItem ? UM.Theme.getColor("background_3") : "transparent"
}
}
}
Label
UM.Label
{
id: discoveryTip
anchors.left: parent.left
anchors.right: parent.right
wrapMode: Text.WordWrap
renderType: Text.NativeRendering
text: catalog.i18nc("@label", "If your printer is not listed, read the <a href='%1'>network printing troubleshooting guide</a>").arg("https://ultimaker.com/en/cura/troubleshooting/network?utm_source=cura&utm_medium=software&utm_campaign=manage-network-printer");
onLinkActivated: Qt.openUrlExternally(link)
}
@ -183,32 +168,26 @@ Cura.MachineAction
width: Math.round(parent.width * 0.5)
visible: base.selectedDevice ? true : false
spacing: UM.Theme.getSize("default_margin").height
Label
UM.Label
{
width: parent.width
wrapMode: Text.WordWrap
text: base.selectedDevice ? base.selectedDevice.name : ""
font: UM.Theme.getFont("large_bold")
elide: Text.ElideRight
renderType: Text.NativeRendering
}
Grid
GridLayout
{
visible: base.completeProperties
width: parent.width
columns: 2
Label
UM.Label
{
width: Math.round(parent.width * 0.5)
wrapMode: Text.WordWrap
renderType: Text.NativeRendering
Layout.fillWidth: true
text: catalog.i18nc("@label", "Type")
}
Label
UM.Label
{
width: Math.round(parent.width * 0.5)
wrapMode: Text.WordWrap
renderType: Text.NativeRendering
Layout.fillWidth: true
text:
{
if (base.selectedDevice) {
@ -217,41 +196,31 @@ Cura.MachineAction
return ""
}
}
Label
UM.Label
{
width: Math.round(parent.width * 0.5)
wrapMode: Text.WordWrap
renderType: Text.NativeRendering
Layout.fillWidth: true
text: catalog.i18nc("@label", "Firmware version")
}
Label
UM.Label
{
width: Math.round(parent.width * 0.5)
wrapMode: Text.WordWrap
renderType: Text.NativeRendering
Layout.fillWidth: true
text: base.selectedDevice ? base.selectedDevice.firmwareVersion : ""
}
Label
UM.Label
{
width: Math.round(parent.width * 0.5)
wrapMode: Text.WordWrap
renderType: Text.NativeRendering
Layout.fillWidth: true
text: catalog.i18nc("@label", "Address")
}
Label
UM.Label
{
width: Math.round(parent.width * 0.5)
wrapMode: Text.WordWrap
renderType: Text.NativeRendering
Layout.fillWidth: true
text: base.selectedDevice ? base.selectedDevice.ipAddress : ""
}
}
Label
UM.Label
{
width: parent.width
wrapMode: Text.WordWrap
renderType: Text.NativeRendering
text:{
// The property cluster size does not exist for older UM3 devices.
if(!base.selectedDevice || base.selectedDevice.clusterSize == null || base.selectedDevice.clusterSize == 1)
@ -269,16 +238,14 @@ Cura.MachineAction
}
}
Label
UM.Label
{
width: parent.width
wrapMode: Text.WordWrap
renderType: Text.NativeRendering
visible: base.selectedDevice != null && !base.completeProperties
text: catalog.i18nc("@label", "The printer at this address has not yet responded." )
}
Button
Cura.SecondaryButton
{
text: catalog.i18nc("@action:button", "Connect")
enabled: (base.selectedDevice && base.completeProperties && base.selectedDevice.clusterSize > 0) ? true : false
@ -288,18 +255,15 @@ Cura.MachineAction
}
}
MessageDialog
Cura.MessageDialog
{
id: invalidIPAddressMessageDialog
x: parent ? (parent.x + (parent.width) / 2) : 0
y: parent ? (parent.y + (parent.height) / 2) : 0
title: catalog.i18nc("@title:window", "Invalid IP address")
text: catalog.i18nc("@text", "Please enter a valid IP address.")
icon: StandardIcon.Warning
standardButtons: StandardButton.Ok
standardButtons: Dialog.Ok
}
UM.Dialog
Cura.MessageDialog
{
id: manualPrinterDialog
property string printerKey
@ -307,17 +271,19 @@ Cura.MachineAction
title: catalog.i18nc("@title:window", "Printer Address")
minimumWidth: 400 * screenScaleFactor
minimumHeight: 130 * screenScaleFactor
width: minimumWidth
height: minimumHeight
width: UM.Theme.getSize("small_popup_dialog").width
height: UM.Theme.getSize("small_popup_dialog").height
anchors.centerIn: Overlay.overlay
standardButtons: Dialog.Yes | Dialog.No
signal showDialog(string key, string address)
onShowDialog:
{
printerKey = key;
addressText = address;
manualPrinterDialog.show();
manualPrinterDialog.open();
addressField.selectAll();
addressField.focus = true;
}
@ -326,67 +292,45 @@ Cura.MachineAction
anchors.fill: parent
spacing: UM.Theme.getSize("default_margin").height
Label
UM.Label
{
text: catalog.i18nc("@label", "Enter the IP address of your printer on the network.")
width: parent.width
wrapMode: Text.WordWrap
renderType: Text.NativeRendering
}
TextField
Cura.TextField
{
id: addressField
width: parent.width
validator: RegExpValidator
{
regExp: /[a-zA-Z0-9\.\-\_]*/
}
onAccepted: btnOk.clicked()
validator: RegExpValidator { regExp: /[a-zA-Z0-9\.\-\_]*/ }
}
}
rightButtons: [
Button {
text: catalog.i18nc("@action:button","Cancel")
onClicked:
{
manualPrinterDialog.reject()
manualPrinterDialog.hide()
}
},
Button {
id: btnOk
text: catalog.i18nc("@action:button", "OK")
onClicked:
{
// Validate the input first
if (!networkingUtil.isValidIP(manualPrinterDialog.addressText))
{
invalidIPAddressMessageDialog.open()
return
}
// if the entered IP address has already been discovered, switch the current item to that item
// and do nothing else.
for (var i = 0; i < manager.foundDevices.length; i++)
{
var device = manager.foundDevices[i]
if (device.address == manualPrinterDialog.addressText)
{
currentItemIndex = i
manualPrinterDialog.hide()
return
}
}
manager.setManualDevice(manualPrinterDialog.printerKey, manualPrinterDialog.addressText)
manualPrinterDialog.hide()
}
enabled: manualPrinterDialog.addressText.trim() != ""
isDefault: true
onAccepted:
{
// Validate the input first
if (!networkingUtil.isValidIP(manualPrinterDialog.addressText))
{
// prefent closing of element, as we want to keep the dialog active after a wrongly entered IP adress
manualPrinterDialog.open()
// show invalid ip warning
invalidIPAddressMessageDialog.open();
return;
}
]
// if the entered IP address has already been discovered, switch the current item to that item
// and do nothing else.
for (var i = 0; i < manager.foundDevices.length; i++)
{
var device = manager.foundDevices[i]
if (device.address == manualPrinterDialog.addressText)
{
currentItemIndex = i;
return;
}
}
manager.setManualDevice(manualPrinterDialog.printerKey, manualPrinterDialog.addressText);
}
}
}

View file

@ -3,8 +3,6 @@
import QtQuick 2.2
import QtQuick.Controls 2.0
import QtQuick.Controls.Styles 1.4
import QtQuick.Dialogs 1.1
import QtGraphicalEffects 1.0
import UM 1.3 as UM

View file

@ -3,7 +3,7 @@
import QtQuick 2.2
import QtQuick.Controls 2.0
import UM 1.3 as UM
import UM 1.5 as UM
/**
* This component comprises a buildplate icon and the buildplate name. It is
@ -57,19 +57,15 @@ Item
}
}
Label
UM.Label
{
id: buildplateLabel
color: UM.Theme.getColor("text")
elide: Text.ElideRight
font: UM.Theme.getFont("default") // 12pt, regular
text: buildplate ? buildplate : ""
visible: text !== ""
// FIXED-LINE-HEIGHT:
height: 18 * screenScaleFactor // TODO: Theme!
verticalAlignment: Text.AlignVCenter
renderType: Text.NativeRendering
}
}
}

View file

@ -2,10 +2,10 @@
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.3
import QtQuick.Controls 1.4
import QtQuick.Controls 2.4
import QtQuick.Layouts 1.3
import QtQuick.Dialogs 1.2
import UM 1.3 as UM
import UM 1.5 as UM
import Cura 1.5 as Cura
UM.Dialog
{
@ -18,12 +18,21 @@ UM.Dialog
width: minimumWidth
height: minimumHeight
title: catalog.i18nc("@title:window", "Configuration Changes")
buttonSpacing: UM.Theme.getSize("narrow_margin").width
rightButtons:
[
Button
Cura.TertiaryButton
{
id: cancelButton
text: catalog.i18nc("@action:button", "Cancel")
onClicked:
{
overrideConfirmationDialog.reject()
}
},
Cura.PrimaryButton
{
id: overrideButton
anchors.margins: UM.Theme.getSize("default_margin").width
text: catalog.i18nc("@action:button", "Override")
onClicked:
{
@ -50,20 +59,10 @@ UM.Dialog
}
return true
}
},
Button
{
id: cancelButton
anchors.margins: UM.Theme.getSize("default_margin").width
text: catalog.i18nc("@action:button", "Cancel")
onClicked:
{
overrideConfirmationDialog.reject()
}
}
]
Label
UM.Label
{
anchors
{
@ -72,7 +71,6 @@ UM.Dialog
bottomMargin: 56 * screenScaleFactor // TODO: Theme!
}
wrapMode: Text.WordWrap
renderType: Text.NativeRendering
text:
{
if (!printer || !printer.activePrintJob)

View file

@ -1,10 +1,10 @@
// Copyright (c) 2019 Ultimaker B.V.
// Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.3
import QtQuick.Controls 2.0
import QtQuick.Dialogs 1.1
import UM 1.3 as UM
import QtQuick.Controls 2.15
import UM 1.5 as UM
import Cura 1.6 as Cura
/**
* A MonitorInfoBlurb is an extension of the GenericPopUp used to show static information (vs. interactive context
@ -134,32 +134,29 @@ Item
}
}
MessageDialog {
Cura.MessageDialog
{
id: sendToTopConfirmationDialog
Component.onCompleted: visible = false
icon: StandardIcon.Warning
onYes: OutputDevice.sendJobToTop(printJob.key)
standardButtons: StandardButton.Yes | StandardButton.No
onAccepted: OutputDevice.sendJobToTop(printJob.key)
standardButtons: Dialog.Yes | Dialog.No
text: printJob && printJob.name ? catalog.i18nc("@label %1 is the name of a print job.", "Are you sure you want to move %1 to the top of the queue?").arg(printJob.name) : ""
title: catalog.i18nc("@window:title", "Move print job to top")
}
MessageDialog {
Cura.MessageDialog
{
id: deleteConfirmationDialog
Component.onCompleted: visible = false
icon: StandardIcon.Warning
onYes: OutputDevice.deleteJobFromQueue(printJob.key)
standardButtons: StandardButton.Yes | StandardButton.No
onAccepted: OutputDevice.deleteJobFromQueue(printJob.key)
standardButtons: Dialog.Yes | Dialog.No
text: printJob && printJob.name ? catalog.i18nc("@label %1 is the name of a print job.", "Are you sure you want to delete %1?").arg(printJob.name) : ""
title: catalog.i18nc("@window:title", "Delete print job")
}
MessageDialog {
Cura.MessageDialog
{
id: abortConfirmationDialog
Component.onCompleted: visible = false
icon: StandardIcon.Warning
onYes: printJob.setState("abort")
standardButtons: StandardButton.Yes | StandardButton.No
onAccepted: printJob.setState("abort")
standardButtons: Dialog.Yes | Dialog.No
text: printJob && printJob.name ? catalog.i18nc("@label %1 is the name of a print job.", "Are you sure you want to abort %1?").arg(printJob.name) : ""
title: catalog.i18nc("@window:title", "Abort print")
}

View file

@ -3,7 +3,7 @@
import QtQuick 2.3
import QtQuick.Controls 2.0
import UM 1.3 as UM
import UM 1.5 as UM
import Cura 1.0 as Cura
Button
@ -17,13 +17,12 @@ Button
radius: Math.round(0.5 * width)
width: base.width
}
contentItem: Label {
contentItem: UM.Label
{
color: enabled ? UM.Theme.getColor("text") : UM.Theme.getColor("monitor_text_disabled")
font.pixelSize: 32 * screenScaleFactor
horizontalAlignment: Text.AlignHCenter
text: base.text
verticalAlignment: Text.AlignVCenter
renderType: Text.NativeRendering;
}
height: width
hoverEnabled: enabled

View file

@ -3,7 +3,7 @@
import QtQuick 2.2
import QtQuick.Controls 2.0
import UM 1.3 as UM
import UM 1.5 as UM
/**
* This component is a sort of "super icon" which includes a colored SVG image
@ -35,18 +35,16 @@ Item
width: size
}
Label
UM.Label
{
id: positionLabel
anchors.centerIn: icon
font: UM.Theme.getFont("small")
color: UM.Theme.getColor("text")
height: Math.round(size / 2)
horizontalAlignment: Text.AlignHCenter
text: position + 1
verticalAlignment: Text.AlignVCenter
width: Math.round(size / 2)
visible: position >= 0
renderType: Text.NativeRendering
}
}

View file

@ -2,7 +2,7 @@
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2
import QtQuick.Controls 2.0
import UM 1.3 as UM
import UM 1.5 as UM
import Cura 1.0 as Cura
/**
@ -55,10 +55,9 @@ Item
visible: !printJob
radius: 2 * screenScaleFactor // TODO: Theme!
}
Label
UM.Label
{
text: printJob && printJob.name ? printJob.name : ""
color: UM.Theme.getColor("text")
elide: Text.ElideRight
font: UM.Theme.getFont("medium") // 14pt, regular
visible: printJob
@ -66,8 +65,6 @@ Item
// FIXED-LINE-HEIGHT:
width: parent.width
height: parent.height
verticalAlignment: Text.AlignVCenter
renderType: Text.NativeRendering
}
}
@ -86,18 +83,15 @@ Item
radius: 2 * screenScaleFactor // TODO: Theme!
}
Label
UM.Label
{
text: printJob ? OutputDevice.formatDuration(printJob.timeTotal) : ""
color: UM.Theme.getColor("text")
elide: Text.ElideRight
font: UM.Theme.getFont("medium") // 14pt, regular
visible: printJob
// FIXED-LINE-HEIGHT:
height: Math.round(18 * screenScaleFactor) // TODO: Theme!
verticalAlignment: Text.AlignVCenter
renderType: Text.NativeRendering
}
}
@ -116,11 +110,10 @@ Item
radius: 2 * screenScaleFactor // TODO: Theme!
}
Label
UM.Label
{
id: printerAssignmentLabel
anchors.verticalCenter: parent.verticalCenter
color: UM.Theme.getColor("text")
elide: Text.ElideRight
font: UM.Theme.getFont("medium") // 14pt, regular
text: {
@ -143,8 +136,6 @@ Item
// FIXED-LINE-HEIGHT:
height: parent.height
verticalAlignment: Text.AlignVCenter
renderType: Text.NativeRendering
}
Row
@ -186,17 +177,15 @@ Item
height: Math.round(72 * screenScaleFactor) // TODO: Theme!
}
Label {
UM.Label
{
text: printJob && printJob.owner ? printJob.owner : ""
color: UM.Theme.getColor("text")
elide: Text.ElideRight
font: UM.Theme.getFont("medium") // 14pt, regular
anchors.top: printerConfiguration.top
// FIXED-LINE-HEIGHT:
height: Math.round(18 * screenScaleFactor) // TODO: Theme!
verticalAlignment: Text.AlignVCenter
renderType: Text.NativeRendering
}
}
}

View file

@ -2,9 +2,7 @@
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.3
import QtQuick.Controls.Styles 1.3
import QtQuick.Controls 1.4
import UM 1.3 as UM
import UM 1.5 as UM
/**
* NOTE: For most labels, a fixed height with vertical alignment is used to make
@ -20,7 +18,7 @@ Item
property var printJob: null
width: childrenRect.width
height: UM.Theme.getSize("monitor_text_line").height
height: percentLabel.height
UM.ProgressBar
{
@ -34,36 +32,28 @@ Item
width: UM.Theme.getSize("monitor_progress_bar").width
}
Label
UM.Label
{
id: percentLabel
anchors
{
left: progressBar.right
leftMargin: UM.Theme.getSize("monitor_margin").width
verticalCenter: parent.verticalCenter
leftMargin: UM.Theme.getSize("default_margin").width
}
text: printJob ? Math.round(printJob.progress * 100) + "%" : "0%"
color: printJob && printJob.isActive ? UM.Theme.getColor("text") : UM.Theme.getColor("monitor_text_disabled")
width: contentWidth
font: UM.Theme.getFont("default") // 12pt, regular
// FIXED-LINE-HEIGHT:
height: UM.Theme.getSize("monitor_text_line").height
verticalAlignment: Text.AlignVCenter
renderType: Text.NativeRendering
wrapMode: Text.NoWrap
}
Label
UM.Label
{
id: statusLabel
anchors
{
left: percentLabel.right
leftMargin: UM.Theme.getSize("monitor_margin").width
verticalCenter: parent.verticalCenter
leftMargin: UM.Theme.getSize("default_margin").width
}
color: UM.Theme.getColor("text")
font: UM.Theme.getFont("default")
wrapMode: Text.NoWrap
text:
{
if (!printJob)
@ -117,10 +107,5 @@ Item
}
}
width: contentWidth
// FIXED-LINE-HEIGHT:
height: UM.Theme.getSize("monitor_text_line").height
verticalAlignment: Text.AlignVCenter
renderType: Text.NativeRendering
}
}

View file

@ -3,8 +3,7 @@
import QtQuick 2.3
import QtQuick.Controls 2.0
import QtQuick.Dialogs 1.1
import UM 1.3 as UM
import UM 1.5 as UM
import Cura 1.0 as Cura
/**
@ -64,7 +63,7 @@ Item
leftMargin: 36 * screenScaleFactor // TODO: Theme!
verticalCenter: parent.verticalCenter
}
spacing: 18 * screenScaleFactor // TODO: Theme!
spacing: UM.Theme.getSize("default_margin").width
Rectangle
{
@ -96,23 +95,18 @@ Item
{
id: printerNameLabel
color: printer ? "transparent" : UM.Theme.getColor("monitor_skeleton_loading")
height: 18 * screenScaleFactor // TODO: Theme!
height: UM.Theme.getSize("default_margin").width
width: parent.width
radius: 2 * screenScaleFactor // TODO: Theme!
radius: UM.Theme.getSize("default_radius").width
Label
UM.Label
{
text: printer && printer.name ? printer.name : ""
color: UM.Theme.getColor("text")
elide: Text.ElideRight
font: UM.Theme.getFont("large") // 16pt, bold
width: parent.width
visible: printer
// FIXED-LINE-HEIGHT:
height: parent.height
verticalAlignment: Text.AlignVCenter
renderType: Text.NativeRendering
}
}
@ -120,7 +114,7 @@ Item
{
color: UM.Theme.getColor("monitor_skeleton_loading")
height: 18 * screenScaleFactor // TODO: Theme!
radius: 2 * screenScaleFactor // TODO: Theme!
radius: UM.Theme.getSize("default_radius").width
visible: !printer
width: 48 * screenScaleFactor // TODO: Theme!
}
@ -138,21 +132,20 @@ Item
Item
{
id: managePrinterLink
anchors {
anchors
{
top: printerFamilyPill.bottom
topMargin: UM.Theme.getSize("narrow_margin").height
}
height: 18 * screenScaleFactor // TODO: Theme!
width: childrenRect.width
Label
UM.Label
{
id: managePrinterText
anchors.verticalCenter: managePrinterLink.verticalCenter
color: UM.Theme.getColor("text_link")
font: UM.Theme.getFont("default")
text: catalog.i18nc("@label link to Connect and Cloud interfaces", "Manage printer")
renderType: Text.NativeRendering
}
UM.RecolorImage
{
@ -165,22 +158,16 @@ Item
}
color: UM.Theme.getColor("text_link")
source: UM.Theme.getIcon("LinkExternal")
width: 12 * screenScaleFactor
height: 12 * screenScaleFactor
width: UM.Theme.getSize("icon").width
height: UM.Theme.getSize("icon").height
}
}
MouseArea
{
anchors.fill: managePrinterLink
onClicked: OutputDevice.openPrinterControlPanel()
onEntered:
{
manageQueueText.font.underline = true
}
onExited:
{
manageQueueText.font.underline = false
}
onEntered: manageQueueText.font.underline = true
onExited: manageQueueText.font.underline = false
}
}
@ -332,9 +319,9 @@ Item
leftMargin: 36 * screenScaleFactor // TODO: Theme!
}
height: childrenRect.height
spacing: 18 * screenScaleFactor // TODO: Theme!
spacing: UM.Theme.getSize("default_margin").width
Label
UM.Label
{
id: printerStatus
anchors
@ -371,7 +358,6 @@ Item
return ""
}
visible: text !== ""
renderType: Text.NativeRendering
}
Item
@ -401,22 +387,18 @@ Item
height: printerNameLabel.height + printerFamilyPill.height + 6 * screenScaleFactor // TODO: Theme!
visible: printer && printer.activePrintJob && !printerStatus.visible
Label
UM.Label
{
id: printerJobNameLabel
color: printer && printer.activePrintJob && printer.activePrintJob.isActive ? UM.Theme.getColor("text") : UM.Theme.getColor("monitor_text_disabled")
elide: Text.ElideRight
wrapMode: Text.NoWrap
font: UM.Theme.getFont("large") // 16pt, bold
text: printer && printer.activePrintJob ? printer.activePrintJob.name : catalog.i18nc("@label", "Untitled")
width: parent.width
// FIXED-LINE-HEIGHT:
height: 18 * screenScaleFactor // TODO: Theme!
verticalAlignment: Text.AlignVCenter
renderType: Text.NativeRendering
}
Label
UM.Label
{
id: printerJobOwnerLabel
anchors
@ -427,14 +409,8 @@ Item
}
color: printer && printer.activePrintJob && printer.activePrintJob.isActive ? UM.Theme.getColor("text") : UM.Theme.getColor("monitor_text_disabled")
elide: Text.ElideRight
font: UM.Theme.getFont("default") // 12pt, regular
text: printer && printer.activePrintJob ? printer.activePrintJob.owner : catalog.i18nc("@label", "Anonymous")
width: parent.width
// FIXED-LINE-HEIGHT:
height: 18 * screenScaleFactor // TODO: Theme!
verticalAlignment: Text.AlignVCenter
renderType: Text.NativeRendering
}
}
@ -448,59 +424,27 @@ Item
visible: printer && printer.activePrintJob && printer.activePrintJob.configurationChanges.length === 0 && !printerStatus.visible
}
Label
UM.Label
{
anchors
{
verticalCenter: parent.verticalCenter
}
font: UM.Theme.getFont("default")
text: catalog.i18nc("@label:status", "Requires configuration changes")
visible: printer && printer.activePrintJob && printer.activePrintJob.configurationChanges.length > 0 && !printerStatus.visible
color: UM.Theme.getColor("text")
// FIXED-LINE-HEIGHT:
height: 18 * screenScaleFactor // TODO: Theme!
verticalAlignment: Text.AlignVCenter
renderType: Text.NativeRendering
}
}
Button
Cura.SecondaryButton
{
id: detailsButton
anchors
{
verticalCenter: parent.verticalCenter
right: parent.right
rightMargin: 18 * screenScaleFactor // TODO: Theme!
rightMargin: UM.Theme.getSize("default_margin").width
}
background: Rectangle
{
color: UM.Theme.getColor("monitor_secondary_button_shadow")
radius: 2 * screenScaleFactor // Todo: Theme!
Rectangle
{
anchors.fill: parent
anchors.bottomMargin: 2 * screenScaleFactor // TODO: Theme!
color: detailsButton.hovered ? UM.Theme.getColor("monitor_secondary_button_hover") : UM.Theme.getColor("monitor_secondary_button")
radius: 2 * screenScaleFactor // Todo: Theme!
}
}
contentItem: Label
{
anchors.fill: parent
anchors.bottomMargin: 2 * screenScaleFactor // TODO: Theme!
color: UM.Theme.getColor("monitor_secondary_button_text")
font: UM.Theme.getFont("medium") // 14pt, regular
text: catalog.i18nc("@action:button", "Details");
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
height: 18 * screenScaleFactor // TODO: Theme!
renderType: Text.NativeRendering
}
implicitHeight: 32 * screenScaleFactor // TODO: Theme!
implicitWidth: 96 * screenScaleFactor // TODO: Theme!
text: catalog.i18nc("@action:button", "Details")
visible: printer && printer.activePrintJob && printer.activePrintJob.configurationChanges.length > 0 && !printerStatus.visible
onClicked: base.enabled ? overrideConfirmationDialog.open() : {}
enabled: OutputDevice.supportsPrintJobActions

View file

@ -2,8 +2,7 @@
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2
import QtQuick.Controls 1.4
import UM 1.2 as UM
import UM 1.5 as UM
/**
* A MonitorPrinterPill is a blue-colored tag indicating which printers a print
@ -17,20 +16,19 @@ Item
implicitHeight: 18 * screenScaleFactor // TODO: Theme!
implicitWidth: Math.max(printerNameLabel.contentWidth + 12 * screenScaleFactor, 36 * screenScaleFactor) // TODO: Theme!
Rectangle {
Rectangle
{
id: background
anchors.fill: parent
color: printerNameLabel.visible ? UM.Theme.getColor("monitor_printer_family_tag") : UM.Theme.getColor("monitor_skeleton_loading")
radius: 2 * screenScaleFactor // TODO: Theme!
}
Label {
UM.Label
{
id: printerNameLabel
anchors.centerIn: parent
color: UM.Theme.getColor("text")
text: monitorPrinterPill.text
font.pointSize: 10 // TODO: Theme!
visible: monitorPrinterPill.text !== ""
renderType: Text.NativeRendering
}
}

View file

@ -1,10 +1,9 @@
// Copyright (c) 2019 Ultimaker B.V.
// Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import UM 1.3 as UM
import QtQuick.Controls 2.15
import UM 1.5 as UM
import Cura 1.0 as Cura
/**
@ -18,18 +17,16 @@ Item
// they might not need to though.
property bool cloudConnection: Cura.MachineManager.activeMachineIsUsingCloudConnection
Label
UM.Label
{
id: queuedLabel
anchors
{
left: queuedPrintJobs.left
left: printJobList.left
top: parent.top
}
color: UM.Theme.getColor("text")
font: UM.Theme.getFont("large")
text: catalog.i18nc("@label", "Queued")
renderType: Text.NativeRendering
}
Item
@ -37,7 +34,7 @@ Item
id: manageQueueLabel
anchors
{
right: queuedPrintJobs.right
right: printJobList.right
verticalCenter: queuedLabel.verticalCenter
}
height: 18 * screenScaleFactor // TODO: Theme!
@ -52,7 +49,7 @@ Item
width: 16 * screenScaleFactor // TODO: Theme! (Y U NO USE 18 LIKE ALL OTHER ICONS?!)
height: 16 * screenScaleFactor // TODO: Theme! (Y U NO USE 18 LIKE ALL OTHER ICONS?!)
}
Label
UM.Label
{
id: manageQueueText
anchors
@ -64,7 +61,6 @@ Item
color: UM.Theme.getColor("text_link")
font: UM.Theme.getFont("medium") // 14pt, regular
text: catalog.i18nc("@label link to connect manager", "Manage in browser")
renderType: Text.NativeRendering
}
}
@ -72,14 +68,9 @@ Item
{
anchors.fill: manageQueueLabel
onClicked: OutputDevice.openPrintJobControlPanel()
onEntered:
{
manageQueueText.font.underline = true
}
onExited:
{
manageQueueText.font.underline = false
}
onEntered: manageQueueText.font.underline = true
onExited: manageQueueText.font.underline = false
}
Row
@ -87,96 +78,85 @@ Item
id: printJobQueueHeadings
anchors
{
left: queuedPrintJobs.left
left: printJobList.left
leftMargin: UM.Theme.getSize("narrow_margin").width
top: queuedLabel.bottom
topMargin: 24 * screenScaleFactor // TODO: Theme!
}
spacing: 18 * screenScaleFactor // TODO: Theme!
Label
UM.Label
{
text: catalog.i18nc("@label", "There are no print jobs in the queue. Slice and send a job to add one.")
color: UM.Theme.getColor("text")
font: UM.Theme.getFont("medium")
anchors.verticalCenter: parent.verticalCenter
renderType: Text.NativeRendering
visible: printJobList.count === 0
}
Label
UM.Label
{
text: catalog.i18nc("@label", "Print jobs")
color: UM.Theme.getColor("text")
font: UM.Theme.getFont("medium") // 14pt, regular
anchors.verticalCenter: parent.verticalCenter
width: 284 * screenScaleFactor // TODO: Theme! (Should match column size)
renderType: Text.NativeRendering
visible: printJobList.count > 0
}
Label
UM.Label
{
text: catalog.i18nc("@label", "Total print time")
color: UM.Theme.getColor("text")
font: UM.Theme.getFont("medium") // 14pt, regular
anchors.verticalCenter: parent.verticalCenter
width: UM.Theme.getSize("monitor_column").width
renderType: Text.NativeRendering
visible: printJobList.count > 0
}
Label
UM.Label
{
text: catalog.i18nc("@label", "Waiting for")
color: UM.Theme.getColor("text")
font: UM.Theme.getFont("medium") // 14pt, regular
anchors.verticalCenter: parent.verticalCenter
width: UM.Theme.getSize("monitor_column").width
renderType: Text.NativeRendering
visible: printJobList.count > 0
}
}
ScrollView
ListView
{
id: queuedPrintJobs
id: printJobList
anchors
{
bottom: parent.bottom
horizontalCenter: parent.horizontalCenter
top: printJobQueueHeadings.bottom
topMargin: 12 * screenScaleFactor // TODO: Theme!
topMargin: UM.Theme.getSize("default_margin").width
}
style: UM.Theme.styles.scrollview
width: parent.width
ListView
ScrollBar.vertical: UM.ScrollBar
{
id: printJobList
anchors.fill: parent
delegate: MonitorPrintJobCard
id: printJobScrollBar
}
spacing: UM.Theme.getSize("narrow_margin").width
clip: true
delegate: MonitorPrintJobCard
{
anchors
{
anchors
{
left: parent.left
right: parent.right
}
printJob: modelData
left: parent.left
right: parent.right
rightMargin: printJobScrollBar.width
}
model:
printJob: modelData
}
model:
{
if (OutputDevice.receivedData)
{
if (OutputDevice.receivedData)
{
return OutputDevice.queuedPrintJobs
}
return [null, null]
return OutputDevice.queuedPrintJobs
}
spacing: 6 // TODO: Theme!
return [null, null]
}
}
}

View file

@ -2,8 +2,6 @@
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import UM 1.3 as UM
import Cura 1.0 as Cura

View file

@ -1,24 +1,24 @@
// Copyright (c) 2019 Ultimaker B.V.
// Copyright (c) 2021 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2
import QtQuick.Controls 2.0
import QtQuick.Controls.Styles 1.4
import UM 1.3 as UM
import UM 1.5 as UM
Button {
background: Rectangle {
opacity: parent.down || parent.hovered ? 1 : 0;
Button
{
background: Rectangle
{
opacity: parent.down || parent.hovered ? 1 : 0
color: UM.Theme.getColor("monitor_context_menu_hover")
}
contentItem: Label {
color: enabled ? UM.Theme.getColor("text") : UM.Theme.getColor("monitor_text_disabled");
contentItem: UM.Label
{
color: enabled ? UM.Theme.getColor("text") : UM.Theme.getColor("monitor_text_disabled")
text: parent.text
horizontalAlignment: Text.AlignLeft;
verticalAlignment: Text.AlignVCenter;
renderType: Text.NativeRendering;
horizontalAlignment: Text.AlignLeft
}
height: visible ? 39 * screenScaleFactor : 0; // TODO: Theme!
hoverEnabled: true;
width: parent.width;
height: visible ? 39 * screenScaleFactor : 0 // TODO: Theme!
hoverEnabled: true
width: parent.width
}

View file

@ -2,8 +2,7 @@
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2
import QtQuick.Window 2.2
import QtQuick.Controls 1.1
import QtQuick.Controls 2.15 as NewControls
import QtQuick.Controls 2.15
import UM 1.1 as UM
@ -84,7 +83,7 @@ UM.Dialog {
renderType: Text.NativeRendering;
}
NewControls.ComboBox {
ComboBox {
id: printerComboBox;
currentIndex: 0;
Behavior on height { NumberAnimation { duration: 100 } }

View file

@ -2,8 +2,6 @@
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import UM 1.3 as UM
import Cura 1.0 as Cura