diff --git a/cura/PrinterOutput/Models/PrintJobOutputModel.py b/cura/PrinterOutput/Models/PrintJobOutputModel.py index b6a12cb183..164dc5cb67 100644 --- a/cura/PrinterOutput/Models/PrintJobOutputModel.py +++ b/cura/PrinterOutput/Models/PrintJobOutputModel.py @@ -119,16 +119,16 @@ class PrintJobOutputModel(QObject): @pyqtProperty(int, notify = timeTotalChanged) def timeTotal(self) -> int: - return self._time_total + return int(self._time_total) @pyqtProperty(int, notify = timeElapsedChanged) def timeElapsed(self) -> int: - return self._time_elapsed + return int(self._time_elapsed) @pyqtProperty(int, notify = timeElapsedChanged) def timeRemaining(self) -> int: # Never get a negative time remaining - return max(self.timeTotal - self.timeElapsed, 0) + return int(max(self.timeTotal - self.timeElapsed, 0)) @pyqtProperty(float, notify = timeElapsedChanged) def progress(self) -> float: diff --git a/plugins/3MFWriter/__init__.py b/plugins/3MFWriter/__init__.py index eff1648489..eb8a596afe 100644 --- a/plugins/3MFWriter/__init__.py +++ b/plugins/3MFWriter/__init__.py @@ -5,21 +5,23 @@ import sys from UM.Logger import Logger try: from . import ThreeMFWriter + threemf_writer_was_imported = True except ImportError: Logger.log("w", "Could not import ThreeMFWriter; libSavitar may be missing") -from . import ThreeMFWorkspaceWriter + threemf_writer_was_imported = False +from . import ThreeMFWorkspaceWriter from UM.i18n import i18nCatalog -from UM.Platform import Platform i18n_catalog = i18nCatalog("cura") + def getMetaData(): workspace_extension = "3mf" metaData = {} - if "3MFWriter.ThreeMFWriter" in sys.modules: + if threemf_writer_was_imported: metaData["mesh_writer"] = { "output": [{ "extension": "3mf", @@ -39,6 +41,7 @@ def getMetaData(): return metaData + def register(app): if "3MFWriter.ThreeMFWriter" in sys.modules: return {"mesh_writer": ThreeMFWriter.ThreeMFWriter(), diff --git a/plugins/CuraDrive/src/qml/pages/WelcomePage.qml b/plugins/CuraDrive/src/qml/pages/WelcomePage.qml index 01fbca2229..3e050b0482 100644 --- a/plugins/CuraDrive/src/qml/pages/WelcomePage.qml +++ b/plugins/CuraDrive/src/qml/pages/WelcomePage.qml @@ -23,7 +23,7 @@ Column { id: profileImage fillMode: Image.PreserveAspectFit - source: "../images/backup.svg" + source: Qt.resolvedUrl("../images/backup.svg") anchors.horizontalCenter: parent.horizontalCenter width: Math.round(parent.width / 4) } diff --git a/plugins/DigitalLibrary/resources/qml/LoadMoreProjectsCard.qml b/plugins/DigitalLibrary/resources/qml/LoadMoreProjectsCard.qml index 6a0706bd00..abc978be4a 100644 --- a/plugins/DigitalLibrary/resources/qml/LoadMoreProjectsCard.qml +++ b/plugins/DigitalLibrary/resources/qml/LoadMoreProjectsCard.qml @@ -37,7 +37,7 @@ Cura.RoundedRectangle width: UM.Theme.getSize("section").height height: width color: UM.Theme.getColor("text_link") - source: "../images/arrow_down.svg" + source: Qt.resolvedUrl("../images/arrow_down.svg") } Label @@ -65,7 +65,7 @@ Cura.RoundedRectangle { target: projectImage color: UM.Theme.getColor("text_link") - source: "../images/arrow_down.svg" + source: Qt.resolvedUrl("../images/arrow_down.svg") } PropertyChanges { @@ -88,7 +88,7 @@ Cura.RoundedRectangle { target: projectImage color: UM.Theme.getColor("text_link") - source: "../images/arrow_down.svg" + source: Qt.resolvedUrl("../images/arrow_down.svg") } PropertyChanges { @@ -111,7 +111,7 @@ Cura.RoundedRectangle { target: projectImage color: UM.Theme.getColor("action_button_disabled_text") - source: "../images/update.svg" + source: Qt.resolvedUrl("../images/update.svg") } PropertyChanges { diff --git a/plugins/DigitalLibrary/resources/qml/SelectProjectPage.qml b/plugins/DigitalLibrary/resources/qml/SelectProjectPage.qml index 60beb66e11..5a98fcb975 100644 --- a/plugins/DigitalLibrary/resources/qml/SelectProjectPage.qml +++ b/plugins/DigitalLibrary/resources/qml/SelectProjectPage.qml @@ -99,7 +99,7 @@ Item { id: digitalFactoryImage anchors.horizontalCenter: parent.horizontalCenter - source: searchBar.text === "" ? "../images/digital_factory.svg" : "../images/projects_not_found.svg" + source: Qt.resolvedUrl(searchBar.text === "" ? "../images/digital_factory.svg" : "../images/projects_not_found.svg") fillMode: Image.PreserveAspectFit width: parent.width - 2 * UM.Theme.getSize("thick_margin").width } diff --git a/plugins/ModelChecker/ModelChecker.qml b/plugins/ModelChecker/ModelChecker.qml index 85ee774a8b..f734aff2b1 100644 --- a/plugins/ModelChecker/ModelChecker.qml +++ b/plugins/ModelChecker/ModelChecker.qml @@ -14,7 +14,7 @@ UM.SimpleButton width: UM.Theme.getSize("save_button_specs_icons").width height: UM.Theme.getSize("save_button_specs_icons").height - iconSource: "model_checker.svg" + iconSource: Qt.resolvedUrl("model_checker.svg") anchors.verticalCenter: parent ? parent.verticalCenter : undefined color: UM.Theme.getColor("text_scene") hoverColor: UM.Theme.getColor("text_scene_hover") diff --git a/plugins/PostProcessingPlugin/PostProcessingPlugin.qml b/plugins/PostProcessingPlugin/PostProcessingPlugin.qml index d4cba61496..af9e67b46a 100644 --- a/plugins/PostProcessingPlugin/PostProcessingPlugin.qml +++ b/plugins/PostProcessingPlugin/PostProcessingPlugin.qml @@ -475,7 +475,7 @@ UM.Dialog } toolTipContentAlignment: UM.Enums.ContentAlignment.AlignLeft onClicked: dialog.show() -// iconSource: "Script.svg" + iconSource: Qt.resolvedUrl("Script.svg") fixedWidthMode: false } diff --git a/plugins/RemovableDriveOutputDevice/RemovableDrivePlugin.py b/plugins/RemovableDriveOutputDevice/RemovableDrivePlugin.py index 873076ea71..bb3f5e0019 100644 --- a/plugins/RemovableDriveOutputDevice/RemovableDrivePlugin.py +++ b/plugins/RemovableDriveOutputDevice/RemovableDrivePlugin.py @@ -21,7 +21,7 @@ class RemovableDrivePlugin(OutputDevicePlugin): super().__init__() self._update_thread = threading.Thread(target = self._updateThread) - self._update_thread.deamon = True + self._update_thread.daemon = True self._check_updates = True diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorIconExtruder.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorIconExtruder.qml index 4b1a7df607..0467e2b753 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorIconExtruder.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorIconExtruder.qml @@ -22,7 +22,7 @@ Item property int size: 32 * screenScaleFactor // TODO: Theme! // THe extruder icon source; NOTE: This shouldn't need to be changed - property string iconSource: "../svg/icons/Extruder.svg" + property string iconSource: Qt.resolvedUrl("../svg/icons/Extruder.svg") height: size width: size diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobPreview.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobPreview.qml index 4b4b7a2a3a..18d3a44ef1 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobPreview.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobPreview.qml @@ -45,7 +45,7 @@ Item anchors.centerIn: printJobPreview color: UM.Theme.getColor("monitor_placeholder_image") height: printJobPreview.height - source: "../svg/ultibot.svg" + source: Qt.resolvedUrl("../svg/ultibot.svg") /* Since print jobs ALWAYS have an image url, we have to check if that image URL errors or not in order to determine if we show the placeholder (ultibot) image instead. */ visible: printJob && previewImage.status == Image.Error diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterCard.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterCard.qml index 2bc20ae462..0069d017f6 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterCard.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterCard.qml @@ -252,7 +252,7 @@ Item bottom: parent.bottom bottomMargin: 20 * screenScaleFactor // TODO: Theme! } - iconSource: "../svg/icons/CameraPhoto.svg" + iconSource: Qt.resolvedUrl("../svg/icons/CameraPhoto.svg") enabled: !cloudConnection visible: printer } diff --git a/resources/qml/PrintSetupSelector/Recommended/RecommendedInfillDensitySelector.qml b/resources/qml/PrintSetupSelector/Recommended/RecommendedInfillDensitySelector.qml index 863e8c3900..625629c810 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 diff --git a/resources/qml/PrintSetupTooltip.qml b/resources/qml/PrintSetupTooltip.qml index 5e5b1dce73..20b9ac8981 100644 --- a/resources/qml/PrintSetupTooltip.qml +++ b/resources/qml/PrintSetupTooltip.qml @@ -11,7 +11,7 @@ UM.PointingRectangle id: base property real sourceWidth: 0 width: UM.Theme.getSize("tooltip").width - height: UM.Theme.getSize("tooltip").height + height: textScroll.height + UM.Theme.getSize("tooltip_margins").height * 2 color: UM.Theme.getColor("tooltip") arrowSize: UM.Theme.getSize("default_arrow").width @@ -20,7 +20,7 @@ UM.PointingRectangle Behavior on opacity { - NumberAnimation { duration: 100; } + NumberAnimation { duration: 200; } } property alias text: label.text @@ -59,16 +59,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,26 +81,16 @@ UM.PointingRectangle } } - ScrollView + UM.Label { - id: textScroll - width: base.width - height: base.height + 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 - ScrollBar.horizontal.policy: ScrollBar.AlwaysOff - ScrollBar.vertical.policy: ScrollBar.AsNeeded - - 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") - } + wrapMode: Text.Wrap + textFormat: Text.RichText + color: UM.Theme.getColor("tooltip_text") } } } diff --git a/resources/qml/Settings/SettingItem.qml b/resources/qml/Settings/SettingItem.qml index 6787855775..e975f1a2b9 100644 --- a/resources/qml/Settings/SettingItem.qml +++ b/resources/qml/Settings/SettingItem.qml @@ -62,13 +62,19 @@ Item var affected_by_list = "" for (var i in affected_by) { - affected_by_list += "
%2
".arg(definition.label).arg(definition.description) diff --git a/resources/qml/Settings/SettingView.qml b/resources/qml/Settings/SettingView.qml index cf24997b12..3ac6acbc33 100644 --- a/resources/qml/Settings/SettingView.qml +++ b/resources/qml/Settings/SettingView.qml @@ -61,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") @@ -178,7 +178,7 @@ Item ListView { id: contents - maximumFlickVelocity: 1000 + maximumFlickVelocity: 1000 * screenScaleFactor anchors { top: filterContainer.bottom diff --git a/resources/qml/Widgets/TextField.qml b/resources/qml/Widgets/TextField.qml index 5e19f65149..95d5caa4ef 100644 --- a/resources/qml/Widgets/TextField.qml +++ b/resources/qml/Widgets/TextField.qml @@ -23,6 +23,7 @@ TextField selectByMouse: true font: UM.Theme.getFont("default") color: UM.Theme.getColor("text_field_text") + selectedTextColor: UM.Theme.getColor("text_field_text") 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