diff options
Diffstat (limited to 'resources/qml')
105 files changed, 908 insertions, 694 deletions
diff --git a/resources/qml/Account/AccountWidget.qml b/resources/qml/Account/AccountWidget.qml index d738c5c474..84a0caede1 100644 --- a/resources/qml/Account/AccountWidget.qml +++ b/resources/qml/Account/AccountWidget.qml @@ -10,7 +10,7 @@ import Cura 1.1 as Cura Item { property var profile: Cura.API.account.userProfile - property var loggedIn: Cura.API.account.isLoggedIn + property bool loggedIn: Cura.API.account.isLoggedIn height: signInButton.visible ? signInButton.height : accountWidget.height width: signInButton.visible ? signInButton.width : accountWidget.width @@ -81,6 +81,7 @@ Item source: (loggedIn && profile["profile_image_url"]) ? profile["profile_image_url"] : "" outlineColor: loggedIn ? UM.Theme.getColor("account_widget_outline_active") : UM.Theme.getColor("lining") + maskColor: UM.Theme.getColor("main_window_header_background") } contentItem: Item diff --git a/resources/qml/Account/AvatarImage.qml b/resources/qml/Account/AvatarImage.qml index 58c39e5065..6a60e993d8 100644 --- a/resources/qml/Account/AvatarImage.qml +++ b/resources/qml/Account/AvatarImage.qml @@ -3,7 +3,6 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 -import QtGraphicalEffects 1.0 import UM 1.4 as UM @@ -16,44 +15,46 @@ Item property alias source: profileImage.source property alias outlineColor: profileImageOutline.color + + // This should be set to the color behind the image + // It fills the space around a rectangular avatar to make the image under it look circular + property alias maskColor: profileImageMask.color property bool hasAvatar: source != "" + Rectangle + { + id: profileImageBackground + anchors.fill: parent + radius: width + color: "white" + } + Image { id: profileImage anchors.fill: parent fillMode: Image.PreserveAspectCrop - visible: false + visible: hasAvatar mipmap: true } - Rectangle + UM.ColorImage { + // This image is a rectangle with a hole in the middle. + // Since we don't have access to proper masking in QT6 yet this is used as a primitive masking replacement id: profileImageMask anchors.fill: parent - radius: width - color: hasAvatar ? "white" : "transparent" - } - - OpacityMask - { - anchors.fill: parent - source: profileImage - maskSource: profileImageMask - visible: hasAvatar - cached: true + source: UM.Theme.getIcon("CircleMask") } - UM.RecolorImage + UM.ColorImage { + // This creates the circle outline around the image id: profileImageOutline - anchors.centerIn: parent - // Make it a bit bigger than it has to, otherwise it sometimes shows a white border. - width: parent.width + 2 - height: parent.height + 2 + anchors.fill: parent + anchors.margins: .25 visible: hasAvatar source: UM.Theme.getIcon("CircleOutline") - sourceSize: Qt.size(parent.width, parent.height) color: UM.Theme.getColor("account_widget_outline_active") } } diff --git a/resources/qml/Account/SyncState.qml b/resources/qml/Account/SyncState.qml index e5731ff9d7..b558714376 100644 --- a/resources/qml/Account/SyncState.qml +++ b/resources/qml/Account/SyncState.qml @@ -13,37 +13,44 @@ Row // Sync state icon + message height: childrenRect.height spacing: UM.Theme.getSize("narrow_margin").height + // These are the enums from cura/API/account.py + // somehow exposing these enums from python to QML doesn't work properly anymore + property var _Cura_AccountSyncState_SYNCING: 0 + property var _Cura_AccountSyncState_SUCCESS: 1 + property var _Cura_AccountSyncState_ERROR: 2 + property var _Cura_AccountSyncState_IDLE: 3 + states: [ State { name: "idle" - when: syncState == Cura.AccountSyncState.IDLE + when: syncState == _Cura_AccountSyncState_IDLE PropertyChanges { target: icon; source: UM.Theme.getIcon("ArrowDoubleCircleRight")} }, State { name: "syncing" - when: syncState == Cura.AccountSyncState.SYNCING + when: syncState == _Cura_AccountSyncState_SYNCING PropertyChanges { target: icon; source: UM.Theme.getIcon("ArrowDoubleCircleRight") } PropertyChanges { target: stateLabel; text: catalog.i18nc("@label", "Checking...")} }, State { name: "up_to_date" - when: syncState == Cura.AccountSyncState.SUCCESS + when: syncState == _Cura_AccountSyncState_SUCCESS PropertyChanges { target: icon; source: UM.Theme.getIcon("CheckCircle") } PropertyChanges { target: stateLabel; text: catalog.i18nc("@label", "Account synced")} }, State { name: "error" - when: syncState == Cura.AccountSyncState.ERROR + when: syncState == _Cura_AccountSyncState_ERROR PropertyChanges { target: icon; source: UM.Theme.getIcon("Warning") } PropertyChanges { target: stateLabel; text: catalog.i18nc("@label", "Something went wrong...")} } ] - UM.RecolorImage + UM.ColorImage { id: icon width: 20 * screenScaleFactor diff --git a/resources/qml/Account/UserOperations.qml b/resources/qml/Account/UserOperations.qml index be858df993..9e5d082738 100644 --- a/resources/qml/Account/UserOperations.qml +++ b/resources/qml/Account/UserOperations.qml @@ -30,6 +30,7 @@ Column height: UM.Theme.getSize("main_window_header").height source: profile["profile_image_url"] ? profile["profile_image_url"] : "" + maskColor: UM.Theme.getColor("main_background") outlineColor: UM.Theme.getColor("main_background") } Rectangle @@ -45,7 +46,7 @@ Column { id: initialLabel anchors.centerIn: parent - text: profile["username"].charAt(0).toUpperCase() + text: profile.username.charAt(0).toUpperCase() font: UM.Theme.getFont("large_bold") horizontalAlignment: Text.AlignHCenter } @@ -89,8 +90,9 @@ Column Cura.TertiaryButton { id: cloudButton - width: UM.Theme.getSize("account_button").width + width: parent.width height: UM.Theme.getSize("account_button").height + text: "Ultimaker Digital Factory" onClicked: Qt.openUrlExternally(CuraApplication.ultimakerDigitalFactoryUrl + "?utm_source=cura&utm_medium=software&utm_campaign=menu-visit-DF") fixedWidthMode: false @@ -99,8 +101,9 @@ Column Cura.TertiaryButton { id: accountButton - width: UM.Theme.getSize("account_button").width + width: parent.width height: UM.Theme.getSize("account_button").height + text: catalog.i18nc("@button", "Ultimaker Account") onClicked: Qt.openUrlExternally(CuraApplication.ultimakerCloudAccountRootUrl + "?utm_source=cura&utm_medium=software&utm_campaign=menu-visit-account") fixedWidthMode: false @@ -116,7 +119,11 @@ Column Cura.TertiaryButton { id: signOutButton + width: parent.width + height: UM.Theme.getSize("account_button").height + onClicked: Cura.API.account.logout() text: catalog.i18nc("@button", "Sign Out") + fixedWidthMode: false } } diff --git a/resources/qml/ActionButton.qml b/resources/qml/ActionButton.qml index fece44d287..21cdda0627 100644 --- a/resources/qml/ActionButton.qml +++ b/resources/qml/ActionButton.qml @@ -3,7 +3,6 @@ import QtQuick 2.7 import QtQuick.Controls 2.1 -import QtGraphicalEffects 1.0 // For the dropshadow import UM 1.5 as UM import Cura 1.0 as Cura @@ -47,7 +46,7 @@ Button leftPadding: UM.Theme.getSize("default_margin").width rightPadding: UM.Theme.getSize("default_margin").width - height: UM.Theme.getSize("action_button").height + implicitHeight: UM.Theme.getSize("action_button").height hoverEnabled: true onHoveredChanged: @@ -63,14 +62,12 @@ Button spacing: UM.Theme.getSize("narrow_margin").width height: button.height //Left side icon. Only displayed if !isIconOnRightSide. - UM.RecolorImage + UM.ColorImage { id: buttonIconLeft source: "" height: visible ? button.iconSize : 0 width: visible ? height : 0 - sourceSize.width: width - sourceSize.height: height color: button.enabled ? (button.hovered ? button.textHoverColor : button.textColor) : button.textDisabledColor visible: source != "" && !button.isIconOnRightSide anchors.verticalCenter: parent.verticalCenter @@ -110,14 +107,12 @@ Button } //Right side icon. Only displayed if isIconOnRightSide. - UM.RecolorImage + UM.ColorImage { id: buttonIconRight source: buttonIconLeft.source height: visible ? button.iconSize : 0 width: visible ? height : 0 - sourceSize.width: width - sourceSize.height: height color: buttonIconLeft.color visible: source != "" && button.isIconOnRightSide anchors.verticalCenter: buttonIconLeft.verticalCenter @@ -160,6 +155,7 @@ Button height: parent.height visible: false + running: visible RotationAnimator { diff --git a/resources/qml/ActionPanel/PrintInformationWidget.qml b/resources/qml/ActionPanel/PrintInformationWidget.qml index d9923ce4e8..377bc3e979 100644 --- a/resources/qml/ActionPanel/PrintInformationWidget.qml +++ b/resources/qml/ActionPanel/PrintInformationWidget.qml @@ -7,7 +7,7 @@ import QtQuick.Controls 2.1 import UM 1.1 as UM import Cura 1.0 as Cura -UM.RecolorImage +UM.ColorImage { id: widget @@ -17,6 +17,8 @@ UM.RecolorImage color: UM.Theme.getColor("icon") + property var printMaterialCosts: PrintInformation.materialCosts + MouseArea { anchors.fill: parent @@ -37,8 +39,6 @@ UM.RecolorImage opacity: opened ? 1 : 0 Behavior on opacity { NumberAnimation { duration: 100 } } - contentWidth: printJobInformation.width - contentHeight: printJobInformation.implicitHeight contentItem: PrintJobInformation { diff --git a/resources/qml/ActionPanel/PrintJobInformation.qml b/resources/qml/ActionPanel/PrintJobInformation.qml index 9cdbf0714f..d142335d41 100644 --- a/resources/qml/ActionPanel/PrintJobInformation.qml +++ b/resources/qml/ActionPanel/PrintJobInformation.qml @@ -4,7 +4,7 @@ import QtQuick 2.7 import QtQuick.Controls 2.1 -import UM 1.1 as UM +import UM 1.5 as UM import Cura 1.0 as Cura Column @@ -26,15 +26,14 @@ Column leftPadding: UM.Theme.getSize("default_margin").width rightPadding: UM.Theme.getSize("default_margin").width - Label + UM.Label { text: catalog.i18nc("@label", "Time estimation").toUpperCase() color: UM.Theme.getColor("primary") font: UM.Theme.getFont("default_bold") - renderType: Text.NativeRendering } - Label + UM.Label { id: byLineType @@ -76,16 +75,13 @@ Column Repeater { model: modelData - Label + UM.Label { width: Math.round(byLineType.width * byLineType.columnWidthMultipliers[index]) height: contentHeight horizontalAlignment: byLineType.columnHorizontalAligns[index] - color: UM.Theme.getColor("text") - font: UM.Theme.getFont("default") wrapMode: Text.WrapAnywhere text: modelData - renderType: Text.NativeRendering } } } @@ -94,9 +90,6 @@ Column width: parent.width - 2 * UM.Theme.getSize("default_margin").width height: childrenRect.height - color: UM.Theme.getColor("text") - font: UM.Theme.getFont("default") - renderType: Text.NativeRendering textFormat: Text.RichText } } @@ -109,15 +102,14 @@ Column leftPadding: UM.Theme.getSize("default_margin").width rightPadding: UM.Theme.getSize("default_margin").width - Label + UM.Label { text: catalog.i18nc("@label", "Material estimation").toUpperCase() color: UM.Theme.getColor("primary") font: UM.Theme.getFont("default_bold") - renderType: Text.NativeRendering } - Label + UM.Label { id: byMaterialType @@ -180,16 +172,13 @@ Column Repeater { model: modelData - Label + UM.Label { width: Math.round(byMaterialType.width * byMaterialType.columnWidthMultipliers[index]) height: contentHeight horizontalAlignment: byMaterialType.columnHorizontalAligns[index] - color: UM.Theme.getColor("text") - font: UM.Theme.getFont("default") wrapMode: Text.WrapAnywhere text: modelData - renderType: Text.NativeRendering } } } @@ -198,9 +187,6 @@ Column width: parent.width - 2 * UM.Theme.getSize("default_margin").width height: childrenRect.height - color: UM.Theme.getColor("text") - font: UM.Theme.getFont("default") - renderType: Text.NativeRendering textFormat: Text.RichText } } diff --git a/resources/qml/ActionPanel/SliceProcessWidget.qml b/resources/qml/ActionPanel/SliceProcessWidget.qml index 868f23d242..cf70e4ba87 100644 --- a/resources/qml/ActionPanel/SliceProcessWidget.qml +++ b/resources/qml/ActionPanel/SliceProcessWidget.qml @@ -5,7 +5,7 @@ import QtQuick 2.7 import QtQuick.Controls 2.4 import QtQuick.Layouts 1.3 -import UM 1.4 as UM +import UM 1.5 as UM import Cura 1.0 as Cura @@ -45,16 +45,13 @@ Column } } - Label + UM.Label { id: autoSlicingLabel width: parent.width visible: progressBar.visible text: catalog.i18nc("@label:PrintjobStatus", "Slicing...") - color: UM.Theme.getColor("text") - font: UM.Theme.getFont("default") - renderType: Text.NativeRendering } Item { @@ -71,7 +68,7 @@ Column height: width status: UM.StatusIcon.Status.WARNING } - Label + UM.Label { id: label anchors.left: warningIcon.right @@ -79,9 +76,6 @@ Column anchors.verticalCenter: parent.verticalCenter anchors.leftMargin: UM.Theme.getSize("default_margin").width text: catalog.i18nc("@label:PrintjobStatus", "Unable to slice") - color: UM.Theme.getColor("text") - font: UM.Theme.getFont("default") - renderType: Text.NativeRendering wrapMode: Text.WordWrap } } @@ -119,6 +113,7 @@ Column text: widget.waitingForSliceToStart ? catalog.i18nc("@button", "Processing"): catalog.i18nc("@button", "Slice") tooltip: catalog.i18nc("@label", "Start the slicing process") + hoverEnabled: !widget.waitingForSliceToStart enabled: widget.backendState != UM.Backend.Error && !widget.waitingForSliceToStart visible: widget.backendState == UM.Backend.NotStarted || widget.backendState == UM.Backend.Error onClicked: { diff --git a/resources/qml/ApplicationSwitcher/ApplicationButton.qml b/resources/qml/ApplicationSwitcher/ApplicationButton.qml index 182b80811b..92624933cf 100644 --- a/resources/qml/ApplicationSwitcher/ApplicationButton.qml +++ b/resources/qml/ApplicationSwitcher/ApplicationButton.qml @@ -45,7 +45,7 @@ Button anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter - UM.RecolorImage + UM.ColorImage { id: applicationIcon anchors.horizontalCenter: parent.horizontalCenter @@ -54,7 +54,7 @@ Button width: UM.Theme.getSize("application_switcher_icon").width height: width - UM.RecolorImage + UM.ColorImage { id: externalLinkIndicatorIcon visible: base.isExternalLink @@ -82,7 +82,6 @@ Button height: base.height - applicationIcon.height - 2 * UM.Theme.getSize("default_margin").width // Account for the top and bottom margins horizontalAlignment: Text.AlignHCenter - wrapMode: Text.Wrap elide: Text.ElideRight } } diff --git a/resources/qml/ApplicationSwitcher/ApplicationSwitcher.qml b/resources/qml/ApplicationSwitcher/ApplicationSwitcher.qml index a8ea2312a5..69852270c1 100644 --- a/resources/qml/ApplicationSwitcher/ApplicationSwitcher.qml +++ b/resources/qml/ApplicationSwitcher/ApplicationSwitcher.qml @@ -31,7 +31,7 @@ Item Behavior on opacity { NumberAnimation { duration: 100; } } } - UM.RecolorImage + UM.ColorImage { anchors.fill: parent color: UM.Theme.getColor("primary_text") diff --git a/resources/qml/CategoryButton.qml b/resources/qml/CategoryButton.qml index b5d8bb2b2d..049ca032f0 100644 --- a/resources/qml/CategoryButton.qml +++ b/resources/qml/CategoryButton.qml @@ -78,7 +78,7 @@ Button id: content //spacing: UM.Theme.getSize("narrow_margin").width - UM.RecolorImage + UM.ColorImage { id: icon source: "" @@ -88,8 +88,6 @@ Button width: visible ? UM.Theme.getSize("section_icon").width: 0 height: UM.Theme.getSize("section_icon").height anchors.leftMargin: base.indented ? UM.Theme.getSize("default_margin").width: 0 - sourceSize.width: width - sourceSize.height: width } UM.Label @@ -106,15 +104,13 @@ Button color: UM.Theme.getColor("setting_category_text") } - UM.RecolorImage + UM.ColorImage { id: categoryArrow anchors.right: parent.right width: UM.Theme.getSize("standard_arrow").width height: UM.Theme.getSize("standard_arrow").height anchors.verticalCenter: parent.verticalCenter - sourceSize.width: width - sourceSize.height: height color: UM.Theme.getColor("setting_control_button") source: expanded ? UM.Theme.getIcon("ChevronSingleDown") : UM.Theme.getIcon("ChevronSingleLeft") } diff --git a/resources/qml/ColorDialog.qml b/resources/qml/ColorDialog.qml index 6877ef34b6..49adcf0cca 100644 --- a/resources/qml/ColorDialog.qml +++ b/resources/qml/ColorDialog.qml @@ -1,4 +1,7 @@ -import QtQuick 2.10 +// Copyright (c) 2022 Ultimaker B.V. +// Cura is released under the terms of the LGPLv3 or higher. + +import QtQuick 2.15 import QtQuick.Controls 2.2 import QtQuick.Window 2.1 import QtQuick.Layouts 1.1 @@ -26,7 +29,7 @@ UM.Dialog // the size of the dialog ourselves. // Ugly workaround for windows having overlapping elements due to incorrect dialog width minimumWidth: content.width + (Qt.platform.os == "windows" ? 4 * margin : 2 * margin) - minimumHeight: content.height + buttonRow.height + (Qt.platform.os == "windows" ? 5 * margin : 3 * margin) + minimumHeight: content.height + buttonArea.height + (Qt.platform.os == "windows" ? 5 * margin : 3 * margin) property alias color: colorInput.text property var swatchColors: [ @@ -77,7 +80,7 @@ UM.Dialog implicitHeight: UM.Theme.getSize("medium_button_icon").height radius: width / 2 - UM.RecolorImage + UM.ColorImage { anchors.fill: parent visible: swatchColor == base.color @@ -104,7 +107,7 @@ UM.Dialog text: catalog.i18nc("@label", "Hex") } - TextField + Cura.TextField { id: colorInput Layout.fillWidth: true @@ -116,7 +119,7 @@ UM.Dialog text = `#${text}`; } } - validator: RegExpValidator { regExp: /^#([a-fA-F0-9]{0,6})$/ } + validator: RegularExpressionValidator { regularExpression: /^#([a-fA-F0-9]{0,6})$/ } } Rectangle diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index 371754e9e0..d22e5a1526 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -3,8 +3,8 @@ import QtQuick 2.7 import QtQuick.Controls 2.15 -import QtQuick.Dialogs 1.2 -import QtGraphicalEffects 1.0 +import QtQuick.Dialogs + import UM 1.5 as UM import Cura 1.1 as Cura @@ -49,6 +49,22 @@ UM.MainWindow tooltip.hide(); } + MouseArea + { + // Hack introduced when switching to qt6 + // We used to be able to let the main window's default handlers control this, but something seems to be changed + // for qt6 in the ordering. TODO; We should find out what changed and have a less hacky fix for that. + enabled: parent.visible + anchors.fill: parent + hoverEnabled: true + acceptedButtons: Qt.AllButtons + onPositionChanged: (mouse) => {base.mouseMoved(mouse);} + onPressed: (mouse) => { base.mousePressed(mouse);} + onReleased: (mouse) => { base.mouseReleased(mouse);} + onWheel: (wheel) => {base.wheel(wheel)} + + } + Rectangle { id: greyOutBackground @@ -147,7 +163,7 @@ UM.MainWindow anchors.fill: parent //DeleteSelection on the keypress backspace event - Keys.onPressed: + Keys.onPressed: (event) => { if (event.key == Qt.Key_Backspace) { @@ -171,29 +187,10 @@ UM.MainWindow } height: stageMenu.source != "" ? Math.round(mainWindowHeader.height + stageMenu.height / 2) : mainWindowHeader.height - LinearGradient + Rectangle { anchors.fill: parent - start: Qt.point(0, 0) - end: Qt.point(parent.width, 0) - gradient: Gradient - { - GradientStop - { - position: 0.0 - color: UM.Theme.getColor("main_window_header_background") - } - GradientStop - { - position: 0.5 - color: UM.Theme.getColor("main_window_header_background_gradient") - } - GradientStop - { - position: 1.0 - color: UM.Theme.getColor("main_window_header_background") - } - } + color: UM.Theme.getColor("main_window_header_background") } // This is a placeholder for adding a pattern in the header @@ -237,7 +234,7 @@ UM.MainWindow { // The drop area is here to handle files being dropped onto Cura. anchors.fill: parent - onDropped: + onDropped: (drop) => { if (drop.urls.length > 0) { @@ -246,7 +243,7 @@ UM.MainWindow for (var i = 0; i < drop.urls.length; i++) { var filename = drop.urls[i]; - if (filename.toLowerCase().endsWith(".curapackage")) + if (filename.toString().toLowerCase().endsWith(".curapackage")) { // Try to install plugin & close. CuraApplication.installPackageViaDragAndDrop(filename); @@ -312,10 +309,13 @@ UM.MainWindow property int mouseX: base.mouseX property int mouseY: base.mouseY + property bool tallerThanParent: height > parent.height + + z: 1 // Ensure toolbar and toolpanels are drawn on top anchors { - verticalCenter: parent.verticalCenter + verticalCenter: tallerThanParent ? undefined : parent.verticalCenter left: parent.left } visible: CuraApplication.platformActivity && !PrintInformation.preSliced @@ -574,7 +574,7 @@ UM.MainWindow id: contextMenu } - onPreClosing: + onPreClosing: (close) => { close.accepted = CuraApplication.getIsAllChecksPassed(); if (!close.accepted) @@ -636,24 +636,19 @@ UM.MainWindow //: File open dialog title title: catalog.i18nc("@title:window","Open file(s)") modality: Qt.WindowModal - selectMultiple: true + fileMode: FileDialog.OpenFiles nameFilters: UM.MeshFileHandler.supportedReadFileTypes; - folder: - { - //Because several implementations of the file dialog only update the folder when it is explicitly set. - folder = CuraApplication.getDefaultPath("dialog_load_path"); - return CuraApplication.getDefaultPath("dialog_load_path"); - } + currentFolder: CuraApplication.getDefaultPath("dialog_load_path") onAccepted: { // Because several implementations of the file dialog only update the folder // when it is explicitly set. - var f = folder; - folder = f; + var f = currentFolder; + currentFolder = f; - CuraApplication.setDefaultPath("dialog_load_path", folder); + CuraApplication.setDefaultPath("dialog_load_path", currentFolder); - handleOpenFileUrls(fileUrls); + handleOpenFileUrls(selectedFiles); } // Yeah... I know... it is a mess to put all those things here. @@ -745,7 +740,7 @@ UM.MainWindow { id: packageInstallDialog title: catalog.i18nc("@window:title", "Install Package") - standardButtons: StandardButton.Ok + standardButtons: Dialog.Ok } Cura.MessageDialog diff --git a/resources/qml/Dialogs/AboutDialog.qml b/resources/qml/Dialogs/AboutDialog.qml index e6d15af2d9..6687da572d 100644 --- a/resources/qml/Dialogs/AboutDialog.qml +++ b/resources/qml/Dialogs/AboutDialog.qml @@ -131,37 +131,51 @@ UM.Dialog } Component.onCompleted: { + //Do NOT add dependencies of our dependencies here, nor CI-dependencies! + //Ultimaker's own projects and forks. projectsModel.append({ name: "Cura", description: catalog.i18nc("@label", "Graphical user interface"), license: "LGPLv3", url: "https://github.com/Ultimaker/Cura" }); projectsModel.append({ name: "Uranium", description: catalog.i18nc("@label", "Application framework"), license: "LGPLv3", url: "https://github.com/Ultimaker/Uranium" }); projectsModel.append({ name: "CuraEngine", description: catalog.i18nc("@label", "G-code generator"), license: "AGPLv3", url: "https://github.com/Ultimaker/CuraEngine" }); projectsModel.append({ name: "libArcus", description: catalog.i18nc("@label", "Interprocess communication library"), license: "LGPLv3", url: "https://github.com/Ultimaker/libArcus" }); + projectsModel.append({ name: "pynest2d", description: catalog.i18nc("@label", "Python bindings for libnest2d"), license: "LGPL", url: "https://github.com/Ultimaker/pynest2d" }); + projectsModel.append({ name: "libnest2d", description: catalog.i18nc("@label", "Polygon packing library, developed by Prusa Research"), license: "LGPL", url: "https://github.com/tamasmeszaros/libnest2d" }); + projectsModel.append({ name: "libSavitar", description: catalog.i18nc("@label", "Support library for handling 3MF files"), license: "LGPLv3", url: "https://github.com/ultimaker/libsavitar" }); + projectsModel.append({ name: "libCharon", description: catalog.i18nc("@label", "Support library for file metadata and streaming"), license: "LGPLv3", url: "https://github.com/ultimaker/libcharon" }); + //Direct dependencies of the front-end. projectsModel.append({ name: "Python", description: catalog.i18nc("@label", "Programming language"), license: "Python", url: "http://python.org/" }); - projectsModel.append({ name: "Qt5", description: catalog.i18nc("@label", "GUI framework"), license: "LGPLv3", url: "https://www.qt.io/" }); + projectsModel.append({ name: "Qt6", description: catalog.i18nc("@label", "GUI framework"), license: "LGPLv3", url: "https://www.qt.io/" }); projectsModel.append({ name: "PyQt", description: catalog.i18nc("@label", "GUI framework bindings"), license: "GPL", url: "https://riverbankcomputing.com/software/pyqt" }); projectsModel.append({ name: "SIP", description: catalog.i18nc("@label", "C/C++ Binding library"), license: "GPL", url: "https://riverbankcomputing.com/software/sip" }); projectsModel.append({ name: "Protobuf", description: catalog.i18nc("@label", "Data interchange format"), license: "BSD", url: "https://developers.google.com/protocol-buffers" }); - projectsModel.append({ name: "SciPy", description: catalog.i18nc("@label", "Support library for scientific computing"), license: "BSD-new", url: "https://www.scipy.org/" }); + projectsModel.append({ name: "Noto Sans", description: catalog.i18nc("@label", "Font"), license: "Apache 2.0", url: "https://www.google.com/get/noto/" }); + + //CuraEngine's dependencies. + projectsModel.append({ name: "Clipper", description: catalog.i18nc("@label", "Polygon clipping library"), license: "Boost", url: "http://www.angusj.com/delphi/clipper.php" }); + projectsModel.append({ name: "RapidJSON", description: catalog.i18nc("@label", "JSON parser"), license: "MIT", url: "https://rapidjson.org/" }); + projectsModel.append({ name: "STB", description: catalog.i18nc("@label", "Utility functions, including an image loader"), license: "Public Domain", url: "https://github.com/nothings/stb" }); + projectsModel.append({ name: "Boost", description: catalog.i18nc("@label", "Utility library, including Voronoi generation"), license: "Boost", url: "https://www.boost.org/" }); + + //Python modules. + projectsModel.append({ name: "Certifi", description: catalog.i18nc("@label", "Root Certificates for validating SSL trustworthiness"), license: "MPL", url: "https://github.com/certifi/python-certifi" }); + projectsModel.append({ name: "Cryptography", description: catalog.i18nc("@label", "Root Certificates for validating SSL trustworthiness"), license: "APACHE and BSD", url: "https://cryptography.io/" }); + projectsModel.append({ name: "Future", description: catalog.i18nc("@label", "Compatibility between Python 2 and 3"), license: "MIT", url: "https://python-future.org/" }); + projectsModel.append({ name: "keyring", description: catalog.i18nc("@label", "Support library for system keyring access"), license: "MIT", url: "https://github.com/jaraco/keyring" }); projectsModel.append({ name: "NumPy", description: catalog.i18nc("@label", "Support library for faster math"), license: "BSD", url: "http://www.numpy.org/" }); projectsModel.append({ name: "NumPy-STL", description: catalog.i18nc("@label", "Support library for handling STL files"), license: "BSD", url: "https://github.com/WoLpH/numpy-stl" }); - projectsModel.append({ name: "Trimesh", description: catalog.i18nc("@label", "Support library for handling triangular meshes"), license: "MIT", url: "https://trimsh.org" }); - projectsModel.append({ name: "libSavitar", description: catalog.i18nc("@label", "Support library for handling 3MF files"), license: "LGPLv3", url: "https://github.com/ultimaker/libsavitar" }); - projectsModel.append({ name: "libCharon", description: catalog.i18nc("@label", "Support library for file metadata and streaming"), license: "LGPLv3", url: "https://github.com/ultimaker/libcharon" }); + projectsModel.append({ name: "PyClipper", description: catalog.i18nc("@label", "Python bindings for Clipper"), license: "MIT", url: "https://github.com/fonttools/pyclipper" }); projectsModel.append({ name: "PySerial", description: catalog.i18nc("@label", "Serial communication library"), license: "Python", url: "http://pyserial.sourceforge.net/" }); - projectsModel.append({ name: "python-zeroconf", description: catalog.i18nc("@label", "ZeroConf discovery library"), license: "LGPL", url: "https://github.com/jstasiak/python-zeroconf" }); - projectsModel.append({ name: "Clipper", description: catalog.i18nc("@label", "Polygon clipping library"), license: "Boost", url: "http://www.angusj.com/delphi/clipper.php" }); - projectsModel.append({ name: "Pyclipper", description: catalog.i18nc("@label", "Python bindings for Clipper"), license: "MIT", url: "https://github.com/fonttools/pyclipper" }); - projectsModel.append({ name: "mypy", description: catalog.i18nc("@Label", "Static type checker for Python"), license: "MIT", url: "http://mypy-lang.org/" }); - projectsModel.append({ name: "certifi", description: catalog.i18nc("@Label", "Root Certificates for validating SSL trustworthiness"), license: "MPL", url: "https://github.com/certifi/python-certifi" }); - projectsModel.append({ name: "cryptography", description: catalog.i18nc("@Label", "Root Certificates for validating SSL trustworthiness"), license: "APACHE and BSD", url: "https://cryptography.io/" }); + projectsModel.append({ name: "SciPy", description: catalog.i18nc("@label", "Support library for scientific computing"), license: "BSD-new", url: "https://www.scipy.org/" }); projectsModel.append({ name: "Sentry", description: catalog.i18nc("@Label", "Python Error tracking library"), license: "BSD 2-Clause 'Simplified'", url: "https://sentry.io/for/python/" }); - projectsModel.append({ name: "libnest2d", description: catalog.i18nc("@label", "Polygon packing library, developed by Prusa Research"), license: "LGPL", url: "https://github.com/tamasmeszaros/libnest2d" }); - projectsModel.append({ name: "pynest2d", description: catalog.i18nc("@label", "Python bindings for libnest2d"), license: "LGPL", url: "https://github.com/Ultimaker/pynest2d" }); - projectsModel.append({ name: "keyring", description: catalog.i18nc("@label", "Support library for system keyring access"), license: "MIT", url: "https://github.com/jaraco/keyring" }); - projectsModel.append({ name: "pywin32", description: catalog.i18nc("@label", "Python extensions for Microsoft Windows"), license: "PSF", url: "https://github.com/mhammond/pywin32" }); - projectsModel.append({ name: "Noto Sans", description: catalog.i18nc("@label", "Font"), license: "Apache 2.0", url: "https://www.google.com/get/noto/" }); - projectsModel.append({ name: "Font-Awesome-SVG-PNG", description: catalog.i18nc("@label", "SVG icons"), license: "SIL OFL 1.1", url: "https://github.com/encharm/Font-Awesome-SVG-PNG" }); + projectsModel.append({ name: "Trimesh", description: catalog.i18nc("@label", "Support library for handling triangular meshes"), license: "MIT", url: "https://trimsh.org" }); + projectsModel.append({ name: "python-zeroconf", description: catalog.i18nc("@label", "ZeroConf discovery library"), license: "LGPL", url: "https://github.com/jstasiak/python-zeroconf" }); + + //Building/packaging. + projectsModel.append({ name: "CMake", description: catalog.i18nc("@label", "Universal build system configuration"), license: "BSD 3-Clause", url: "https://cmake.org/" }); + projectsModel.append({ name: "Conan", description: catalog.i18nc("@label", "Dependency and package manager"), license: "MIT", url: "https://conan.io/" }); + projectsModel.append({ name: "Pyinstaller", description: catalog.i18nc("@label", "Packaging Python-applications"), license: "GPLv2", url: "https://pyinstaller.org/" }); projectsModel.append({ name: "AppImageKit", description: catalog.i18nc("@label", "Linux cross-distribution application deployment"), license: "MIT", url: "https://github.com/AppImage/AppImageKit" }); + projectsModel.append({ name: "NSIS", description: catalog.i18nc("@label", "Generating Windows installers"), license: "Zlib", url: "https://nsis.sourceforge.io/" }); } } diff --git a/resources/qml/Dialogs/AskOpenAsProjectOrModelsDialog.qml b/resources/qml/Dialogs/AskOpenAsProjectOrModelsDialog.qml index 23e01b5e46..65d62a5fab 100644 --- a/resources/qml/Dialogs/AskOpenAsProjectOrModelsDialog.qml +++ b/resources/qml/Dialogs/AskOpenAsProjectOrModelsDialog.qml @@ -81,7 +81,6 @@ UM.Dialog id: questionText width: parent.width text: catalog.i18nc("@text:window", "This is a Cura project file. Would you like to open it as a project or import the models from it?") - font: UM.Theme.getFont("default") wrapMode: Text.WordWrap } diff --git a/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml b/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml index bcace5a8b1..0579cb3c30 100644 --- a/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml +++ b/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml @@ -1,11 +1,10 @@ //Copyright (c) 2022 Ultimaker B.V. //Cura is released under the terms of the LGPLv3 or higher. -import Qt.labs.qmlmodels 1.0 import QtQuick 2.1 import QtQuick.Controls 2.15 -import UM 1.5 as UM +import UM 1.6 as UM import Cura 1.6 as Cura UM.Dialog @@ -77,11 +76,9 @@ UM.Dialog Cura.MachineManager.activeQualityDisplayNameMap["main"], catalog.i18nc("@title:column", "Current changes") ] - model: TableModel + model: UM.TableModel { - TableModelColumn { display: "label" } - TableModelColumn { display: "original_value" } - TableModelColumn { display: "user_value" } + headers: ["label", "original_value", "user_value"] rows: userChangesModel.items } sectionRole: "category" diff --git a/resources/qml/Dialogs/OpenFilesIncludingProjectsDialog.qml b/resources/qml/Dialogs/OpenFilesIncludingProjectsDialog.qml index 18891cebee..c33cce1505 100644 --- a/resources/qml/Dialogs/OpenFilesIncludingProjectsDialog.qml +++ b/resources/qml/Dialogs/OpenFilesIncludingProjectsDialog.qml @@ -40,7 +40,7 @@ UM.Dialog } } - onAccepted: loadModelFiles(base.fileUrls) + onAccepted: loadModelFiles(base.selectedFiles) UM.Label { diff --git a/resources/qml/Dialogs/WorkspaceSummaryDialog.qml b/resources/qml/Dialogs/WorkspaceSummaryDialog.qml index 411dc44f83..ee189ab73c 100644 --- a/resources/qml/Dialogs/WorkspaceSummaryDialog.qml +++ b/resources/qml/Dialogs/WorkspaceSummaryDialog.qml @@ -20,11 +20,18 @@ UM.Dialog property bool dontShowAgain: true - onClosing: UM.Preferences.setValue("cura/dialog_on_project_save", !dontShowAgainCheckbox.checked) + function storeDontShowAgain() + { + UM.Preferences.setValue("cura/dialog_on_project_save", !dontShowAgainCheckbox.checked) + UM.Preferences.setValue("asked_dialog_on_project_save", true) + } + onClosing: storeDontShowAgain() + onRejected: storeDontShowAgain() + onAccepted: storeDontShowAgain() onVisibleChanged: { - if(visible) + if(visible && UM.Preferences.getValue("cura/asked_dialog_on_project_save")) { dontShowAgain = !UM.Preferences.getValue("cura/dialog_on_project_save") } diff --git a/resources/qml/EmptyViewMenuComponent.qml b/resources/qml/EmptyViewMenuComponent.qml index 10a50ea023..61d821ccb6 100644 --- a/resources/qml/EmptyViewMenuComponent.qml +++ b/resources/qml/EmptyViewMenuComponent.qml @@ -3,7 +3,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 -import QtGraphicalEffects 1.0 // For the dropshadow + import UM 1.2 as UM @@ -12,6 +12,8 @@ Rectangle { color: UM.Theme.getColor("disabled") + /* + TODO: Reimplement later DropShadow { id: shadow @@ -24,5 +26,5 @@ Rectangle color: UM.Theme.getColor("action_button_shadow") // Should always be drawn behind the background. z: parent.z - 1 - } + }*/ } diff --git a/resources/qml/ExpandableComponent.qml b/resources/qml/ExpandableComponent.qml index e5eab3bd93..9cc84e18dc 100644 --- a/resources/qml/ExpandableComponent.qml +++ b/resources/qml/ExpandableComponent.qml @@ -155,7 +155,7 @@ Item } } - UM.RecolorImage + UM.ColorImage { id: collapseButton anchors @@ -249,13 +249,13 @@ Item } property var clickPos: Qt.point(0, 0) property bool dragging: false - onPressed: + onPressed: (mouse) => { clickPos = Qt.point(mouse.x, mouse.y); dragging = true } - onPositionChanged: + onPositionChanged: (mouse) => { if(dragging) { @@ -266,10 +266,8 @@ Item } } } - onReleased: - { - dragging = false - } + onReleased: dragging = false + onDoubleClicked: { @@ -305,14 +303,6 @@ Item padding: UM.Theme.getSize("default_margin").width contentItem: Item {} - - onContentItemChanged: - { - // Since we want the size of the content to be set by the size of the content, - // we need to do it like this. - content.width = contentItem.width + 2 * content.padding - content.height = contentItem.height + 2 * content.padding - } } } @@ -322,10 +312,8 @@ Item { // Since it could be that the content is dynamically populated, we should also take these changes into account. target: content.contentItem - function onWidthChanged() { content.width = content.contentItem.width + 2 * content.padding } function onHeightChanged() { - content.height = content.contentItem.height + 2 * content.padding contentContainer.height = contentHeader.height + content.height } } diff --git a/resources/qml/ExpandableComponentHeader.qml b/resources/qml/ExpandableComponentHeader.qml index 7176f0978b..de60faba2f 100644 --- a/resources/qml/ExpandableComponentHeader.qml +++ b/resources/qml/ExpandableComponentHeader.qml @@ -51,10 +51,9 @@ Cura.RoundedRectangle verticalCenter: parent.verticalCenter } - contentItem: UM.RecolorImage + contentItem: UM.ColorImage { anchors.fill: parent - sourceSize.width: width color: closeButton.hovered ? UM.Theme.getColor("small_button_text_hover") : UM.Theme.getColor("small_button_text") source: UM.Theme.getIcon("Cancel") } diff --git a/resources/qml/ExpandablePopup.qml b/resources/qml/ExpandablePopup.qml index 219608a762..967ef09767 100644 --- a/resources/qml/ExpandablePopup.qml +++ b/resources/qml/ExpandablePopup.qml @@ -27,6 +27,12 @@ Item // The contentItem holds the QML item that is shown when the "open" button is pressed property alias contentItem: content.contentItem + // If the contentItem is a Layout (eg Column) you must use these to set the popup size otherwise you end up with a + // binding loop between the popup and the contentItem + // ImplicitWidth/ImplicitHeight can be used instead in the contentItem if it is not a Layout. + property alias contentWidth: content.width + property alias contentHeight: content.height + property color contentBackgroundColor: UM.Theme.getColor("action_button") property color headerBackgroundColor: UM.Theme.getColor("action_button") @@ -168,7 +174,7 @@ Item anchors.bottom: parent.bottom } - UM.RecolorImage + UM.ColorImage { id: collapseButton anchors @@ -211,23 +217,5 @@ Item } contentItem: Item {} - - onContentItemChanged: - { - // Since we want the size of the content to be set by the size of the content, - // we need to do it like this. - content.width = contentItem.width + 2 * content.padding - content.height = contentItem.height + 2 * content.padding - } - } - - // DO NOT MOVE UP IN THE CODE: This connection has to be here, after the definition of the content item. - // Apparently the order in which these are handled matters and so the height is correctly updated if this is here. - Connections - { - // Since it could be that the content is dynamically populated, we should also take these changes into account. - target: content.contentItem - function onWidthChanged() { content.width = content.contentItem.width + 2 * content.padding } - function onHeightChanged() { content.height = content.contentItem.height + 2 * content.padding } } } diff --git a/resources/qml/ExtruderIcon.qml b/resources/qml/ExtruderIcon.qml index b9141a449a..fb3269ca78 100644 --- a/resources/qml/ExtruderIcon.qml +++ b/resources/qml/ExtruderIcon.qml @@ -15,7 +15,7 @@ Item property color materialColor property alias textColor: extruderNumberText.color property bool extruderEnabled: true - property alias iconSize: mainIcon.sourceSize + property var iconSize property string iconVariant: "medium" Item @@ -24,19 +24,21 @@ Item anchors.fill: parent layer.enabled: true // Prevent weird opacity effects. - UM.RecolorImage + UM.ColorImage { anchors.fill: parent - sourceSize: mainIcon.sourceSize + width: mainIcon.width + height: mainIcon.height source: UM.Theme.getIcon("ExtruderColor", iconVariant) color: materialColor } - UM.RecolorImage + UM.ColorImage { id: mainIcon anchors.fill: parent - sourceSize: UM.Theme.getSize("extruder_icon") + width: UM.Theme.getSize("extruder_icon").width + height: UM.Theme.getSize("extruder_icon").height source: UM.Theme.getIcon("Extruder", iconVariant) color: extruderNumberText.color diff --git a/resources/qml/IconWithText.qml b/resources/qml/IconWithText.qml index d7b4adfa8c..cc0834d7ea 100644 --- a/resources/qml/IconWithText.qml +++ b/resources/qml/IconWithText.qml @@ -35,7 +35,7 @@ Item implicitWidth: icon.width + 100 implicitHeight: icon.height - UM.RecolorImage + UM.ColorImage { id: icon width: UM.Theme.getSize("section_icon").width diff --git a/resources/qml/JobSpecs.qml b/resources/qml/JobSpecs.qml index 1a5f40466a..d2ca855e8b 100644 --- a/resources/qml/JobSpecs.qml +++ b/resources/qml/JobSpecs.qml @@ -1,7 +1,7 @@ // Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. -import QtQuick 2.2 +import QtQuick 2.15 import QtQuick.Controls 2.1 import QtQuick.Layouts 1.1 @@ -97,8 +97,8 @@ Item cursorPosition = 0 } - validator: RegExpValidator { - regExp: /^[^\\\/\*\?\|\[\]]*$/ + validator: RegularExpressionValidator { + regularExpression: /^[^\\\/\*\?\|\[\]]*$/ } color: UM.Theme.getColor("text_scene") background: Item {} diff --git a/resources/qml/MachineSettings/ComboBoxWithOptions.qml b/resources/qml/MachineSettings/ComboBoxWithOptions.qml index 0ad4f8bb0c..4ff7cf7092 100644 --- a/resources/qml/MachineSettings/ComboBoxWithOptions.qml +++ b/resources/qml/MachineSettings/ComboBoxWithOptions.qml @@ -5,7 +5,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 import QtQuick.Layouts 1.3 -import UM 1.3 as UM +import UM 1.5 as UM import Cura 1.1 as Cura import "../Widgets" @@ -52,15 +52,13 @@ UM.TooltipArea watchedProperties: [ "value", "options", "description" ] } - Label + UM.Label { id: fieldLabel anchors.left: parent.left anchors.verticalCenter: comboBox.verticalCenter visible: text != "" font: UM.Theme.getFont("medium") - color: UM.Theme.getColor("text") - renderType: Text.NativeRendering } ListModel diff --git a/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml b/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml index 51c9730052..2484adb912 100644 --- a/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml +++ b/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml @@ -1,7 +1,7 @@ // Copyright (c) 2020 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. -import QtQuick 2.10 +import QtQuick 2.15 import QtQuick.Controls 2.3 import UM 1.5 as UM @@ -38,6 +38,7 @@ UM.TooltipArea property alias textField: textFieldWithUnit property alias valueText: textFieldWithUnit.text + property alias enabled: textFieldWithUnit.enabled property alias editingFinishedFunction: textFieldWithUnit.editingFinishedFunction property string tooltipText: propertyProvider.properties.description ? propertyProvider.properties.description : "" @@ -61,15 +62,12 @@ UM.TooltipArea watchedProperties: [ "value", "description" ] } - Label + UM.Label { id: fieldLabel anchors.left: parent.left anchors.verticalCenter: textFieldWithUnit.verticalCenter visible: text != "" - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") - renderType: Text.NativeRendering } TextField @@ -90,11 +88,12 @@ UM.TooltipArea { anchors.fill: parent + borderColor: textFieldWithUnit.activeFocus ? UM.Theme.getColor("text_field_border_active") : "transparent" liningColor: { if (!textFieldWithUnit.enabled) { - return UM.Theme.getColor("setting_control_disabled_border") + return UM.Theme.getColor("setting_control_disabled_border"); } switch (propertyProvider.properties.validationState) { @@ -107,11 +106,15 @@ UM.TooltipArea return UM.Theme.getColor("setting_validation_warning") } // Validation is OK. - if (textFieldWithUnit.hovered || textFieldWithUnit.activeFocus) + if(textFieldWithUnit.activeFocus) + { + return UM.Theme.getColor("text_field_border_active"); + } + if(textFieldWithUnit.hovered) { - return UM.Theme.getColor("border_main") + return UM.Theme.getColor("text_field_border_hovered"); } - return UM.Theme.getColor("border_field_light") + return UM.Theme.getColor("border_field_light"); } color: @@ -172,9 +175,9 @@ UM.TooltipArea return "^%0\\d{0,%1}[.,]?\\d{0,%2}$".arg(minus).arg(digits).arg(numericTextFieldWithUnit.decimals) } } - validator: RegExpValidator + validator: RegularExpressionValidator { - regExp: new RegExp(textFieldWithUnit.validatorString) + regularExpression: new RegExp(textFieldWithUnit.validatorString) } //Enforce actual minimum and maximum values. diff --git a/resources/qml/MachineSettings/SimpleCheckBox.qml b/resources/qml/MachineSettings/SimpleCheckBox.qml index cda666571f..fa40cecef2 100644 --- a/resources/qml/MachineSettings/SimpleCheckBox.qml +++ b/resources/qml/MachineSettings/SimpleCheckBox.qml @@ -46,15 +46,13 @@ UM.TooltipArea watchedProperties: [ "value", "description" ] } - Label + UM.Label { id: fieldLabel anchors.left: parent.left anchors.verticalCenter: checkBox.verticalCenter visible: text != "" font: UM.Theme.getFont("medium") - color: UM.Theme.getColor("text") - renderType: Text.NativeRendering } UM.CheckBox diff --git a/resources/qml/Menus/ConfigurationMenu/AutoConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/AutoConfiguration.qml index 18409dd43a..0bf29c13b7 100644 --- a/resources/qml/Menus/ConfigurationMenu/AutoConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/AutoConfiguration.qml @@ -4,7 +4,7 @@ import QtQuick 2.7 import QtQuick.Controls 2.0 -import UM 1.3 as UM +import UM 1.5 as UM import Cura 1.0 as Cura Item @@ -12,14 +12,13 @@ Item width: parent.width height: childrenRect.height - Label + UM.Label { id: header text: catalog.i18nc("@header", "Configurations") font: UM.Theme.getFont("medium") color: UM.Theme.getColor("small_button_text") height: contentHeight - renderType: Text.NativeRendering anchors { diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml index 49d6710606..e8917517dd 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml @@ -88,7 +88,7 @@ Button visible: !configurationItem.isValidMaterial - UM.RecolorImage + UM.ColorImage { id: icon anchors.verticalCenter: unknownMaterialMessage.verticalCenter diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml index 10e2435dfc..0840cfea87 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml @@ -39,7 +39,7 @@ Item anchors.verticalCenter: parent.verticalCenter status: UM.StatusIcon.Status.WARNING } - Label + UM.Label { id: label anchors.left: icon.right @@ -51,9 +51,6 @@ Item text: Cura.MachineManager.printerConnected ? catalog.i18nc("@label", "Loading available configurations from the printer...") : catalog.i18nc("@label", "The configurations are not available because the printer is disconnected.") - color: UM.Theme.getColor("text") - font: UM.Theme.getFont("default") - renderType: Text.NativeRendering wrapMode: Text.WordWrap } } diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml index 58d96f8028..76d33c9c77 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml @@ -36,6 +36,8 @@ Cura.ExpandablePopup headerItem: Item { + id: headerBase + // Horizontal list that shows the extruders and their materials RowLayout { @@ -51,13 +53,16 @@ Cura.ExpandablePopup { id: extruderItem - Layout.preferredWidth: Math.round(parent.width / extrudersModel.count) - Layout.maximumWidth: Math.round(parent.width / extrudersModel.count) + Layout.preferredWidth: Math.floor(headerBase.width / extrudersModel.count) + Layout.maximumWidth: Math.floor(headerBase.width / extrudersModel.count) + Layout.preferredHeight: headerBase.height + Layout.maximumHeight: headerBase.height Layout.fillHeight: true + Layout.alignment: Qt.AlignCenter property var extruderStack: activeMachine ? activeMachine.extruderList[model.index]: null property bool valueWarning: !Cura.ExtruderManager.getExtruderHasQualityForMaterial(extruderStack) - property bool valueError: activeMachine ? Cura.ContainerManager.getContainerMetaDataEntry(extruderStack.material.id, "compatible", "") != "True" : false + property bool valueError: activeMachine ? Cura.ContainerManager.getContainerMetaDataEntry(extruderStack.material.id, "compatible") != "True" : false // Extruder icon. Shows extruder index and has the same color as the active material. Cura.ExtruderIcon @@ -109,7 +114,7 @@ Cura.ExpandablePopup } // Warning icon that indicates if no qualities are available for the variant/material combination for this extruder - UM.RecolorImage + UM.ColorImage { id: badge anchors @@ -257,11 +262,10 @@ Cura.ExpandablePopup } } + contentWidth: UM.Theme.getSize("configuration_selector").width contentItem: Column { id: popupItem - width: UM.Theme.getSize("configuration_selector").width - height: implicitHeight // Required because ExpandableComponent will try to use this to determine the size of the background of the pop-up. padding: UM.Theme.getSize("default_margin").height spacing: UM.Theme.getSize("default_margin").height diff --git a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml index 4b2b84d39e..c24c031e83 100644 --- a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml @@ -97,13 +97,16 @@ Item checked: model.index == 0 contentItem: Item { + anchors.horizontalCenter: parent.horizontalCenter + anchors.verticalCenter: parent.verticalCenter + width: Math.floor(tabBar.height / extrudersModel.count) + height: tabBar.height Cura.ExtruderIcon { anchors.horizontalCenter: parent.horizontalCenter + anchors.verticalCenter: parent.verticalCenter materialColor: model.color extruderEnabled: model.enabled - width: parent.height - height: parent.height } } onClicked: @@ -202,7 +205,7 @@ Item return paddedWidth - textWidth - UM.Theme.getSize("print_setup_big_item").height * 0.5 - UM.Theme.getSize("default_margin").width } } - property string instructionLink: Cura.MachineManager.activeStack != null ? Cura.ContainerManager.getContainerMetaDataEntry(Cura.MachineManager.activeStack.material.id, "instruction_link", ""): "" + property string instructionLink: Cura.MachineManager.activeStack != null ? Cura.ContainerManager.getContainerMetaDataEntry(Cura.MachineManager.activeStack.material.id, "instruction_link"): "" Row { @@ -269,7 +272,7 @@ Item { id: materialSelection - property bool valueError: Cura.MachineManager.activeStack !== null ? Cura.ContainerManager.getContainerMetaDataEntry(Cura.MachineManager.activeStack.material.id, "compatible", "") !== "True" : true + property bool valueError: Cura.MachineManager.activeStack !== null ? Cura.ContainerManager.getContainerMetaDataEntry(Cura.MachineManager.activeStack.material.id, "compatible") !== "True" : true property bool valueWarning: !Cura.MachineManager.isActiveQualitySupported text: Cura.MachineManager.activeStack !== null ? Cura.MachineManager.activeStack.material.name : "" @@ -304,7 +307,7 @@ Item height: UM.Theme.getSize("small_button").height width: UM.Theme.getSize("small_button").width anchors.centerIn: parent - background: UM.RecolorImage + background: UM.ColorImage { source: UM.Theme.getIcon("Guide") color: instructionButton.hovered ? UM.Theme.getColor("primary") : UM.Theme.getColor("icon") @@ -369,15 +372,13 @@ Item width: selectors.controlWidth height: childrenRect.height - UM.RecolorImage + UM.ColorImage { id: warningImage anchors.left: parent.left source: UM.Theme.getIcon("Warning") width: UM.Theme.getSize("section_icon").width height: UM.Theme.getSize("section_icon").height - sourceSize.width: width - sourceSize.height: height color: UM.Theme.getColor("material_compatibility_warning") visible: !Cura.MachineManager.isCurrentSetupSupported || warnings.buildplateCompatibilityError || warnings.buildplateCompatibilityWarning } diff --git a/resources/qml/Menus/ContextMenu.qml b/resources/qml/Menus/ContextMenu.qml index 1bba79e2c1..65f3409c8a 100644 --- a/resources/qml/Menus/ContextMenu.qml +++ b/resources/qml/Menus/ContextMenu.qml @@ -45,8 +45,8 @@ Cura.Menu shortcut: "Ctrl+" + (model.index + 1) } // Add it to the fifth position (and above) as we want it to be added after the extruder header. - onObjectAdded: base.insertItem(index + 5, object) - onObjectRemoved: base.removeItem(object) + onObjectAdded: function(index, object) { base.insertItem(index + 5, object) } + onObjectRemoved: function(index, object) { base.removeItem(object) } } // Global actions @@ -134,6 +134,7 @@ Cura.Menu from: 1 to: 99 width: 2 * UM.Theme.getSize("button").width + value: 1 } } } diff --git a/resources/qml/Menus/ExtensionMenu.qml b/resources/qml/Menus/ExtensionMenu.qml index 3c2d1a79c7..919e094e5e 100644 --- a/resources/qml/Menus/ExtensionMenu.qml +++ b/resources/qml/Menus/ExtensionMenu.qml @@ -53,12 +53,12 @@ Cura.Menu sourceComponent: modelText.trim() == "" ? extensionsMenuSeparator : extensionsMenuItem } - onObjectAdded: sub_menu.insertItem(index, object.item) - onObjectRemoved: sub_menu.removeItem(object.item) + onObjectAdded: function(index, object) { sub_menu.insertItem(index, object.item)} + onObjectRemoved: function(index, object) { sub_menu.removeItem(object.item)} } } - onObjectAdded: extensionMenu.insertMenu(index, object) - onObjectRemoved: extensionMenu.removeMenu(object) + onObjectAdded: function(index, object) { extensionMenu.insertMenu(index, object) } + onObjectRemoved: function(index, object) { extensionMenu.removeMenu(object)} } }
\ No newline at end of file diff --git a/resources/qml/Menus/FileMenu.qml b/resources/qml/Menus/FileMenu.qml index 338ada60fc..0884053ef3 100644 --- a/resources/qml/Menus/FileMenu.qml +++ b/resources/qml/Menus/FileMenu.qml @@ -33,6 +33,7 @@ Cura.Menu id: openFilesMenu shouldBeVisible: base.fileProviderModel.count > 1 + enabled: shouldBeVisible } RecentFilesMenu { } diff --git a/resources/qml/Menus/MaterialBrandMenu.qml b/resources/qml/Menus/MaterialBrandMenu.qml new file mode 100644 index 0000000000..e256e75904 --- /dev/null +++ b/resources/qml/Menus/MaterialBrandMenu.qml @@ -0,0 +1,345 @@ +// Copyright (c) 2022 Ultimaker B.V. +// Cura is released under the terms of the LGPLv3 or higher. + +import QtQuick 2.7 +import QtQuick.Controls 2.4 +import QtQuick.Layouts 2.7 + +import UM 1.5 as UM +import Cura 1.7 as Cura + +/* This element is a workaround for MacOS, where it can crash in Qt6 when nested menus are closed. +Instead we'll use a pop-up which doesn't seem to have that problem. */ + +Cura.MenuItem +{ + id: materialBrandMenu + overrideShowArrow: true + + property var materialTypesModel + text: materialTypesModel.name + + contentItem: MouseArea + { + hoverEnabled: true + + RowLayout + { + spacing: 0 + opacity: materialBrandMenu.enabled ? 1 : 0.5 + + Item + { + // Spacer + width: UM.Theme.getSize("default_margin").width + } + + UM.Label + { + text: replaceText(materialBrandMenu.text) + Layout.fillWidth: true + Layout.fillHeight:true + elide: Label.ElideRight + wrapMode: Text.NoWrap + } + + Item + { + Layout.fillWidth: true + } + + Item + { + // Right side margin + width: UM.Theme.getSize("default_margin").width + } + } + + onEntered: showTimer.restartTimer() + onExited: hideTimer.restartTimer() + } + + Timer + { + id: showTimer + interval: 250 + function restartTimer() + { + restart(); + running = Qt.binding(function() { return materialBrandMenu.enabled && materialBrandMenu.contentItem.containsMouse; }); + hideTimer.running = false; + } + onTriggered: menuPopup.open() + } + Timer + { + id: hideTimer + interval: 250 + function restartTimer() //Restart but re-evaluate the running property then. + { + restart(); + running = Qt.binding(function() { return materialBrandMenu.enabled && !materialBrandMenu.contentItem.containsMouse && !menuPopup.itemHovered > 0; }); + showTimer.running = false; + } + onTriggered: menuPopup.close() + } + + Popup + { + id: menuPopup + width: materialTypesList.width + padding * 2 + height: materialTypesList.height + padding * 2 + + property var flipped: false + + x: parent.width - UM.Theme.getSize("default_lining").width + y: { + // Checks if popup is more than halfway down the screen AND further than 400 down (this avoids popup going off the top of screen) + // If it is then the popup will push up instead of down + // This fixes the popups appearing bellow the bottom of the screen. + + if (materialBrandMenu.parent.height / 2 < parent.y && parent.y > 400) { + flipped = true + return -UM.Theme.getSize("default_lining").width - height + UM.Theme.getSize("menu").height + } + flipped = false + return -UM.Theme.getSize("default_lining").width + } + + padding: background.border.width + // Nasty hack to ensure that we can keep track if the popup contains the mouse. + // Since we also want a hover for the sub items (and these events are sent async) + // We have to keep a count of itemHovered (instead of just a bool) + property int itemHovered: 0 + MouseArea + { + id: submenuArea + anchors.fill: parent + + hoverEnabled: true + onEntered: hideTimer.restartTimer() + } + + background: Rectangle + { + color: UM.Theme.getColor("main_background") + border.color: UM.Theme.getColor("lining") + border.width: UM.Theme.getSize("default_lining").width + } + + Column + { + id: materialTypesList + spacing: 0 + + property var brandMaterials: materialTypesModel.material_types + + Repeater + { + model: parent.brandMaterials + + //Use a MouseArea and Rectangle, not a button, because the button grabs mouse events which makes the parent pop-up think it's no longer being hovered. + //With a custom MouseArea, we can prevent the events from being accepted. + delegate: Rectangle + { + id: brandMaterialBase + height: UM.Theme.getSize("menu").height + width: UM.Theme.getSize("menu").width + + color: materialTypeButton.containsMouse ? UM.Theme.getColor("background_2") : UM.Theme.getColor("background_1") + + property var isFlipped: menuPopup.flipped + + RowLayout + { + spacing: 0 + opacity: materialBrandMenu.enabled ? 1 : 0.5 + height: parent.height + width: parent.width + + Item + { + // Spacer + width: UM.Theme.getSize("default_margin").width + } + + UM.Label + { + text: model.name + Layout.fillWidth: true + Layout.fillHeight: true + elide: Label.ElideRight + wrapMode: Text.NoWrap + } + + Item + { + Layout.fillWidth: true + } + + UM.ColorImage + { + height: UM.Theme.getSize("default_arrow").height + width: UM.Theme.getSize("default_arrow").width + color: UM.Theme.getColor("setting_control_text") + source: UM.Theme.getIcon("ChevronSingleRight") + } + + Item + { + // Right side margin + width: UM.Theme.getSize("default_margin").width + } + } + + MouseArea + { + id: materialTypeButton + anchors.fill: parent + + hoverEnabled: true + acceptedButtons: Qt.NoButton + + onEntered: + { + menuPopup.itemHovered += 1; + showSubTimer.restartTimer(); + } + onExited: + { + menuPopup.itemHovered -= 1; + hideSubTimer.restartTimer(); + } + } + Timer + { + id: showSubTimer + interval: 250 + function restartTimer() + { + restart(); + running = Qt.binding(function() { return materialTypeButton.containsMouse; }); + hideSubTimer.running = false; + } + onTriggered: colorPopup.open() + } + Timer + { + id: hideSubTimer + interval: 250 + function restartTimer() //Restart but re-evaluate the running property then. + { + restart(); + running = Qt.binding(function() { return !materialTypeButton.containsMouse && !colorPopup.itemHovered > 0; }); + showSubTimer.running = false; + } + onTriggered: colorPopup.close() + } + + Popup + { + id: colorPopup + width: materialColorsList.width + padding * 2 + height: materialColorsList.height + padding * 2 + x: parent.width + y: { + // If flipped the popup should push up rather than down from the parent + if (brandMaterialBase.isFlipped) { + return -height + UM.Theme.getSize("menu").height + UM.Theme.getSize("default_lining").width + } + return -UM.Theme.getSize("default_lining").width + } + + property int itemHovered: 0 + padding: background.border.width + + background: Rectangle + { + color: UM.Theme.getColor("main_background") + border.color: UM.Theme.getColor("lining") + border.width: UM.Theme.getSize("default_lining").width + } + + Column + { + id: materialColorsList + property var brandColors: model.colors + spacing: 0 + + Repeater + { + model: parent.brandColors + + delegate: Rectangle + { + height: UM.Theme.getSize("menu").height + width: UM.Theme.getSize("menu").width + + color: materialColorButton.containsMouse ? UM.Theme.getColor("background_2") : UM.Theme.getColor("background_1") + + Item + { + opacity: materialBrandMenu.enabled ? 1 : 0.5 + anchors.fill: parent + + //Checkmark, if the material is selected. + UM.ColorImage + { + id: checkmark + visible: model.id === materialMenu.activeMaterialId + height: UM.Theme.getSize("default_arrow").height + width: height + anchors.left: parent.left + anchors.leftMargin: UM.Theme.getSize("default_margin").width + anchors.verticalCenter: parent.verticalCenter + source: UM.Theme.getIcon("Check", "low") + color: UM.Theme.getColor("setting_control_text") + } + + UM.Label + { + text: model.name + anchors.left: parent.left + anchors.leftMargin: UM.Theme.getSize("default_margin").width + UM.Theme.getSize("default_arrow").height + anchors.verticalCenter: parent.verticalCenter + anchors.right: parent.right + anchors.rightMargin: UM.Theme.getSize("default_margin").width + + elide: Label.ElideRight + wrapMode: Text.NoWrap + } + } + + MouseArea + { + id: materialColorButton + anchors.fill: parent + + hoverEnabled: true + onClicked: + { + Cura.MachineManager.setMaterial(extruderIndex, model.container_node); + menuPopup.close(); + colorPopup.close(); + materialMenu.close(); + } + onEntered: + { + menuPopup.itemHovered += 1; + colorPopup.itemHovered += 1; + } + onExited: + { + menuPopup.itemHovered -= 1; + colorPopup.itemHovered -= 1; + } + } + } + } + } + } + } + } + } + } +} diff --git a/resources/qml/Menus/MaterialMenu.qml b/resources/qml/Menus/MaterialMenu.qml index e6d7fbc3e9..cee28cee6a 100644 --- a/resources/qml/Menus/MaterialMenu.qml +++ b/resources/qml/Menus/MaterialMenu.qml @@ -66,8 +66,8 @@ Cura.Menu checked: model.root_material_id === materialMenu.currentRootMaterialId onTriggered: Cura.MachineManager.setMaterial(extruderIndex, model.container_node) } - onObjectAdded: materialMenu.insertItem(index + 1, object) - onObjectRemoved: materialMenu.removeItem(index) + onObjectAdded: function(index, object) { materialMenu.insertItem(index + 1, object) } + onObjectRemoved: function(index, object) { materialMenu.removeItem(index) } } Cura.MenuSeparator { visible: favoriteMaterialsModel.items.length > 0} @@ -88,8 +88,8 @@ Cura.Menu checked: model.root_material_id === materialMenu.currentRootMaterialId onTriggered: Cura.MachineManager.setMaterial(extruderIndex, model.container_node) } - onObjectAdded: genericMenu.insertItem(index, object) - onObjectRemoved: genericMenu.removeItem(index) + onObjectAdded: function(index, object) { genericMenu.insertItem(index, object)} + onObjectRemoved: function(index, object) {genericMenu.removeItem(index) } } } @@ -98,45 +98,12 @@ Cura.Menu Instantiator { model: brandModel - Cura.Menu + delegate: Cura.MaterialBrandMenu { - id: brandMenu - title: brandName - property string brandName: model.name - property var brandMaterials: model.material_types - - Instantiator - { - model: brandMaterials - delegate: Cura.Menu - { - id: brandMaterialsMenu - title: materialName - property string materialName: model.name - property var brandMaterialColors: model.colors - - Instantiator - { - model: brandMaterialColors - delegate: Cura.MenuItem - { - text: model.name - checkable: true - enabled: isActiveExtruderEnabled - checked: model.id === materialMenu.activeMaterialId - - onTriggered: Cura.MachineManager.setMaterial(extruderIndex, model.container_node) - } - onObjectAdded: brandMaterialsMenu.insertItem(index, object) - onObjectRemoved: brandMaterialsMenu.removeItem(object) - } - } - onObjectAdded: brandMenu.insertMenu(index, object) - onObjectRemoved: brandMenu.removeMenu(object) - } + materialTypesModel: model } - onObjectAdded: materialMenu.insertMenu(index + 4, object) - onObjectRemoved: materialMenu.removeMenu(object) + onObjectAdded: function(index, object) { materialMenu.insertItem(index + 4, object)} + onObjectRemoved: function(index, object) { materialMenu.removeItem(index) } } Cura.MenuSeparator {} diff --git a/resources/qml/Menus/NozzleMenu.qml b/resources/qml/Menus/NozzleMenu.qml index b320a02a5e..f286410a11 100644 --- a/resources/qml/Menus/NozzleMenu.qml +++ b/resources/qml/Menus/NozzleMenu.qml @@ -49,8 +49,8 @@ Cura.Menu onTriggered: Cura.MachineManager.setVariant(nozzleMenu.extruderIndex, model.container_node) } - onObjectAdded: nozzleMenu.insertItem(index, object) - onObjectRemoved: nozzleMenu.removeItem(object) + onObjectAdded: function(index, object) { nozzleMenu.insertItem(index, object) } + onObjectRemoved: function(index, object) {nozzleMenu.removeItem(object)} } } diff --git a/resources/qml/Menus/OpenFilesMenu.qml b/resources/qml/Menus/OpenFilesMenu.qml index de5ab00c76..ca838b5cb3 100644 --- a/resources/qml/Menus/OpenFilesMenu.qml +++ b/resources/qml/Menus/OpenFilesMenu.qml @@ -34,8 +34,8 @@ Cura.Menu } shortcut: model.shortcut } - onObjectAdded: openFilesMenu.insertItem(index, object) + onObjectAdded: function(index, object) { openFilesMenu.insertItem(index, object)} - onObjectRemoved: openFilesMenu.removeItem(object) + onObjectRemoved: function(index, object) { openFilesMenu.removeItem(object) } } } diff --git a/resources/qml/Menus/PrinterMenu.qml b/resources/qml/Menus/PrinterMenu.qml index 9f0e0575b0..7cea1de52e 100644 --- a/resources/qml/Menus/PrinterMenu.qml +++ b/resources/qml/Menus/PrinterMenu.qml @@ -38,8 +38,8 @@ Cura.Menu checked: Cura.MachineManager.activeMachineNetworkGroupName == connectGroupName onTriggered: Cura.MachineManager.setActiveMachine(model.id) } - onObjectAdded: menu.insertItem(2, object) - onObjectRemoved: menu.removeItem(object) + onObjectAdded: function(index, object) { menu.insertItem(2, object)} + onObjectRemoved: function(index, object) { menu.removeItem(object)} } Cura.MenuSeparator { visible: networKPrinterInstantiator.count > 0 } @@ -66,8 +66,8 @@ Cura.Menu onTriggered: Cura.MachineManager.setActiveMachine(model.id) } // A bit hackish, but we have 2 items at the end, put them before that - onObjectAdded: menu.insertItem(menu.count - 2, object) - onObjectRemoved: menu.removeItem(object) + onObjectAdded: function(index, object) { menu.insertItem(menu.count - 2, object) } + onObjectRemoved: function(index, object) { menu.removeItem(object) } } Cura.MenuSeparator { visible: localPrinterInstantiator.count > 0 } diff --git a/resources/qml/Menus/PrinterTypeMenu.qml b/resources/qml/Menus/PrinterTypeMenu.qml index 17986ac1b8..8691bf7ecc 100644 --- a/resources/qml/Menus/PrinterTypeMenu.qml +++ b/resources/qml/Menus/PrinterTypeMenu.qml @@ -28,7 +28,7 @@ Cura.Menu Cura.MachineManager.switchPrinterType(modelData.machine_type) } } - onObjectAdded: menu.insertItem(index, object) - onObjectRemoved: menu.removeItem(object) + onObjectAdded: function(index, object) { return menu.insertItem(index, object); } + onObjectRemoved: function(index, object) { return menu.removeItem(object); } } } diff --git a/resources/qml/Menus/RecentFilesMenu.qml b/resources/qml/Menus/RecentFilesMenu.qml index 8f4f328927..19ff681219 100644 --- a/resources/qml/Menus/RecentFilesMenu.qml +++ b/resources/qml/Menus/RecentFilesMenu.qml @@ -29,7 +29,7 @@ Cura.Menu } onTriggered: CuraApplication.readLocalFile(modelData) } - onObjectAdded: menu.insertItem(index, object) - onObjectRemoved: menu.removeItem(object) + onObjectAdded: (index, object) => menu.insertItem(index, object) + onObjectRemoved: (object) => menu.removeItem(object) } } diff --git a/resources/qml/Menus/SaveProjectMenu.qml b/resources/qml/Menus/SaveProjectMenu.qml index 16d54382d1..2140d5e0ef 100644 --- a/resources/qml/Menus/SaveProjectMenu.qml +++ b/resources/qml/Menus/SaveProjectMenu.qml @@ -43,8 +43,8 @@ Cura.Menu shortcut: model.shortcut enabled: saveProjectMenu.shouldBeVisible } - onObjectAdded: saveProjectMenu.insertItem(index, object) - onObjectRemoved: saveProjectMenu.removeItem(object) + onObjectAdded: function(index, object) { saveProjectMenu.insertItem(index, object)} + onObjectRemoved: function(index, object) { saveProjectMenu.removeItem(object)} } WorkspaceSummaryDialog diff --git a/resources/qml/Menus/SettingVisibilityPresetsMenu.qml b/resources/qml/Menus/SettingVisibilityPresetsMenu.qml index 08d74a74ce..57298030c4 100644 --- a/resources/qml/Menus/SettingVisibilityPresetsMenu.qml +++ b/resources/qml/Menus/SettingVisibilityPresetsMenu.qml @@ -29,14 +29,11 @@ Cura.Menu checkable: true checked: modelData.presetId == settingVisibilityPresetsModel.activePreset ActionGroup.group: group - onTriggered: - { - settingVisibilityPresetsModel.setActivePreset(modelData.presetId); - } + onTriggered: settingVisibilityPresetsModel.setActivePreset(modelData.presetId) } - onObjectAdded: menu.insertItem(index, object) - onObjectRemoved: menu.removeItem(object) + onObjectAdded: function(index, object) { menu.insertItem(index, object) } + onObjectRemoved: function(index, object) { menu.removeItem(object)} } Cura.MenuSeparator {} diff --git a/resources/qml/Menus/SettingsMenu.qml b/resources/qml/Menus/SettingsMenu.qml index 25bee871f5..ea5de6c66f 100644 --- a/resources/qml/Menus/SettingsMenu.qml +++ b/resources/qml/Menus/SettingsMenu.qml @@ -67,8 +67,8 @@ Cura.Menu height: visible ? implicitHeight: 0 } } - onObjectAdded: base.insertMenu(index, object) - onObjectRemoved: base.removeMenu(object) + onObjectAdded: function(index, object) { base.insertMenu(index, object) } + onObjectRemoved: function(index, object) { base.removeMenu(object);} } Cura.MenuSeparator { } diff --git a/resources/qml/ObjectItemButton.qml b/resources/qml/ObjectItemButton.qml index c3066b800d..407a0298f4 100644 --- a/resources/qml/ObjectItemButton.qml +++ b/resources/qml/ObjectItemButton.qml @@ -146,7 +146,7 @@ Button labelText: perObjectSettingsCount.toString() } - UM.RecolorImage + UM.ColorImage { id: meshTypeIcon anchors diff --git a/resources/qml/ObjectSelector.qml b/resources/qml/ObjectSelector.qml index db68ff6c03..fdb4697a7e 100644 --- a/resources/qml/ObjectSelector.qml +++ b/resources/qml/ObjectSelector.qml @@ -1,3 +1,4 @@ + // Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. @@ -40,12 +41,11 @@ Item width: parent.width height: label.height - UM.RecolorImage + UM.ColorImage { id: openCloseIcon width: UM.Theme.getSize("standard_arrow").width height: UM.Theme.getSize("standard_arrow").height - sourceSize.width: width anchors.left: parent.left color: openCloseButton.hovered ? UM.Theme.getColor("small_button_text_hover") : UM.Theme.getColor("small_button_text") source: objectSelector.opened ? UM.Theme.getIcon("ChevronSingleDown") : UM.Theme.getIcon("ChevronSingleUp") diff --git a/resources/qml/Preferences/GeneralPage.qml b/resources/qml/Preferences/GeneralPage.qml index c4200e2351..2934edf508 100644 --- a/resources/qml/Preferences/GeneralPage.qml +++ b/resources/qml/Preferences/GeneralPage.qml @@ -201,7 +201,6 @@ UM.PreferencesPage append({ text: "Русский", code: "ru_RU" }) append({ text: "Türkçe", code: "tr_TR" }) append({ text: "简体中文", code: "zh_CN" }) - append({ text: "正體字", code: "zh_TW" }) var date_object = new Date(); if (date_object.getUTCMonth() == 8 && date_object.getUTCDate() == 19) //Only add Pirate on the 19th of September. @@ -211,6 +210,7 @@ UM.PreferencesPage // incomplete and/or abandoned append({ text: catalog.i18nc("@heading", "-- incomplete --"), code: "" }) + append({ text: "正體字", code: "zh_TW" }) append({ text: "Magyar", code: "hu_HU" }) append({ text: "Suomi", code: "fi_FI" }) append({ text: "Polski", code: "pl_PL" }) @@ -224,7 +224,7 @@ UM.PreferencesPage textRole: "text" model: languageList implicitWidth: UM.Theme.getSize("combobox").width - implicitHeight: currencyField.height + height: currencyField.height function setCurrentIndex() { var code = UM.Preferences.getValue("general/language"); @@ -264,6 +264,7 @@ UM.PreferencesPage selectByMouse: true text: UM.Preferences.getValue("cura/currency") implicitWidth: UM.Theme.getSize("combobox").width + implicitHeight: UM.Theme.getSize("setting_control").height onTextChanged: UM.Preferences.setValue("cura/currency", text) } @@ -293,7 +294,7 @@ UM.PreferencesPage model: themeList textRole: "text" implicitWidth: UM.Theme.getSize("combobox").width - implicitHeight: currencyField.height + height: currencyField.height currentIndex: { diff --git a/resources/qml/Preferences/MachinesPage.qml b/resources/qml/Preferences/MachinesPage.qml index 93a35ff9bb..9b6f5bf609 100644 --- a/resources/qml/Preferences/MachinesPage.qml +++ b/resources/qml/Preferences/MachinesPage.qml @@ -12,6 +12,7 @@ import Cura 1.0 as Cura UM.ManagementPage { id: base + Item { enabled: false; UM.I18nCatalog { id: catalog; name: "cura"} } title: catalog.i18nc("@title:tab", "Printers") detailsPlaneCaption: base.currentItem && base.currentItem.name ? base.currentItem.name : "" @@ -93,8 +94,6 @@ UM.ManagementPage maximumHeight: minimumHeight * 3 } - UM.I18nCatalog { id: catalog; name: "cura"; } - UM.ConfirmRemoveDialog { id: confirmDialog diff --git a/resources/qml/Preferences/Materials/MaterialsBrandSection.qml b/resources/qml/Preferences/Materials/MaterialsBrandSection.qml index 9f7eeccc54..6f404ad738 100644 --- a/resources/qml/Preferences/Materials/MaterialsBrandSection.qml +++ b/resources/qml/Preferences/Materials/MaterialsBrandSection.qml @@ -2,7 +2,7 @@ // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.7 -import QtQuick.Controls 1.4 +import QtQuick.Controls 2.1 import QtQuick.Layouts 1.3 import UM 1.5 as UM diff --git a/resources/qml/Preferences/Materials/MaterialsList.qml b/resources/qml/Preferences/Materials/MaterialsList.qml index bb40187825..913e213dae 100644 --- a/resources/qml/Preferences/Materials/MaterialsList.qml +++ b/resources/qml/Preferences/Materials/MaterialsList.qml @@ -2,8 +2,8 @@ // Uranium is released under the terms of the LGPLv3 or higher. import QtQuick 2.7 -import QtQuick.Controls 1.4 import QtQuick.Layouts 1.3 +import QtQuick.Dialogs import UM 1.2 as UM import Cura 1.0 as Cura diff --git a/resources/qml/Preferences/Materials/MaterialsPage.qml b/resources/qml/Preferences/Materials/MaterialsPage.qml index 2774c2a204..d677658a37 100644 --- a/resources/qml/Preferences/Materials/MaterialsPage.qml +++ b/resources/qml/Preferences/Materials/MaterialsPage.qml @@ -3,7 +3,7 @@ import QtQuick 2.7 import QtQuick.Controls 2.15 -import QtQuick.Dialogs 1.2 +import QtQuick.Dialogs import UM 1.5 as UM import Cura 1.5 as Cura @@ -11,7 +11,7 @@ import Cura 1.5 as Cura UM.ManagementPage { id: base - + Item { enabled: false; UM.I18nCatalog { id: catalog; name: "cura"} } // Keep PreferencesDialog happy property var resetEnabled: false property var currentItem: null @@ -226,12 +226,12 @@ UM.ManagementPage { id: importMaterialDialog title: catalog.i18nc("@title:window", "Import Material") - selectExisting: true + fileMode: FileDialog.OpenFile nameFilters: Cura.ContainerManager.getContainerNameFilters("material") - folder: CuraApplication.getDefaultPath("dialog_material_path") + currentFolder: CuraApplication.getDefaultPath("dialog_material_path") onAccepted: { - const result = Cura.ContainerManager.importMaterialContainer(fileUrl); + const result = Cura.ContainerManager.importMaterialContainer(selectedFile); const messageDialog = Qt.createQmlObject("import Cura 1.5 as Cura; Cura.MessageDialog { onClosed: destroy() }", base); messageDialog.standardButtons = Dialog.Ok; @@ -239,14 +239,14 @@ UM.ManagementPage switch (result.status) { case "success": - messageDialog.text = catalog.i18nc("@info:status Don't translate the XML tag <filename>!", "Successfully imported material <filename>%1</filename>").arg(fileUrl); + messageDialog.text = catalog.i18nc("@info:status Don't translate the XML tag <filename>!", "Successfully imported material <filename>%1</filename>").arg(selectedFile); break; default: - messageDialog.text = catalog.i18nc("@info:status Don't translate the XML tags <filename> or <message>!", "Could not import material <filename>%1</filename>: <message>%2</message>").arg(fileUrl).arg(result.message); + messageDialog.text = catalog.i18nc("@info:status Don't translate the XML tags <filename> or <message>!", "Could not import material <filename>%1</filename>: <message>%2</message>").arg(selectedFile).arg(result.message); break; } messageDialog.open(); - CuraApplication.setDefaultPath("dialog_material_path", folder); + CuraApplication.setDefaultPath("dialog_material_path", currentFolder); } } @@ -254,12 +254,14 @@ UM.ManagementPage { id: exportMaterialDialog title: catalog.i18nc("@title:window", "Export Material") - selectExisting: false + fileMode: FileDialog.SaveFile nameFilters: Cura.ContainerManager.getContainerNameFilters("material") - folder: CuraApplication.getDefaultPath("dialog_material_path") + currentFolder: CuraApplication.getDefaultPath("dialog_material_path") onAccepted: { - const result = Cura.ContainerManager.exportContainer(base.currentItem.root_material_id, selectedNameFilter, fileUrl); + const nameFilterString = selectedNameFilter.index >= 0 ? nameFilters[selectedNameFilter.index] : nameFilters[0]; + + const result = Cura.ContainerManager.exportContainer(base.currentItem.root_material_id, nameFilterString, selectedFile); const messageDialog = Qt.createQmlObject("import Cura 1.5 as Cura; Cura.MessageDialog { onClosed: destroy() }", base); messageDialog.title = catalog.i18nc("@title:window", "Export Material"); @@ -267,7 +269,7 @@ UM.ManagementPage switch (result.status) { case "error": - messageDialog.text = catalog.i18nc("@info:status Don't translate the XML tags <filename> and <message>!", "Failed to export material to <filename>%1</filename>: <message>%2</message>").arg(fileUrl).arg(result.message); + messageDialog.text = catalog.i18nc("@info:status Don't translate the XML tags <filename> and <message>!", "Failed to export material to <filename>%1</filename>: <message>%2</message>").arg(selectedFile).arg(result.message); break; case "success": messageDialog.text = catalog.i18nc("@info:status Don't translate the XML tag <filename>!", "Successfully exported material to <filename>%1</filename>").arg(result.path); @@ -275,7 +277,7 @@ UM.ManagementPage } messageDialog.open(); - CuraApplication.setDefaultPath("dialog_material_path", folder); + CuraApplication.setDefaultPath("dialog_material_path", currentFolder); } } } diff --git a/resources/qml/Preferences/Materials/MaterialsSlot.qml b/resources/qml/Preferences/Materials/MaterialsSlot.qml index f124736fd0..8292fbe6da 100644 --- a/resources/qml/Preferences/Materials/MaterialsSlot.qml +++ b/resources/qml/Preferences/Materials/MaterialsSlot.qml @@ -106,7 +106,7 @@ Rectangle anchors.right: materialSlot.right visible: false - UM.RecolorImage + UM.ColorImage { id: favoriteIndicator anchors.centerIn: parent diff --git a/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml b/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml index e592be6d5d..08ea2efd5b 100644 --- a/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml +++ b/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml @@ -3,9 +3,10 @@ import QtQuick 2.15 import QtQuick.Controls 2.15 -import QtQuick.Dialogs 1.2 +import QtQuick.Dialogs import QtQuick.Layouts 1.15 import QtQuick.Window 2.1 + import Cura 1.1 as Cura import UM 1.5 as UM @@ -230,7 +231,6 @@ Window { id: syncStatusLabel anchors.left: parent.left - wrapMode: Text.Wrap elide: Text.ElideRight visible: text !== "" font: UM.Theme.getFont("medium") @@ -297,7 +297,7 @@ Window iconSize: UM.Theme.getSize("machine_selector_icon").width //Printer status badge (always cloud, but whether it's online or offline). - UM.RecolorImage + UM.ColorImage { width: UM.Theme.getSize("printer_status_icon").width height: UM.Theme.getSize("printer_status_icon").height @@ -325,7 +325,7 @@ Window } } - UM.RecolorImage + UM.ColorImage { id: printerSpinner width: UM.Theme.getSize("section_icon").width @@ -402,7 +402,7 @@ Window UM.Label { Layout.fillWidth: true - Layout.alignment: Qt.AlignVCenter + Layout.alignment: Qt.AlignmentFlag.AlignVCenter text: catalog.i18nc("@text Asking the user whether printers are missing in a list.", "Printers missing?") + "\n" + catalog.i18nc("@text", "Make sure all your printers are turned ON and connected to Digital Factory.") @@ -413,7 +413,7 @@ Window Cura.SecondaryButton { id: refreshListButton - Layout.alignment: Qt.AlignVCenter + Layout.alignment: Qt.AlignmentFlag.AlignVCenter text: catalog.i18nc("@button", "Refresh List") iconSource: UM.Theme.getIcon("ArrowDoubleCircleRight") onClicked: Cura.API.account.sync(true) @@ -490,7 +490,7 @@ Window visible: !syncButton.visible - UM.RecolorImage + UM.ColorImage { id: syncingIcon height: UM.Theme.getSize("action_button_icon").height @@ -558,7 +558,6 @@ Window text: catalog.i18nc("@text", "It seems like you don't have any compatible printers connected to Digital Factory. Make sure your printer is connected and it's running the latest firmware.") Layout.fillWidth: true horizontalAlignment: Text.AlignHCenter - wrapMode: Text.Wrap } Item @@ -632,7 +631,6 @@ Window { text: catalog.i18nc("@text In the UI this is followed by a list of steps the user needs to take.", "Follow the following steps to load the new material profiles to your printer.") font: UM.Theme.getFont("medium") - wrapMode: Text.Wrap Layout.fillWidth: true } @@ -700,7 +698,7 @@ Window { if(!materialsSyncDialog.hasExportedUsb) { - exportUsbDialog.folder = syncModel.getPreferredExportAllPath(); + exportUsbDialog.currentFolder = syncModel.getPreferredExportAllPath(); exportUsbDialog.open(); } else @@ -731,13 +729,13 @@ Window property variant exportUsbDialog: FileDialog { title: catalog.i18nc("@title:window", "Export All Materials") - selectExisting: false nameFilters: ["Material archives (*.umm)", "All files (*)"] + fileMode: FileDialog.SaveFile onAccepted: { - syncModel.exportAll(fileUrl); + syncModel.exportAll(selectedFile); CuraApplication.setDefaultPath("dialog_material_path", folder); materialsSyncDialog.hasExportedUsb = true; } } -}
\ No newline at end of file +} diff --git a/resources/qml/Preferences/Materials/MaterialsTypeSection.qml b/resources/qml/Preferences/Materials/MaterialsTypeSection.qml index d781218027..2e6a255014 100644 --- a/resources/qml/Preferences/Materials/MaterialsTypeSection.qml +++ b/resources/qml/Preferences/Materials/MaterialsTypeSection.qml @@ -2,7 +2,7 @@ // Uranium is released under the terms of the LGPLv3 or higher. import QtQuick 2.7 -import QtQuick.Controls 1.4 +import QtQuick.Controls 2.4 import QtQuick.Layouts 1.3 import UM 1.5 as UM diff --git a/resources/qml/Preferences/Materials/MaterialsView.qml b/resources/qml/Preferences/Materials/MaterialsView.qml index 2cbadc6bd6..d37150075b 100644 --- a/resources/qml/Preferences/Materials/MaterialsView.qml +++ b/resources/qml/Preferences/Materials/MaterialsView.qml @@ -3,8 +3,8 @@ import QtQuick 2.7 import QtQuick.Controls 2.15 -import QtQuick.Dialogs 1.2 import QtQuick.Layouts 1.3 +import QtQuick.Dialogs import UM 1.5 as UM import Cura 1.0 as Cura @@ -206,7 +206,8 @@ Item { height: informationPage.rowHeight width: informationPage.columnWidth - verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Color") + verticalAlignment: Qt.AlignVCenter + text: catalog.i18nc("@label", "Color") } Row @@ -573,11 +574,11 @@ Item elide: Text.ElideRight verticalAlignment: Qt.AlignVCenter } - Cura.SpinBox + Cura.NumericTextFieldWithUnit { id: spinBox anchors.left: label.right - value: + valueText: { // In case the setting is not in the material... if (!isNaN(parseFloat(materialPropertyProvider.properties.value))) @@ -597,11 +598,15 @@ Item return 0; } width: settingsPage.columnWidth - suffix: " " + model.unit - to: 99999 + maximum: 99999 + unitText: model.unit decimals: model.unit == "mm" ? 2 : 0 + enabled: base.editingEnabled - onEditingFinished: materialPropertyProvider.setPropertyValue("value", value) + editingFinishedFunction: function() + { + materialPropertyProvider.setPropertyValue("value", parseFloat(valueText.replace(",", "."))) + } } UM.ContainerPropertyProvider diff --git a/resources/qml/Preferences/ProfilesPage.qml b/resources/qml/Preferences/ProfilesPage.qml index 9ea23194e7..b7030f242b 100644 --- a/resources/qml/Preferences/ProfilesPage.qml +++ b/resources/qml/Preferences/ProfilesPage.qml @@ -4,7 +4,7 @@ import QtQuick 2.7 import QtQuick.Controls 2.15 import QtQuick.Layouts 1.3 -import QtQuick.Dialogs 1.2 +import QtQuick.Dialogs import UM 1.5 as UM import Cura 1.6 as Cura @@ -13,6 +13,7 @@ import Cura 1.6 as Cura UM.ManagementPage { id: base + Item { enabled: false; UM.I18nCatalog { id: catalog; name: "cura"} } property var extrudersModel: CuraApplication.getExtrudersModel() property var qualityManagementModel: CuraApplication.getQualityManagementModel() @@ -58,7 +59,7 @@ UM.ManagementPage scrollviewCaption: catalog.i18nc("@label", "Profiles compatible with active printer:") + "<br><b>" + Cura.MachineManager.activeMachine.name + "</b>" hamburgerButtonVisible: hasCurrentItem - onHamburgeButtonClicked: { + onHamburgeButtonClicked: (hamburger_button) => { const hamburerButtonHeight = hamburger_button.height; menu.popup(hamburger_button, -menu.width + hamburger_button.width / 2, hamburger_button.height); @@ -349,13 +350,18 @@ UM.ManagementPage { id: exportDialog title: catalog.i18nc("@title:window", "Export Profile") - selectExisting: false + fileMode: FileDialog.SaveFile nameFilters: base.qualityManagementModel.getFileNameFilters("profile_writer") - folder: CuraApplication.getDefaultPath("dialog_profile_path") + currentFolder: CuraApplication.getDefaultPath("dialog_profile_path") onAccepted: { + + // If nameFilters contains only 1 item, the index of selectedNameFilter will always be -1 + // This fetches the nameFilter at index selectedNameFilter.index if it is positive + const nameFilterString = selectedNameFilter.index >= 0 ? nameFilters[selectedNameFilter.index] : nameFilters[0]; + var result = Cura.ContainerManager.exportQualityChangesGroup(base.currentItem.quality_changes_group, - fileUrl, selectedNameFilter); + selectedFile, nameFilterString); if (result && result.status == "error") { @@ -365,7 +371,7 @@ UM.ManagementPage } // else pop-up Message thing from python code - CuraApplication.setDefaultPath("dialog_profile_path", folder); + CuraApplication.setDefaultPath("dialog_profile_path", currentFolder); } } @@ -385,7 +391,7 @@ UM.ManagementPage title: catalog.i18nc("@title:window", "Confirm Remove") text: catalog.i18nc("@label (%1 is object name)", "Are you sure you wish to remove %1? This cannot be undone!").arg(base.currentItemName) - standardButtons: StandardButton.Yes | StandardButton.No + standardButtons: Dialog.Yes | Dialog.No modal: true onAccepted: @@ -414,12 +420,12 @@ UM.ManagementPage { id: importDialog title: catalog.i18nc("@title:window", "Import Profile") - selectExisting: true + fileMode: FileDialog.OpenFile nameFilters: base.qualityManagementModel.getFileNameFilters("profile_reader") - folder: CuraApplication.getDefaultPath("dialog_profile_path") + currentFolder: CuraApplication.getDefaultPath("dialog_profile_path") onAccepted: { - var result = Cura.ContainerManager.importProfile(fileUrl); + var result = Cura.ContainerManager.importProfile(selectedFile); messageDialog.title = catalog.i18nc("@title:window", "Import Profile") messageDialog.text = result.message; messageDialog.open(); diff --git a/resources/qml/Preferences/SettingVisibilityItem.qml b/resources/qml/Preferences/SettingVisibilityItem.qml index b7edd54c35..8905c15124 100644 --- a/resources/qml/Preferences/SettingVisibilityItem.qml +++ b/resources/qml/Preferences/SettingVisibilityItem.qml @@ -74,7 +74,7 @@ Item } } - UM.RecolorImage + UM.ColorImage { anchors.centerIn: parent width: Math.round(check.height * 0.75) | 0 diff --git a/resources/qml/Preferences/SettingVisibilityPage.qml b/resources/qml/Preferences/SettingVisibilityPage.qml index 035f121537..476ba999cf 100644 --- a/resources/qml/Preferences/SettingVisibilityPage.qml +++ b/resources/qml/Preferences/SettingVisibilityPage.qml @@ -12,6 +12,8 @@ UM.PreferencesPage { title: catalog.i18nc("@title:tab", "Setting Visibility") + Item { enabled: false; UM.I18nCatalog { id: catalog; name: "cura"} } + property QtObject settingVisibilityPresetsModel: CuraApplication.getSettingVisibilityPresetsModel() property int scrollToIndex: 0 diff --git a/resources/qml/PrintSetupHeaderButton.qml b/resources/qml/PrintSetupHeaderButton.qml index a4f95148da..0a6c5c363a 100644 --- a/resources/qml/PrintSetupHeaderButton.qml +++ b/resources/qml/PrintSetupHeaderButton.qml @@ -89,7 +89,7 @@ ToolButton { id: background - UM.RecolorImage + UM.ColorImage { id: downArrow anchors.verticalCenter: parent.verticalCenter @@ -97,7 +97,6 @@ ToolButton anchors.rightMargin: UM.Theme.getSize("default_margin").width width: UM.Theme.getSize("standard_arrow").width height: UM.Theme.getSize("standard_arrow").height - sourceSize.height: width color: base.enabled ? UM.Theme.getColor("setting_control_button") : UM.Theme.getColor("setting_category_disabled_text") source: UM.Theme.getIcon("ChevronSingleDown") } diff --git a/resources/qml/PrintSetupSelector/Custom/CustomPrintSetup.qml b/resources/qml/PrintSetupSelector/Custom/CustomPrintSetup.qml index 2ca4a9f9bf..05ee28714b 100644 --- a/resources/qml/PrintSetupSelector/Custom/CustomPrintSetup.qml +++ b/resources/qml/PrintSetupSelector/Custom/CustomPrintSetup.qml @@ -129,7 +129,7 @@ Item background: UM.UnderlineBackground { id: backgroundItem - liningColor: intentSelection.hovered ? UM.Theme.getColor("border_main") : UM.Theme.getColor("border_field_light") + liningColor: intentSelection.hovered ? UM.Theme.getColor("text_field_border_hovered") : UM.Theme.getColor("border_field_light") } UM.SimpleButton @@ -159,7 +159,7 @@ Item } onExited: base.hideTooltip() } - UM.RecolorImage + UM.ColorImage { id: downArrow @@ -218,8 +218,6 @@ Item materialColor: model.color extruderEnabled: model.enabled iconVariant: "default" - height: parent.height - width: height } } onClicked: diff --git a/resources/qml/PrintSetupSelector/Custom/MenuButton.qml b/resources/qml/PrintSetupSelector/Custom/MenuButton.qml index 112edbbf77..6663ff9991 100644 --- a/resources/qml/PrintSetupSelector/Custom/MenuButton.qml +++ b/resources/qml/PrintSetupSelector/Custom/MenuButton.qml @@ -44,7 +44,7 @@ Button { height: button.height width: button.width - UM.RecolorImage + UM.ColorImage { id: check height: UM.Theme.getSize("default_arrow").height diff --git a/resources/qml/PrintSetupSelector/NoIntentIcon.qml b/resources/qml/PrintSetupSelector/NoIntentIcon.qml index 6fc883fdef..2dc422f6d6 100644 --- a/resources/qml/PrintSetupSelector/NoIntentIcon.qml +++ b/resources/qml/PrintSetupSelector/NoIntentIcon.qml @@ -16,7 +16,7 @@ Item implicitWidth: UM.Theme.getSize("section_icon").width implicitHeight: UM.Theme.getSize("section_icon").height - UM.RecolorImage + UM.ColorImage { source: UM.Theme.getIcon("Information") color: UM.Theme.getColor("icon") diff --git a/resources/qml/PrintSetupSelector/PrintSetupSelector.qml b/resources/qml/PrintSetupSelector/PrintSetupSelector.qml index 414c349bb6..16dabea7b8 100644 --- a/resources/qml/PrintSetupSelector/PrintSetupSelector.qml +++ b/resources/qml/PrintSetupSelector/PrintSetupSelector.qml @@ -12,7 +12,6 @@ Cura.ExpandableComponent id: printSetupSelector dragPreferencesNamePrefix: "view/settings" - property bool preSlicedData: PrintInformation !== null && PrintInformation.preSliced contentPadding: UM.Theme.getSize("default_lining").width diff --git a/resources/qml/PrintSetupSelector/PrintSetupSelectorContents.qml b/resources/qml/PrintSetupSelector/PrintSetupSelectorContents.qml index 046efe8b5b..e53aa693e1 100644 --- a/resources/qml/PrintSetupSelector/PrintSetupSelectorContents.qml +++ b/resources/qml/PrintSetupSelector/PrintSetupSelectorContents.qml @@ -15,10 +15,8 @@ Item id: content property int absoluteMinimumHeight: 200 * screenScaleFactor - - width: UM.Theme.getSize("print_setup_widget").width - 2 * UM.Theme.getSize("default_margin").width - height: contents.height + buttonRow.height - + implicitWidth: UM.Theme.getSize("print_setup_widget").width + implicitHeight: contents.height + buttonRow.height enum Mode { Recommended = 0, @@ -227,7 +225,7 @@ Item color: UM.Theme.getColor("lining") } - UM.RecolorImage + UM.ColorImage { width: UM.Theme.getSize("drag_icon").width height: UM.Theme.getSize("drag_icon").height diff --git a/resources/qml/PrintSetupSelector/Recommended/RecommendedInfillDensitySelector.qml b/resources/qml/PrintSetupSelector/Recommended/RecommendedInfillDensitySelector.qml index 434945e172..9e2d73609c 100644 --- a/resources/qml/PrintSetupSelector/Recommended/RecommendedInfillDensitySelector.qml +++ b/resources/qml/PrintSetupSelector/Recommended/RecommendedInfillDensitySelector.qml @@ -101,7 +101,8 @@ Item { id: backgroundLine height: UM.Theme.getSize("print_setup_slider_groove").height - width: infillSlider.width - UM.Theme.getSize("print_setup_slider_handle").width + width: parent.width - UM.Theme.getSize("print_setup_slider_handle").width + implicitWidth: width anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter color: infillSlider.enabled ? UM.Theme.getColor("quality_slider_available") : UM.Theme.getColor("quality_slider_unavailable") @@ -120,8 +121,10 @@ Item anchors.verticalCenter: parent.verticalCenter // Do not use Math.round otherwise the tickmarks won't be aligned - x: ((handleButton.width / 2) - (backgroundLine.implicitWidth / 2) + (index * ((repeater.width - handleButton.width) / (repeater.count-1)))) - radius: Math.round(backgroundLine.implicitWidth / 2) + // (space between steps) * index of step + x: (backgroundLine.width / (repeater.count - 1)) * index + + radius: Math.round(implicitWidth / 2) visible: (index % 10) == 0 // Only show steps of 10% UM.Label @@ -130,7 +133,6 @@ Item visible: (index % 20) == 0 // Only show steps of 20% anchors.horizontalCenter: parent.horizontalCenter y: UM.Theme.getSize("thin_margin").height - renderType: Text.NativeRendering color: UM.Theme.getColor("quality_slider_available") } } @@ -172,7 +174,8 @@ Item // same operation const active_mode = UM.Preferences.getValue("cura/active_mode") - if (active_mode == 0 || active_mode == "simple") + if (visible // Workaround: 'visible' is checked because on startup in Windows it spuriously gets an 'onValueChanged' with value '0' if this isn't checked. + && (active_mode == 0 || active_mode == "simple")) { Cura.MachineManager.setSettingForAllExtruders("infill_sparse_density", "value", roundedSliderValue) Cura.MachineManager.resetSettingForAllExtruders("infill_line_distance") diff --git a/resources/qml/PrintSetupSelector/Recommended/RecommendedQualityProfileSelector.qml b/resources/qml/PrintSetupSelector/Recommended/RecommendedQualityProfileSelector.qml index 1176142b3b..f96062463d 100644 --- a/resources/qml/PrintSetupSelector/Recommended/RecommendedQualityProfileSelector.qml +++ b/resources/qml/PrintSetupSelector/Recommended/RecommendedQualityProfileSelector.qml @@ -4,7 +4,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 -import UM 1.2 as UM +import UM 1.5 as UM import Cura 1.6 as Cura import ".." @@ -111,7 +111,7 @@ Item } height: intentCategoryLabel.height - Label + UM.Label { id: intentCategoryLabel text: model.name @@ -119,8 +119,6 @@ Item anchors.left: parent.left anchors.leftMargin: UM.Theme.getSize("section_icon").width + UM.Theme.getSize("narrow_margin").width font: UM.Theme.getFont("medium") - color: UM.Theme.getColor("text") - renderType: Text.NativeRendering elide: Text.ElideRight } diff --git a/resources/qml/PrintSetupSelector/Recommended/RecommendedSupportSelector.qml b/resources/qml/PrintSetupSelector/Recommended/RecommendedSupportSelector.qml index 49be0fae1c..0b683f0ddf 100644 --- a/resources/qml/PrintSetupSelector/Recommended/RecommendedSupportSelector.qml +++ b/resources/qml/PrintSetupSelector/Recommended/RecommendedSupportSelector.qml @@ -154,7 +154,7 @@ Item when: supportExtruderCombobox.model.count > 0 } - indicator: UM.RecolorImage + indicator: UM.ColorImage { id: downArrow x: supportExtruderCombobox.width - width - supportExtruderCombobox.rightPadding @@ -163,8 +163,6 @@ Item source: UM.Theme.getIcon("ChevronSingleDown") width: UM.Theme.getSize("standard_arrow").width height: UM.Theme.getSize("standard_arrow").height - sourceSize.width: width + 5 * screenScaleFactor - sourceSize.height: width + 5 * screenScaleFactor color: UM.Theme.getColor("setting_control_button") } diff --git a/resources/qml/PrintSetupTooltip.qml b/resources/qml/PrintSetupTooltip.qml index 29fe7d6508..af4280342c 100644 --- a/resources/qml/PrintSetupTooltip.qml +++ b/resources/qml/PrintSetupTooltip.qml @@ -17,10 +17,12 @@ UM.PointingRectangle arrowSize: UM.Theme.getSize("default_arrow").width opacity: 0 + // This should be disabled when invisible, otherwise it will catch mouse events. + enabled: opacity > 0 Behavior on opacity { - NumberAnimation { duration: 100; } + NumberAnimation { duration: 200; } } property alias text: label.text @@ -59,16 +61,19 @@ UM.PointingRectangle base.opacity = 0; } - MouseArea + ScrollView { - enabled: parent.opacity > 0 - visible: enabled - anchors.fill: parent - acceptedButtons: Qt.NoButton - hoverEnabled: true + id: textScroll + width: parent.width + height: Math.min(label.height + UM.Theme.getSize("tooltip_margins").height, base.parent.height) + + ScrollBar.horizontal.policy: ScrollBar.AlwaysOff + ScrollBar.vertical.policy: ScrollBar.AsNeeded + + hoverEnabled: parent.opacity > 0 onHoveredChanged: { - if(containsMouse && base.opacity > 0) + if(hovered && base.opacity > 0) { base.show(Qt.point(target.x - 1, target.y - UM.Theme.getSize("tooltip_arrow_margins").height / 2)); //Same arrow position as before. } @@ -78,27 +83,15 @@ UM.PointingRectangle } } - ScrollView + UM.Label { - id: textScroll - width: parent.width - height: Math.min(label.height, base.parent.height) - - ScrollBar.horizontal: ScrollBar { - active: false //Only allow vertical scrolling. We should grow vertically only, but due to how the label is positioned it allocates space in the ScrollView horizontally. - } + id: label + x: UM.Theme.getSize("tooltip_margins").width + y: UM.Theme.getSize("tooltip_margins").height + width: textScroll.width - 2 * UM.Theme.getSize("tooltip_margins").width - UM.Label - { - id: label - x: UM.Theme.getSize("tooltip_margins").width - y: UM.Theme.getSize("tooltip_margins").height - width: base.width - UM.Theme.getSize("tooltip_margins").width * 2 - - wrapMode: Text.Wrap - textFormat: Text.RichText - color: UM.Theme.getColor("tooltip_text") - } + textFormat: Text.RichText + color: UM.Theme.getColor("tooltip_text") } } } diff --git a/resources/qml/PrinterOutput/ExtruderBox.qml b/resources/qml/PrinterOutput/ExtruderBox.qml index bea7c3bdd8..e567d5d4cb 100644 --- a/resources/qml/PrinterOutput/ExtruderBox.qml +++ b/resources/qml/PrinterOutput/ExtruderBox.qml @@ -1,7 +1,7 @@ //Copyright (c) 2022 Ultimaker B.V. //Cura is released under the terms of the LGPLv3 or higher. -import QtQuick 2.2 +import QtQuick 2.15 import QtQuick.Controls 2.1 import UM 1.5 as UM @@ -206,7 +206,7 @@ Item selectByMouse: true maximumLength: 5 enabled: parent.enabled - validator: RegExpValidator { regExp: /^-?[0-9]{0,9}[.,]?[0-9]{0,10}$/ } //Floating point regex. + validator: RegularExpressionValidator { regularExpression: /^-?[0-9]{0,9}[.,]?[0-9]{0,10}$/ } //Floating point regex. anchors.left: parent.left anchors.leftMargin: UM.Theme.getSize("setting_unit_margin").width anchors.right: unit.left diff --git a/resources/qml/PrinterOutput/HeatedBedBox.qml b/resources/qml/PrinterOutput/HeatedBedBox.qml index 288e9cab3f..8a1d13524f 100644 --- a/resources/qml/PrinterOutput/HeatedBedBox.qml +++ b/resources/qml/PrinterOutput/HeatedBedBox.qml @@ -1,7 +1,7 @@ // Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. -import QtQuick 2.10 +import QtQuick 2.15 import QtQuick.Controls 2.4 import UM 1.5 as UM @@ -186,7 +186,7 @@ Item selectByMouse: true maximumLength: 5 enabled: parent.enabled - validator: RegExpValidator { regExp: /^-?[0-9]{0,9}[.,]?[0-9]{0,10}$/ } //Floating point regex. + validator: RegularExpressionValidator { regularExpression: /^-?[0-9]{0,9}[.,]?[0-9]{0,10}$/ } //Floating point regex. anchors.left: parent.left anchors.leftMargin: UM.Theme.getSize("setting_unit_margin").width anchors.right: unit.left diff --git a/resources/qml/PrinterOutput/OutputDeviceHeader.qml b/resources/qml/PrinterOutput/OutputDeviceHeader.qml index aeb9d14363..bbc208374f 100644 --- a/resources/qml/PrinterOutput/OutputDeviceHeader.qml +++ b/resources/qml/PrinterOutput/OutputDeviceHeader.qml @@ -33,7 +33,6 @@ Item { id: outputDeviceNameLabel font: UM.Theme.getFont("large_bold") - color: UM.Theme.getColor("text") anchors.left: parent.left anchors.top: parent.top anchors.margins: UM.Theme.getSize("default_margin").width diff --git a/resources/qml/PrinterSelector/MachineSelector.qml b/resources/qml/PrinterSelector/MachineSelector.qml index 12f495f7a8..77cd2be409 100644 --- a/resources/qml/PrinterSelector/MachineSelector.qml +++ b/resources/qml/PrinterSelector/MachineSelector.qml @@ -108,7 +108,7 @@ Cura.ExpandablePopup iconColor: UM.Theme.getColor("machine_selector_printer_icon") iconSize: source != "" ? UM.Theme.getSize("machine_selector_icon").width: 0 - UM.RecolorImage + UM.ColorImage { id: connectionStatusImage anchors @@ -192,9 +192,8 @@ Cura.ExpandablePopup contentItem: Item { id: popup - width: UM.Theme.getSize("machine_selector_widget_content").width - height: Math.min(machineSelectorList.contentHeight + separator.height + buttonRow.height, UM.Theme.getSize("machine_selector_widget_content").height) //Maximum height is the theme entry. - + implicitWidth: UM.Theme.getSize("machine_selector_widget_content").width + implicitHeight: Math.min(machineSelectorList.contentHeight + separator.height + buttonRow.height, UM.Theme.getSize("machine_selector_widget_content").height) //Maximum height is the theme entry. MachineSelectorList { id: machineSelectorList diff --git a/resources/qml/PrinterSelector/MachineSelectorButton.qml b/resources/qml/PrinterSelector/MachineSelectorButton.qml index 74c833f691..cd1f3cc574 100644 --- a/resources/qml/PrinterSelector/MachineSelectorButton.qml +++ b/resources/qml/PrinterSelector/MachineSelectorButton.qml @@ -40,7 +40,7 @@ Button contentItem: Item { - width: machineSelectorButton.width - machineSelectorButton.leftPadding + width: machineSelectorButton.width - machineSelectorButton.leftPadding - machineSelectorButton.rightPadding height: UM.Theme.getSize("action_button").height UM.Label diff --git a/resources/qml/PrinterTypeLabel.qml b/resources/qml/PrinterTypeLabel.qml index f2e8dc6f48..7b9acc19c9 100644 --- a/resources/qml/PrinterTypeLabel.qml +++ b/resources/qml/PrinterTypeLabel.qml @@ -4,7 +4,7 @@ import QtQuick 2.7 import QtQuick.Controls 2.1 -import UM 1.1 as UM +import UM 1.5 as UM // This component creates a label with the abbreviated name of a printer, with a rectangle surrounding the label. // It is created in a separated place in order to be reused whenever needed. @@ -24,14 +24,11 @@ Item radius: UM.Theme.getSize("checkbox_radius").width } - Label + UM.Label { id: printerTypeLabel text: "CFFFP" // As an abbreviated name of the Custom FFF Printer anchors.verticalCenter: parent.verticalCenter anchors.horizontalCenter: parent.horizontalCenter - renderType: Text.NativeRendering - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") } }
\ No newline at end of file diff --git a/resources/qml/ProfileOverview.qml b/resources/qml/ProfileOverview.qml index e1009cd010..3508a85193 100644 --- a/resources/qml/ProfileOverview.qml +++ b/resources/qml/ProfileOverview.qml @@ -1,11 +1,10 @@ //Copyright (c) 2022 Ultimaker B.V. //Cura is released under the terms of the LGPLv3 or higher. -import Qt.labs.qmlmodels 1.0 import QtQuick 2.7 import QtQuick.Controls 2.15 -import UM 1.5 as UM +import UM 1.6 as UM import Cura 1.6 as Cura Cura.TableView @@ -39,13 +38,11 @@ Cura.TableView catalog.i18nc("@title:column", "Current"), catalog.i18nc("@title:column Unit of measurement", "Unit") ] - model: TableModel + + model: UM.TableModel { id: tableModel - TableModelColumn { display: "label" } - TableModelColumn { display: "profile_value" } - TableModelColumn { display: "user_value" } - TableModelColumn { display: "unit" } + headers: ["label", "profile_value", "user_value", "unit"] rows: modelRows } sectionRole: "category" diff --git a/resources/qml/SearchBar.qml b/resources/qml/SearchBar.qml index 4d9c003653..af5ad7cc35 100644 --- a/resources/qml/SearchBar.qml +++ b/resources/qml/SearchBar.qml @@ -17,7 +17,7 @@ Cura.TextField placeholderText: catalog.i18nc("@placeholder", "Search") font.italic: true - UM.RecolorImage + UM.ColorImage { id: searchIcon diff --git a/resources/qml/Settings/SettingCheckBox.qml b/resources/qml/Settings/SettingCheckBox.qml index 4987eedb83..215d2be1be 100644 --- a/resources/qml/Settings/SettingCheckBox.qml +++ b/resources/qml/Settings/SettingCheckBox.qml @@ -143,13 +143,12 @@ SettingItem return UM.Theme.getColor("checkbox") } - UM.RecolorImage + UM.ColorImage { anchors.verticalCenter: parent.verticalCenter anchors.horizontalCenter: parent.horizontalCenter height: UM.Theme.getSize("checkbox_mark").height width: UM.Theme.getSize("checkbox_mark").width - sourceSize.height: width color: !enabled ? UM.Theme.getColor("checkbox_mark_disabled") : UM.Theme.getColor("checkbox_mark"); source: UM.Theme.getIcon("Check", "low") opacity: control.checked ? 1 : 0 diff --git a/resources/qml/Settings/SettingExtruder.qml b/resources/qml/Settings/SettingExtruder.qml index c3bc472fbe..567161b8f6 100644 --- a/resources/qml/Settings/SettingExtruder.qml +++ b/resources/qml/Settings/SettingExtruder.qml @@ -98,7 +98,7 @@ SettingItem when: control.model.items.length > 0 } - indicator: UM.RecolorImage + indicator: UM.ColorImage { id: downArrow x: control.width - width - control.rightPadding @@ -107,8 +107,6 @@ SettingItem source: UM.Theme.getIcon("ChevronSingleDown") width: UM.Theme.getSize("standard_arrow").width height: UM.Theme.getSize("standard_arrow").height - sourceSize.width: width + 5 * screenScaleFactor - sourceSize.height: width + 5 * screenScaleFactor color: UM.Theme.getColor("setting_control_button"); } @@ -127,17 +125,22 @@ SettingItem } return UM.Theme.getColor("setting_control") } + borderColor: control.activeFocus ? UM.Theme.getSize("text_field_border_active") : "transparent" liningColor: { - if (!enabled) + if(!enabled) + { + return UM.Theme.getColor("setting_control_disabled_border"); + } + if(control.activeFocus) { - return UM.Theme.getColor("setting_control_disabled_border") + return UM.Theme.getColor("text_field_border_active"); } - if (control.hovered || control.activeFocus) + if(base.hovered) { - return UM.Theme.getColor("border_main") + return UM.Theme.getColor("text_field_border_hovered"); } - return UM.Theme.getColor("border_field_light") + return UM.Theme.getColor("border_field_light"); } } @@ -156,7 +159,7 @@ SettingItem background: Rectangle { id: swatch - height: Math.round(parent.height / 2) + height: UM.Theme.getSize("standard_arrow").width width: height radius: Math.round(width / 2) anchors.right: parent.right diff --git a/resources/qml/Settings/SettingItem.qml b/resources/qml/Settings/SettingItem.qml index 6787855775..228de4a9d6 100644 --- a/resources/qml/Settings/SettingItem.qml +++ b/resources/qml/Settings/SettingItem.qml @@ -5,7 +5,7 @@ import QtQuick 2.7 import QtQuick.Layouts 1.2 import QtQuick.Controls 2.0 -import UM 1.1 as UM +import UM 1.5 as UM import Cura 1.0 as Cura import "." @@ -62,13 +62,19 @@ Item var affected_by_list = "" for (var i in affected_by) { - affected_by_list += "<li>%1</li>\n".arg(affected_by[i].label) + if(affected_by[i].label != "") + { + affected_by_list += "<li>%1</li>\n".arg(affected_by[i].label) + } } var affects_list = "" for (var i in affects) { - affects_list += "<li>%1</li>\n".arg(affects[i].label) + if(affects[i].label != "") + { + affects_list += "<li>%1</li>\n".arg(affects[i].label) + } } var tooltip = "<b>%1</b>\n<p>%2</p>".arg(definition.label).arg(definition.description) @@ -129,7 +135,7 @@ Item } } - Label + UM.Label { id: label @@ -140,7 +146,6 @@ Item text: definition.label elide: Text.ElideMiddle - renderType: Text.NativeRendering textFormat: Text.PlainText color: UM.Theme.getColor("setting_control_text") diff --git a/resources/qml/Settings/SettingOptionalExtruder.qml b/resources/qml/Settings/SettingOptionalExtruder.qml index 2a4db2ab31..22f03d44a2 100644 --- a/resources/qml/Settings/SettingOptionalExtruder.qml +++ b/resources/qml/Settings/SettingOptionalExtruder.qml @@ -99,7 +99,7 @@ SettingItem value: control.currentText != "" ? control.model.getItem(control.currentIndex).color : "transparent" } - indicator: UM.RecolorImage + indicator: UM.ColorImage { id: downArrow x: control.width - width - control.rightPadding @@ -108,8 +108,6 @@ SettingItem source: UM.Theme.getIcon("ChevronSingleDown") width: UM.Theme.getSize("standard_arrow").width height: UM.Theme.getSize("standard_arrow").height - sourceSize.width: width + 5 * screenScaleFactor - sourceSize.height: width + 5 * screenScaleFactor color: UM.Theme.getColor("setting_control_button") } @@ -128,17 +126,22 @@ SettingItem } return UM.Theme.getColor("setting_control") } + borderColor: control.activeFocus ? UM.Theme.getColor("text_field_border_active") : "transparent" liningColor: { - if (!enabled) + if(!enabled) + { + return UM.Theme.getColor("setting_control_disabled_border"); + } + if(control.activeFocus) { - return UM.Theme.getColor("setting_control_disabled_border") + return UM.Theme.getColor("text_field_border_active"); } - if (control.hovered || control.activeFocus) + if(base.hovered) { - return UM.Theme.getColor("border_main") + return UM.Theme.getColor("text_field_border_hovered"); } - return UM.Theme.getColor("border_field_light") + return UM.Theme.getColor("border_field_light"); } } @@ -159,7 +162,7 @@ SettingItem background: Rectangle { id: swatch - height: Math.round(parent.height / 2) + height: UM.Theme.getSize("standard_arrow").width width: height radius: Math.round(width / 2) anchors.right: parent.right diff --git a/resources/qml/Settings/SettingTextField.qml b/resources/qml/Settings/SettingTextField.qml index 95976ad58e..f0e3b2cacb 100644 --- a/resources/qml/Settings/SettingTextField.qml +++ b/resources/qml/Settings/SettingTextField.qml @@ -1,8 +1,8 @@ // Copyright (c) 2021 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. -import QtQuick 2.7 -import QtQuick.Controls 2.0 +import QtQuick 2.15 +import QtQuick.Controls 2.15 import UM 1.5 as UM @@ -32,11 +32,12 @@ SettingItem anchors.fill: parent + borderColor: input.activeFocus ? UM.Theme.getColor("text_field_border_active") : "transparent" liningColor: { if(!enabled) { - return UM.Theme.getColor("text_field_border_disabled") + return UM.Theme.getColor("text_field_border_disabled"); } switch(propertyProvider.properties.validationState) { @@ -50,17 +51,21 @@ SettingItem return UM.Theme.getColor("setting_validation_warning"); } //Validation is OK. - if(hovered || input.activeFocus) + if(input.activeFocus) { - return UM.Theme.getColor("text_field_border_hovered") + return UM.Theme.getColor("text_field_border_active"); } - return UM.Theme.getColor("text_field_border") + if(hovered) + { + return UM.Theme.getColor("text_field_border_hovered"); + } + return UM.Theme.getColor("text_field_border"); } color: { if(!enabled) { - return UM.Theme.getColor("text_field") + return UM.Theme.getColor("setting_control_disabled") } switch(propertyProvider.properties.validationState) { @@ -154,7 +159,7 @@ SettingItem // should be done as little as possible) clip: definition.type == "str" || definition.type == "[int]" - validator: RegExpValidator { regExp: (definition.type == "[int]") ? /^\[?(\s*-?[0-9]{0,9}\s*,)*(\s*-?[0-9]{0,9})\s*\]?$/ : (definition.type == "int") ? /^-?[0-9]{0,10}$/ : (definition.type == "float") ? /^-?[0-9]{0,9}[.,]?[0-9]{0,3}$/ : /^.*$/ } // definition.type property from parent loader used to disallow fractional number entry + validator: RegularExpressionValidator { regularExpression: (definition.type == "[int]") ? /^\[?(\s*-?[0-9]{0,9}\s*,)*(\s*-?[0-9]{0,9})\s*\]?$/ : (definition.type == "int") ? /^-?[0-9]{0,10}$/ : (definition.type == "float") ? /^-?[0-9]{0,9}[.,]?[0-9]{0,3}$/ : /^.*$/ } // definition.type property from parent loader used to disallow fractional number entry Binding { @@ -162,6 +167,13 @@ SettingItem property: "text" value: { + if (input.activeFocus) + { + // In QT6 using "when: !activeFocus" causes the value to be null when activeFocus becomes True + // Since we want the value to stay the same when giving focus to the TextInput this is being used + // in place of "when: !activeFocus" + return input.text + } // Stacklevels // 0: user -> unsaved change // 1: quality changes -> saved change @@ -181,7 +193,6 @@ SettingItem return propertyProvider.properties.value } } - when: !input.activeFocus } MouseArea diff --git a/resources/qml/Settings/SettingView.qml b/resources/qml/Settings/SettingView.qml index 40e9e19b01..3ac6acbc33 100644 --- a/resources/qml/Settings/SettingView.qml +++ b/resources/qml/Settings/SettingView.qml @@ -43,6 +43,7 @@ Item height: parent.height anchors.left: parent.left anchors.right: parent.right + topPadding: height / 4 leftPadding: searchIcon.width + UM.Theme.getSize("default_margin").width * 2 placeholderText: catalog.i18nc("@label:textbox", "Search settings") font.italic: true @@ -50,7 +51,7 @@ Item property var expandedCategories property bool lastFindingSettings: false - UM.RecolorImage + UM.ColorImage { id: searchIcon @@ -60,7 +61,7 @@ Item left: parent.left leftMargin: UM.Theme.getSize("default_margin").width } - source: UM.Theme.getIcon("search") + source: UM.Theme.getIcon("Magnifier") height: UM.Theme.getSize("small_button_icon").height width: height color: UM.Theme.getColor("text") @@ -171,13 +172,13 @@ Item { anchors.fill: contents acceptedButtons: Qt.AllButtons - onWheel: wheel.accepted = true + onWheel: (wheel) => { wheel.accepted = true } } ListView { id: contents - maximumFlickVelocity: 1000 + maximumFlickVelocity: 1000 * screenScaleFactor anchors { top: filterContainer.bottom @@ -194,7 +195,7 @@ Item onPositionChanged: { // This removes focus from items when scrolling. // This fixes comboboxes staying open and scrolling container - if (!activeFocus) { + if (!activeFocus && !filter.activeFocus) { forceActiveFocus(); } } @@ -226,9 +227,7 @@ Item id: delegate width: contents.width - (scrollBar.width + UM.Theme.getSize("narrow_margin").width) - Behavior on height { NumberAnimation { duration: 100 } } opacity: enabled ? 1 : 0 - Behavior on opacity { NumberAnimation { duration: 100 } } enabled: provider.properties.enabled === "True" property var definition: model @@ -350,10 +349,7 @@ Item function onFocusReceived() { contents.indexWithFocus = index - animateContentY.from = contents.contentY contents.positionViewAtIndex(index, ListView.Contain) - animateContentY.to = contents.contentY - animateContentY.running = true } function onSetActiveFocusToNextSetting(forward) { @@ -385,35 +381,6 @@ Item } } - NumberAnimation { - id: animateContentY - target: contents - property: "contentY" - duration: 50 - } - - add: Transition { - SequentialAnimation { - NumberAnimation { properties: "height"; from: 0; duration: 100 } - NumberAnimation { properties: "opacity"; from: 0; duration: 100 } - } - } - remove: Transition { - SequentialAnimation { - NumberAnimation { properties: "opacity"; to: 0; duration: 100 } - NumberAnimation { properties: "height"; to: 0; duration: 100 } - } - } - addDisplaced: Transition { - NumberAnimation { properties: "x,y"; duration: 100 } - } - removeDisplaced: Transition { - SequentialAnimation { - PauseAnimation { duration: 100; } - NumberAnimation { properties: "x,y"; duration: 100 } - } - } - Cura.Menu { id: contextMenu diff --git a/resources/qml/SpinBox.qml b/resources/qml/SpinBox.qml index 5f809a434a..038125111c 100644 --- a/resources/qml/SpinBox.qml +++ b/resources/qml/SpinBox.qml @@ -1,7 +1,7 @@ // Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. -import QtQuick 2.2 +import QtQuick 2.15 import QtQuick.Controls 2.15 import UM 1.5 as UM @@ -28,14 +28,13 @@ Item property bool editable: true - property var validator: RegExpValidator + property var validator: RegularExpressionValidator { - regExp: new RegExp("^" + prefix + "([0-9]+[.|,]?[0-9]*)?" + suffix + "$") + regularExpression: new RegExp("^" + prefix + "([0-9]+[.|,]?[0-9]*)?" + suffix + "$") } signal editingFinished() - implicitWidth: spinBox.implicitWidth - implicitHeight: spinBox.implicitHeight + height: UM.Theme.getSize("setting_control").height SpinBox { @@ -44,8 +43,8 @@ Item editable: base.editable topPadding: 0 bottomPadding: 0 - padding: UM.Theme.getSize("narrow_margin").width - + leftPadding: down.indicator.width + UM.Theme.getSize("narrow_margin").width + rightPadding: up.indicator.width + UM.Theme.getSize("narrow_margin").width // The stepSize of the SpinBox is intentionally set to be always `1` // As SpinBoxes can only contain integer values the `base.stepSize` is concidered the precision/resolution // increasing the spinBox.value by one increases the actual/real value of the component by `base.stepSize` @@ -110,7 +109,7 @@ Item color: spinBox.down.pressed ? spinBox.palette.mid : UM.Theme.getColor("detail_background") } - UM.RecolorImage + UM.ColorImage { anchors.centerIn: parent height: parent.height / 2.5 @@ -130,7 +129,7 @@ Item color: spinBox.up.pressed ? spinBox.palette.mid : UM.Theme.getColor("detail_background") } - UM.RecolorImage + UM.ColorImage { anchors.centerIn: parent height: parent.height / 2.5 diff --git a/resources/qml/TableView.qml b/resources/qml/TableView.qml index 5e0b863f5a..7da2341908 100644 --- a/resources/qml/TableView.qml +++ b/resources/qml/TableView.qml @@ -1,7 +1,6 @@ //Copyright (C) 2022 Ultimaker B.V. //Cura is released under the terms of the LGPLv3 or higher. -import Qt.labs.qmlmodels 1.0 import QtQuick 2.15 import QtQuick.Controls 2.15 @@ -56,8 +55,9 @@ Item font: UM.Theme.getFont("medium_bold") elide: Text.ElideRight } - Item //Resize handle. + Item { + //Resize handle. anchors { right: parent.right @@ -171,6 +171,12 @@ Item acceptedButtons: Qt.LeftButton text: (cellTextMetrics.elidedText == cellContent.text) ? "" : cellContent.text //Show full text in tooltip if it was elided. + } + + MouseArea + { + anchors.fill: parent + propagateComposedEvents: true onClicked: { if(tableBase.allowSelection) diff --git a/resources/qml/Toolbar.qml b/resources/qml/Toolbar.qml index 32de5b76ca..6ecdc9dce0 100644 --- a/resources/qml/Toolbar.qml +++ b/resources/qml/Toolbar.qml @@ -63,13 +63,10 @@ Item isTopElement: toolsModel.getItem(0).id == model.id isBottomElement: toolsModel.getItem(toolsModel.count - 1).id == model.id - toolItem: UM.RecolorImage + toolItem: UM.ColorImage { source: UM.Theme.getIcon(model.icon) != "" ? UM.Theme.getIcon(model.icon) : "file:///" + model.location + "/" + model.icon color: UM.Theme.getColor("icon") - - sourceSize.height: Math.round(UM.Theme.getSize("button").height / 2) - sourceSize.width: Math.round(UM.Theme.getSize("button").width / 2) } onCheckedChanged: @@ -160,7 +157,7 @@ Item anchors.topMargin: base.activeY z: buttons.z - 1 - target: Qt.point(parent.right, base.activeY + Math.round(UM.Theme.getSize("button").height/2)) + target: Qt.point(-1, base.activeY + Math.round(UM.Theme.getSize("button").height / 2)) arrowSize: UM.Theme.getSize("default_arrow").width width: @@ -213,12 +210,11 @@ Item width: toolHint.width + UM.Theme.getSize("default_margin").width height: toolHint.height; color: UM.Theme.getColor("tooltip") - Label + UM.Label { id: toolHint text: UM.ActiveTool.properties.getValue("ToolHint") != undefined ? UM.ActiveTool.properties.getValue("ToolHint") : "" color: UM.Theme.getColor("tooltip_text") - font: UM.Theme.getFont("default") anchors.horizontalCenter: parent.horizontalCenter } diff --git a/resources/qml/ViewsSelector.qml b/resources/qml/ViewsSelector.qml index 452cc5a09a..e76e5dbb67 100644 --- a/resources/qml/ViewsSelector.qml +++ b/resources/qml/ViewsSelector.qml @@ -69,17 +69,10 @@ Cura.ExpandablePopup } } + contentWidth: viewSelector.width - 2 * viewSelector.contentPadding contentItem: Column { id: viewSelectorPopup - width: viewSelector.width - 2 * viewSelector.contentPadding - - // For some reason the height/width of the column gets set to 0 if this is not set... - Component.onCompleted: - { - height = implicitHeight - width = viewSelector.width - 2 * viewSelector.contentPadding - } Repeater { diff --git a/resources/qml/WelcomePages/AddCloudPrintersView.qml b/resources/qml/WelcomePages/AddCloudPrintersView.qml index 0b94d21fae..3f2d3dbab2 100644 --- a/resources/qml/WelcomePages/AddCloudPrintersView.qml +++ b/resources/qml/WelcomePages/AddCloudPrintersView.qml @@ -38,7 +38,7 @@ Item bottomMargin: UM.Theme.getSize("default_margin").height } - Label + UM.Label { id: titleLabel anchors.top: parent.top @@ -47,7 +47,6 @@ Item text: catalog.i18nc("@label", "Add a Cloud printer") color: UM.Theme.getColor("primary_button") font: UM.Theme.getFont("huge") - renderType: Text.NativeRendering } // Component that contains a busy indicator and a message, while it waits for Cura to discover a cloud printer @@ -65,7 +64,7 @@ Item running: searchingForCloudPrinters palette.dark: UM.Theme.getColor("text") } - Label + UM.Label { id: waitingLabel anchors.top: waitingIndicator.bottom @@ -73,10 +72,8 @@ Item horizontalAlignment: Text.AlignHCenter text: catalog.i18nc("@label", "Waiting for Cloud response") font: UM.Theme.getFont("large") - renderType: Text.NativeRendering - color: UM.Theme.getColor("text") } - Label + UM.Label { id: noPrintersFoundLabel anchors.top: waitingLabel.bottom @@ -85,9 +82,8 @@ Item horizontalAlignment: Text.AlignHCenter text: catalog.i18nc("@label", "No printers found in your account?") font: UM.Theme.getFont("medium") - color: UM.Theme.getColor("text") } - Label + UM.Label { text: "Sign in with a different account" anchors.top: noPrintersFoundLabel.bottom @@ -112,7 +108,7 @@ Item } // Label displayed when a new cloud printer is discovered - Label + UM.Label { anchors.top: titleLabel.bottom anchors.topMargin: 2 * UM.Theme.getSize("default_margin").height @@ -121,7 +117,6 @@ Item text: catalog.i18nc("@label", "The following printers in your account have been added in Cura:") height: contentHeight + 2 * UM.Theme.getSize("default_margin").height visible: discoveredCloudPrintersModel.count > 0 - color: UM.Theme.getColor("text") } // The scrollView that contains the list of newly discovered Ultimaker Cloud printers. Visible only when @@ -153,32 +148,29 @@ Item Column { id: contentColumn - Label + UM.Label { id: cloudPrinterNameLabel leftPadding: UM.Theme.getSize("default_margin").width text: model.name ? model.name : "" font: UM.Theme.getFont("large_bold") - color: UM.Theme.getColor("text") elide: Text.ElideRight } - Label + UM.Label { id: cloudPrinterTypeLabel leftPadding: 2 * UM.Theme.getSize("default_margin").width topPadding: UM.Theme.getSize("thin_margin").height - text: {"Type: " + model.machine_type} + text: "Type: " + model.machine_type font: UM.Theme.getFont("medium") - color: UM.Theme.getColor("text") elide: Text.ElideRight } - Label + UM.Label { id: cloudPrinterFirmwareVersionLabel leftPadding: 2 * UM.Theme.getSize("default_margin").width - text: {"Firmware version: " + model.firmware_version} + text: "Firmware version: " + model.firmware_version font: UM.Theme.getFont("medium") - color: UM.Theme.getColor("text") elide: Text.ElideRight } } diff --git a/resources/qml/WelcomePages/AddLocalPrinterScrollView.qml b/resources/qml/WelcomePages/AddLocalPrinterScrollView.qml index d2d48267de..1d868d72ef 100644 --- a/resources/qml/WelcomePages/AddLocalPrinterScrollView.qml +++ b/resources/qml/WelcomePages/AddLocalPrinterScrollView.qml @@ -1,8 +1,8 @@ // Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. -import QtQuick 2.10 -import QtQuick.Controls 2.3 +import QtQuick 2.15 +import QtQuick.Controls 2.14 import UM 1.5 as UM import Cura 1.1 as Cura @@ -115,14 +115,12 @@ Item width: childrenRect.width height: UM.Theme.getSize("action_button").height - UM.RecolorImage + UM.ColorImage { id: arrow anchors.left: parent.left width: UM.Theme.getSize("standard_arrow").width height: UM.Theme.getSize("standard_arrow").height - sourceSize.width: width - sourceSize.height: height color: UM.Theme.getColor("text") source: base.currentSection == section ? UM.Theme.getIcon("ChevronSingleDown") : UM.Theme.getIcon("ChevronSingleRight") } @@ -185,7 +183,6 @@ Item UM.Label { width: parent.width - (2 * UM.Theme.getSize("default_margin").width) - wrapMode: Text.Wrap text: base.getMachineName() color: UM.Theme.getColor("primary_button") font: UM.Theme.getFont("huge") @@ -235,9 +232,9 @@ Item placeholderText: catalog.i18nc("@text", "Please name your printer") maximumLength: 40 width: parent.width - (printerNameLabel.width + (3 * UM.Theme.getSize("default_margin").width)) - validator: RegExpValidator + validator: RegularExpressionValidator { - regExp: printerNameTextField.machineNameValidator.machineNameRegex + regularExpression: printerNameTextField.machineNameValidator.machineNameRegex } property var machineNameValidator: Cura.MachineNameValidator { } } diff --git a/resources/qml/WelcomePages/AddNetworkOrLocalPrinterContent.qml b/resources/qml/WelcomePages/AddNetworkOrLocalPrinterContent.qml index dbf68ce701..83a38eab7a 100644 --- a/resources/qml/WelcomePages/AddNetworkOrLocalPrinterContent.qml +++ b/resources/qml/WelcomePages/AddNetworkOrLocalPrinterContent.qml @@ -4,7 +4,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 -import UM 1.3 as UM +import UM 1.5 as UM import Cura 1.1 as Cura @@ -15,7 +15,7 @@ Item { UM.I18nCatalog { id: catalog; name: "cura" } - Label + UM.Label { id: titleLabel anchors.top: parent.top @@ -24,7 +24,6 @@ Item text: catalog.i18nc("@label", "Add a printer") color: UM.Theme.getColor("primary_button") font: UM.Theme.getFont("huge") - renderType: Text.NativeRendering } DropDownWidget diff --git a/resources/qml/WelcomePages/AddNetworkPrinterScrollView.qml b/resources/qml/WelcomePages/AddNetworkPrinterScrollView.qml index 64f194dd56..36c670f462 100644 --- a/resources/qml/WelcomePages/AddNetworkPrinterScrollView.qml +++ b/resources/qml/WelcomePages/AddNetworkPrinterScrollView.qml @@ -200,7 +200,7 @@ Item height: troubleshootingLinkIcon.height width: troubleshootingLinkIcon.width + troubleshootingLabel.width + UM.Theme.getSize("thin_margin").width - UM.RecolorImage + UM.ColorImage { id: troubleshootingLinkIcon anchors.right: troubleshootingLabel.left @@ -208,7 +208,6 @@ Item anchors.verticalCenter: parent.verticalCenter height: troubleshootingLabel.height width: height - sourceSize.height: width color: UM.Theme.getColor("text_link") source: UM.Theme.getIcon("LinkExternal") } @@ -219,7 +218,6 @@ Item anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter text: catalog.i18nc("@label", "Troubleshooting") - font: UM.Theme.getFont("default") color: UM.Theme.getColor("text_link") } diff --git a/resources/qml/WelcomePages/AddPrinterByIpContent.qml b/resources/qml/WelcomePages/AddPrinterByIpContent.qml index 2207bd1708..90fdd2be91 100644 --- a/resources/qml/WelcomePages/AddPrinterByIpContent.qml +++ b/resources/qml/WelcomePages/AddPrinterByIpContent.qml @@ -1,11 +1,11 @@ // Copyright (c) 2019 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. -import QtQuick 2.10 +import QtQuick 2.15 import QtQuick.Controls 2.3 import QtQuick.Layouts 1.3 -import UM 1.3 as UM +import UM 1.5 as UM import Cura 1.5 as Cura @@ -61,7 +61,7 @@ Item } } - Label + UM.Label { id: titleLabel anchors.top: parent.top @@ -70,7 +70,6 @@ Item text: catalog.i18nc("@label", "Add printer by IP address") color: UM.Theme.getColor("primary_button") font: UM.Theme.getFont("huge") - renderType: Text.NativeRendering } Item @@ -88,17 +87,13 @@ Item anchors.right: parent.right anchors.margins: UM.Theme.getSize("default_margin").width - Label + UM.Label { id: explainLabel height: contentHeight anchors.left: parent.left anchors.right: parent.right anchors.top: parent.top - - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") - renderType: Text.NativeRendering text: catalog.i18nc("@label", "Enter the IP address of your printer on the network.") } @@ -123,9 +118,9 @@ Item onInvalidInputDetected: invalidInputLabel.visible = true - validator: RegExpValidator + validator: RegularExpressionValidator { - regExp: /([a-fA-F0-9.:]+)?/ + regularExpression: /([a-fA-F0-9.:]+)?/ } onTextEdited: invalidInputLabel.visible = false @@ -136,7 +131,7 @@ Item onAccepted: addPrinterButton.clicked() } - Label + UM.Label { id: invalidInputLabel anchors.top: hostnameField.bottom @@ -144,9 +139,6 @@ Item anchors.left: parent.left visible: false text: catalog.i18nc("@text", "Please enter a valid IP address.") - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") - renderType: Text.NativeRendering } Cura.SecondaryButton @@ -188,14 +180,11 @@ Item anchors.top: userInputFields.bottom anchors.margins: UM.Theme.getSize("default_margin").width - Label + UM.Label { id: waitResponseLabel anchors.top: parent.top anchors.margins: UM.Theme.getSize("default_margin").width - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") - renderType: Text.NativeRendering visible: addPrinterByIpScreen.hasRequestInProgress || (addPrinterByIpScreen.hasRequestFinished && !addPrinterByIpScreen.isPrinterDiscovered) textFormat: Text.RichText @@ -225,18 +214,15 @@ Item visible: addPrinterByIpScreen.isPrinterDiscovered - Label + UM.Label { id: printerNameLabel anchors.top: parent.top font: UM.Theme.getFont("large") - color: UM.Theme.getColor("text") - renderType: Text.NativeRendering - text: !addPrinterByIpScreen.isPrinterDiscovered ? "???" : addPrinterByIpScreen.discoveredPrinter.name } - Label + UM.Label { id: printerCannotBeAddedLabel width: parent.width @@ -245,8 +231,6 @@ Item text: catalog.i18nc("@label", "This printer cannot be added because it's an unknown printer or it's not the host of a group.") visible: addPrinterByIpScreen.hasRequestFinished && !addPrinterByIpScreen.canAddPrinter font: UM.Theme.getFont("default_bold") - color: UM.Theme.getColor("text") - renderType: Text.NativeRendering wrapMode: Text.WordWrap } @@ -258,52 +242,33 @@ Item columns: 2 columnSpacing: UM.Theme.getSize("default_margin").width - Label + UM.Label { text: catalog.i18nc("@label", "Type") - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") - renderType: Text.NativeRendering } - Label + UM.Label { id: typeText text: !addPrinterByIpScreen.isPrinterDiscovered ? "?" : addPrinterByIpScreen.discoveredPrinter.readableMachineType - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") - renderType: Text.NativeRendering } - - Label + UM.Label { text: catalog.i18nc("@label", "Firmware version") - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") - renderType: Text.NativeRendering } - Label + UM.Label { id: firmwareText text: !addPrinterByIpScreen.isPrinterDiscovered ? "0.0.0.0" : addPrinterByIpScreen.discoveredPrinter.device.getProperty("firmware_version") - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") - renderType: Text.NativeRendering } - Label + UM.Label { text: catalog.i18nc("@label", "Address") - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") - renderType: Text.NativeRendering } - Label + UM.Label { id: addressText text: !addPrinterByIpScreen.isPrinterDiscovered ? "0.0.0.0" : addPrinterByIpScreen.discoveredPrinter.address - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") - renderType: Text.NativeRendering } } diff --git a/resources/qml/WelcomePages/CloudContent.qml b/resources/qml/WelcomePages/CloudContent.qml index 7dc35c7bc5..cf830a9b36 100644 --- a/resources/qml/WelcomePages/CloudContent.qml +++ b/resources/qml/WelcomePages/CloudContent.qml @@ -4,7 +4,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 -import UM 1.3 as UM +import UM 1.5 as UM import Cura 1.1 as Cura @@ -56,7 +56,7 @@ Item spacing: UM.Theme.getSize("thick_margin").height - Label + UM.Label { id: titleLabel anchors.horizontalCenter: parent.horizontalCenter @@ -64,7 +64,6 @@ Item text: catalog.i18nc("@label", "Sign in to the Ultimaker platform") color: UM.Theme.getColor("primary_button") font: UM.Theme.getFont("huge") - renderType: Text.NativeRendering } // Filler item @@ -116,17 +115,13 @@ Item sourceSize.width: width sourceSize.height: height } - Label + UM.Label { id: marketplaceTextLabel anchors.horizontalCenter: parent.horizontalCenter width: parent.width text: catalog.i18nc("@text", "Add material settings and plugins from the Marketplace") - wrapMode: Text.Wrap horizontalAlignment: Text.AlignHCenter - color: UM.Theme.getColor("text") - font: UM.Theme.getFont("default") - renderType: Text.NativeRendering } } @@ -146,17 +141,13 @@ Item sourceSize.width: width sourceSize.height: height } - Label + UM.Label { id: syncTextLabel anchors.horizontalCenter: parent.horizontalCenter width: parent.width text: catalog.i18nc("@text", "Backup and sync your material settings and plugins") - wrapMode: Text.Wrap horizontalAlignment: Text.AlignHCenter - color: UM.Theme.getColor("text") - font: UM.Theme.getFont("default") - renderType: Text.NativeRendering } } @@ -176,17 +167,13 @@ Item sourceSize.width: width sourceSize.height: height } - Label + UM.Label { id: communityTextLabel anchors.horizontalCenter: communityColumn.horizontalCenter width: parent.width text: catalog.i18nc("@text", "Share ideas and get help from 48,000+ users in the Ultimaker Community") - wrapMode: Text.Wrap horizontalAlignment: Text.AlignHCenter - color: UM.Theme.getColor("text") - font: UM.Theme.getFont("default") - renderType: Text.NativeRendering } } } diff --git a/resources/qml/WelcomePages/DataCollectionsContent.qml b/resources/qml/WelcomePages/DataCollectionsContent.qml index be4d09e876..ece437890e 100644 --- a/resources/qml/WelcomePages/DataCollectionsContent.qml +++ b/resources/qml/WelcomePages/DataCollectionsContent.qml @@ -4,7 +4,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 -import UM 1.3 as UM +import UM 1.5 as UM import Cura 1.1 as Cura @@ -15,7 +15,7 @@ Item { UM.I18nCatalog { id: catalog; name: "cura" } - Label + UM.Label { id: titleLabel anchors.top: parent.top @@ -24,7 +24,6 @@ Item text: catalog.i18nc("@label", "Help us to improve Ultimaker Cura") color: UM.Theme.getColor("primary_button") font: UM.Theme.getFont("huge") - renderType: Text.NativeRendering } // Area where the cloud contents can be put. Pictures, texts and such. @@ -48,7 +47,7 @@ Item spacing: UM.Theme.getSize("wide_margin").height - Label + UM.Label { id: topLabel width: parent.width @@ -57,8 +56,6 @@ Item text: catalog.i18nc("@text", "Ultimaker Cura collects anonymous data to improve print quality and user experience, including:") wrapMode: Text.WordWrap font: UM.Theme.getFont("medium") - color: UM.Theme.getColor("text") - renderType: Text.NativeRendering } Grid { @@ -91,7 +88,7 @@ Item } } - Label + UM.Label { id: bottomLabel width: parent.width @@ -107,10 +104,8 @@ Item textFormat: Text.RichText wrapMode: Text.WordWrap font: UM.Theme.getFont("medium") - color: UM.Theme.getColor("text") linkColor: UM.Theme.getColor("text_link") onLinkActivated: CuraApplication.showMoreInformationDialogForAnonymousDataCollection() - renderType: Text.NativeRendering } } } diff --git a/resources/qml/WelcomePages/DropDownHeader.qml b/resources/qml/WelcomePages/DropDownHeader.qml index a4b416b093..b91f3383be 100644 --- a/resources/qml/WelcomePages/DropDownHeader.qml +++ b/resources/qml/WelcomePages/DropDownHeader.qml @@ -57,7 +57,7 @@ Cura.RoundedRectangle color: base.hovered ? UM.Theme.getColor("small_button_text_hover") : UM.Theme.getColor("small_button_text") } - UM.RecolorImage + UM.ColorImage { id: rightIcon anchors.right: parent.right diff --git a/resources/qml/WelcomePages/FirstStartMachineActionsContent.qml b/resources/qml/WelcomePages/FirstStartMachineActionsContent.qml index 64a815855b..2503190c32 100644 --- a/resources/qml/WelcomePages/FirstStartMachineActionsContent.qml +++ b/resources/qml/WelcomePages/FirstStartMachineActionsContent.qml @@ -4,7 +4,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 -import UM 1.3 as UM +import UM 1.5 as UM import Cura 1.1 as Cura @@ -36,7 +36,7 @@ Item } } - Label + UM.Label { id: titleLabel anchors.top: parent.top @@ -45,7 +45,6 @@ Item text: machineActionsModel.currentItem.title == undefined ? "" : machineActionsModel.currentItem.title color: UM.Theme.getColor("primary_button") font: UM.Theme.getFont("huge") - renderType: Text.NativeRendering } Item diff --git a/resources/qml/WelcomePages/ImageTile.qml b/resources/qml/WelcomePages/ImageTile.qml index 7ed07304e6..b8f40ed25f 100644 --- a/resources/qml/WelcomePages/ImageTile.qml +++ b/resources/qml/WelcomePages/ImageTile.qml @@ -4,7 +4,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 -import UM 1.3 as UM +import UM 1.5 as UM // @@ -18,7 +18,7 @@ Column property alias text: label.text property alias imageSource: image.source - Label + UM.Label { id: label width: image.width @@ -26,9 +26,6 @@ Column horizontalAlignment: Text.AlignHCenter text: "" wrapMode: Text.WordWrap - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") - renderType: Text.NativeRendering } Image diff --git a/resources/qml/WelcomePages/WelcomeContent.qml b/resources/qml/WelcomePages/WelcomeContent.qml index 619780435d..4123535cc9 100644 --- a/resources/qml/WelcomePages/WelcomeContent.qml +++ b/resources/qml/WelcomePages/WelcomeContent.qml @@ -4,7 +4,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 -import UM 1.3 as UM +import UM 1.5 as UM import Cura 1.1 as Cura // @@ -48,7 +48,7 @@ Item width: parent.width } - Label + UM.Label { id: titleLabel anchors.horizontalCenter: parent.horizontalCenter @@ -56,20 +56,16 @@ Item text: catalog.i18nc("@label", "Welcome to Ultimaker Cura") color: UM.Theme.getColor("primary_button") font: UM.Theme.getFont("huge_bold") - renderType: Text.NativeRendering } - Label + UM.Label { id: textLabel anchors.horizontalCenter: parent.horizontalCenter horizontalAlignment: Text.AlignHCenter width: titleLabel.width + 2 * UM.Theme.getSize("thick_margin").width text: catalog.i18nc("@text", "Please follow these steps to set up Ultimaker Cura. This will only take a few moments.") - wrapMode: Text.Wrap font: UM.Theme.getFont("medium") - color: UM.Theme.getColor("text") - renderType: Text.NativeRendering } // Filler item diff --git a/resources/qml/WelcomePages/WelcomeDialogItem.qml b/resources/qml/WelcomePages/WelcomeDialogItem.qml index 2d01642ada..d98610d7d8 100644 --- a/resources/qml/WelcomePages/WelcomeDialogItem.qml +++ b/resources/qml/WelcomePages/WelcomeDialogItem.qml @@ -4,7 +4,6 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 import QtQuick.Window 2.2 -import QtGraphicalEffects 1.0 // For the DropShadow import UM 1.3 as UM import Cura 1.1 as Cura @@ -45,7 +44,8 @@ Item } // Drop shadow around the panel - DropShadow + // TODO: Maybe re-implement this some other way. + /*DropShadow { id: shadow radius: UM.Theme.getSize("first_run_shadow_radius").width @@ -55,7 +55,7 @@ Item verticalOffset: shadowOffset color: UM.Theme.getColor("first_run_shadow") transparentBorder: true - } + }*/ // Close this dialog when there's no more page to show Connections diff --git a/resources/qml/WelcomePages/WhatsNewContent.qml b/resources/qml/WelcomePages/WhatsNewContent.qml index c56f8880ed..bbae9380a2 100644 --- a/resources/qml/WelcomePages/WhatsNewContent.qml +++ b/resources/qml/WelcomePages/WhatsNewContent.qml @@ -4,9 +4,8 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 import QtQuick.Layouts 1.3 -import QtGraphicalEffects 1.12 // For the DropShadow -import UM 1.3 as UM +import UM 1.5 as UM import Cura 1.1 as Cura @@ -20,7 +19,7 @@ Item UM.I18nCatalog { id: catalog; name: "cura" } - Label + UM.Label { id: titleLabel anchors.top: parent.top @@ -29,7 +28,6 @@ Item text: catalog.i18nc("@label", "What's New") color: UM.Theme.getColor("primary_button") font: UM.Theme.getFont("huge") - renderType: Text.NativeRendering } Rectangle @@ -67,7 +65,7 @@ Item Rectangle { - Layout.alignment: Qt.AlignHCenter + Layout.alignment: Qt.AlignmentFlag.AlignHCenter color: UM.Theme.getColor("viewport_overlay") width: whatsNewViewport.width height: whatsNewViewport.height @@ -92,13 +90,6 @@ Item source: manager.getSubpageImageSource(index) } - DropShadow { - anchors.fill: subpageImage - radius: UM.Theme.getSize("monitor_shadow_radius").width - color: UM.Theme.getColor("first_run_shadow") - source: subpageImage - } - Cura.ScrollableTextArea { id: subpageText diff --git a/resources/qml/Widgets/ComboBox.qml b/resources/qml/Widgets/ComboBox.qml index 698eb4ec10..988b7c3782 100644 --- a/resources/qml/Widgets/ComboBox.qml +++ b/resources/qml/Widgets/ComboBox.qml @@ -31,15 +31,30 @@ ComboBox }, State { + name: "active" + when: control.activeFocus + PropertyChanges + { + target: background + borderColor: UM.Theme.getColor("text_field_border_active") + liningColor: UM.Theme.getColor("text_field_border_active") + } + }, + State + { name: "highlighted" - when: control.hovered || control.activeFocus - PropertyChanges { target: background; liningColor: UM.Theme.getColor("border_main")} + when: (base.hovered || control.hovered) && !control.activeFocus + PropertyChanges + { + target: background + liningColor: UM.Theme.getColor("text_field_border_hovered") + } } ] background: UM.UnderlineBackground{} - indicator: UM.RecolorImage + indicator: UM.ColorImage { id: downArrow x: control.width - width - control.rightPadding @@ -48,8 +63,6 @@ ComboBox source: UM.Theme.getIcon("ChevronSingleDown") width: UM.Theme.getSize("standard_arrow").width height: UM.Theme.getSize("standard_arrow").height - sourceSize.width: width + 5 * screenScaleFactor - sourceSize.height: width + 5 * screenScaleFactor color: UM.Theme.getColor("setting_control_button") } diff --git a/resources/qml/Widgets/Menu.qml b/resources/qml/Widgets/Menu.qml index b3cdfc6967..1a64b981fa 100644 --- a/resources/qml/Widgets/Menu.qml +++ b/resources/qml/Widgets/Menu.qml @@ -12,6 +12,7 @@ import Cura 1.0 as Cura UM.Menu { id: menu + Item { enabled: false; UM.I18nCatalog { id: catalog; name: "cura"} } topPadding: UM.Theme.getSize("narrow_margin").height bottomPadding: UM.Theme.getSize("narrow_margin").height padding: 0 diff --git a/resources/qml/Widgets/MenuItem.qml b/resources/qml/Widgets/MenuItem.qml index 36098e1197..c2929e512e 100644 --- a/resources/qml/Widgets/MenuItem.qml +++ b/resources/qml/Widgets/MenuItem.qml @@ -15,11 +15,12 @@ UM.MenuItem implicitHeight: UM.Theme.getSize("menu").height + UM.Theme.getSize("narrow_margin").height implicitWidth: UM.Theme.getSize("menu").width - opacity: enabled ? 1.0 : 0.5 - arrow: UM.RecolorImage + property bool overrideShowArrow: false + + arrow: UM.ColorImage { - visible: menuItem.subMenu + visible: menuItem.subMenu || overrideShowArrow height: UM.Theme.getSize("default_arrow").height width: height anchors.verticalCenter: parent.verticalCenter @@ -29,7 +30,7 @@ UM.MenuItem color: UM.Theme.getColor("setting_control_text") } - indicator: UM.RecolorImage + indicator: UM.ColorImage { id: check visible: menuItem.checkable && menuItem.checked diff --git a/resources/qml/Widgets/TextField.qml b/resources/qml/Widgets/TextField.qml index b708446d65..085c7b7742 100644 --- a/resources/qml/Widgets/TextField.qml +++ b/resources/qml/Widgets/TextField.qml @@ -23,6 +23,8 @@ TextField selectByMouse: true font: UM.Theme.getFont("default") color: UM.Theme.getColor("text_field_text") + selectedTextColor: UM.Theme.getColor("text_field_text") + placeholderTextColor: UM.Theme.getColor("text_field_text_disabled") renderType: Text.NativeRendering selectionColor: UM.Theme.getColor("text_selection") leftPadding: iconLeft.visible ? iconLeft.width + UM.Theme.getSize("default_margin").width * 2 : UM.Theme.getSize("thin_margin").width @@ -43,9 +45,24 @@ TextField }, State { + name: "active" + when: control.activeFocus + PropertyChanges + { + target: backgroundRectangle + liningColor: UM.Theme.getColor("text_field_border_active") + borderColor: UM.Theme.getColor("text_field_border_active") + } + }, + State + { name: "hovered" - when: control.hovered || control.activeFocus - PropertyChanges { target: backgroundRectangle; liningColor: UM.Theme.getColor("text_field_border_hovered")} + when: control.hovered && !control.activeFocus + PropertyChanges + { + target: backgroundRectangle + liningColor: UM.Theme.getColor("text_field_border_hovered") + } } ] @@ -53,7 +70,7 @@ TextField { id: backgroundRectangle //Optional icon added on the left hand side. - UM.RecolorImage + UM.ColorImage { id: iconLeft |