Merge branch '5.0' of github.com:Ultimaker/Cura

This commit is contained in:
Jaime van Kessel 2022-04-28 13:26:56 +02:00
commit 8af6b46708
16 changed files with 58 additions and 52 deletions

View File

@ -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:

View File

@ -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(),

View File

@ -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)
}

View File

@ -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
{

View File

@ -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
}

View File

@ -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")

View File

@ -475,7 +475,7 @@ UM.Dialog
}
toolTipContentAlignment: UM.Enums.ContentAlignment.AlignLeft
onClicked: dialog.show()
// iconSource: "Script.svg"
iconSource: Qt.resolvedUrl("Script.svg")
fixedWidthMode: false
}

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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
}

View File

@ -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

View File

@ -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")
}
}
}

View File

@ -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)

View File

@ -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

View File

@ -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