mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-23 22:54:01 -06:00
Merge pull request #638 from Ultimaker/performance_fixes
Performance fixes
This commit is contained in:
commit
3e4f728281
25 changed files with 479 additions and 488 deletions
|
@ -24,7 +24,7 @@ class ProcessSlicedObjectListJob(Job):
|
|||
self._message = message
|
||||
self._scene = Application.getInstance().getController().getScene()
|
||||
self._progress = None
|
||||
self._abortRequested = False
|
||||
self._abort_requested = False
|
||||
|
||||
## Aborts the processing of layers.
|
||||
#
|
||||
|
@ -33,14 +33,14 @@ class ProcessSlicedObjectListJob(Job):
|
|||
# requested and then stop processing by itself. There is no guarantee
|
||||
# that the abort will stop the job any time soon or even at all.
|
||||
def abort(self):
|
||||
self._abortRequested = True
|
||||
self._abort_requested = True
|
||||
|
||||
def run(self):
|
||||
if Application.getInstance().getController().getActiveView().getPluginId() == "LayerView":
|
||||
self._progress = Message(catalog.i18nc("@info:status", "Processing Layers"), 0, False, -1)
|
||||
self._progress.show()
|
||||
Job.yieldThread()
|
||||
if self._abortRequested:
|
||||
if self._abort_requested:
|
||||
if self._progress:
|
||||
self._progress.hide()
|
||||
return
|
||||
|
@ -57,7 +57,7 @@ class ProcessSlicedObjectListJob(Job):
|
|||
else:
|
||||
object_id_map[id(node)] = node
|
||||
Job.yieldThread()
|
||||
if self._abortRequested:
|
||||
if self._abort_requested:
|
||||
if self._progress:
|
||||
self._progress.hide()
|
||||
return
|
||||
|
@ -113,7 +113,7 @@ class ProcessSlicedObjectListJob(Job):
|
|||
# TODO: Rebuild the layer data mesh once the layer has been processed.
|
||||
# This needs some work in LayerData so we can add the new layers instead of recreating the entire mesh.
|
||||
|
||||
if self._abortRequested:
|
||||
if self._abort_requested:
|
||||
if self._progress:
|
||||
self._progress.hide()
|
||||
return
|
||||
|
@ -123,7 +123,7 @@ class ProcessSlicedObjectListJob(Job):
|
|||
# We are done processing all the layers we got from the engine, now create a mesh out of the data
|
||||
layer_data.build()
|
||||
|
||||
if self._abortRequested:
|
||||
if self._abort_requested:
|
||||
if self._progress:
|
||||
self._progress.hide()
|
||||
return
|
||||
|
|
|
@ -10,16 +10,16 @@ import UM 1.0 as UM
|
|||
|
||||
Item
|
||||
{
|
||||
width: UM.Theme.sizes.button.width
|
||||
height: UM.Theme.sizes.slider_layerview_size.height
|
||||
width: UM.Theme.getSize("button").width
|
||||
height: UM.Theme.getSize("slider_layerview_size").height
|
||||
|
||||
Slider
|
||||
{
|
||||
id: slider
|
||||
width: UM.Theme.sizes.slider_layerview_size.width
|
||||
height: UM.Theme.sizes.slider_layerview_size.height
|
||||
width: UM.Theme.getSize("slider_layerview_size").width
|
||||
height: UM.Theme.getSize("slider_layerview_size").height
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: UM.Theme.sizes.slider_layerview_margin.width/2
|
||||
anchors.leftMargin: UM.Theme.getSize("slider_layerview_margin").width/2
|
||||
orientation: Qt.Vertical
|
||||
minimumValue: 0;
|
||||
maximumValue: UM.LayerView.numLayers;
|
||||
|
@ -34,11 +34,11 @@ Item
|
|||
anchors.left: parent.left
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
z: slider.z - 1
|
||||
width: UM.Theme.sizes.slider_layerview_background.width
|
||||
height: slider.height + UM.Theme.sizes.default_margin.height * 2
|
||||
color: UM.Theme.colors.tool_panel_background;
|
||||
border.width: UM.Theme.sizes.default_lining.width
|
||||
border.color: UM.Theme.colors.lining
|
||||
width: UM.Theme.getSize("slider_layerview_background").width
|
||||
height: slider.height + UM.Theme.getSize("default_margin").height * 2
|
||||
color: UM.Theme.getColor("tool_panel_background");
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
border.color: UM.Theme.getColor("lining")
|
||||
|
||||
MouseArea {
|
||||
id: sliderMouseArea
|
||||
|
|
|
@ -22,13 +22,13 @@ Item {
|
|||
anchors.top: parent.top;
|
||||
anchors.left: parent.left;
|
||||
|
||||
spacing: UM.Theme.sizes.default_margin.height;
|
||||
spacing: UM.Theme.getSize("default_margin").height;
|
||||
|
||||
UM.SettingItem {
|
||||
id: profileSelection
|
||||
|
||||
width: UM.Theme.sizes.setting.width;
|
||||
height: UM.Theme.sizes.setting.height;
|
||||
width: UM.Theme.getSize("setting").width;
|
||||
height: UM.Theme.getSize("setting").height;
|
||||
|
||||
name: catalog.i18nc("@label", "Object profile")
|
||||
type: "enum"
|
||||
|
@ -48,8 +48,8 @@ Item {
|
|||
|
||||
Column {
|
||||
id: customisedSettings
|
||||
spacing: UM.Theme.sizes.default_lining.height;
|
||||
width: UM.Theme.sizes.setting.width + UM.Theme.sizes.setting.height/2;
|
||||
spacing: UM.Theme.getSize("default_lining").height;
|
||||
width: UM.Theme.getSize("setting").width + UM.Theme.getSize("setting").height/2;
|
||||
|
||||
Repeater {
|
||||
id: settings;
|
||||
|
@ -57,8 +57,8 @@ Item {
|
|||
model: UM.ActiveTool.properties.getValue("Model").getItem(base.currentIndex).settings
|
||||
|
||||
UM.SettingItem {
|
||||
width: UM.Theme.sizes.setting.width;
|
||||
height: UM.Theme.sizes.setting.height;
|
||||
width: UM.Theme.getSize("setting").width;
|
||||
height: UM.Theme.getSize("setting").height;
|
||||
|
||||
name: model.label;
|
||||
type: model.type;
|
||||
|
@ -80,8 +80,8 @@ Item {
|
|||
{
|
||||
anchors.left: parent.right;
|
||||
|
||||
width: UM.Theme.sizes.setting.height;
|
||||
height: UM.Theme.sizes.setting.height;
|
||||
width: UM.Theme.getSize("setting").height;
|
||||
height: UM.Theme.getSize("setting").height;
|
||||
|
||||
onClicked: UM.ActiveTool.properties.getValue("Model").removeSettingOverride(UM.ActiveTool.properties.getValue("Model").getItem(base.currentIndex).id, model.key)
|
||||
|
||||
|
@ -98,8 +98,8 @@ Item {
|
|||
height: parent.height/2
|
||||
sourceSize.width: width
|
||||
sourceSize.height: width
|
||||
color: control.hovered ? UM.Theme.colors.setting_control_button_hover : UM.Theme.colors.setting_control_button
|
||||
source: UM.Theme.icons.cross1
|
||||
color: control.hovered ? UM.Theme.getColor("setting_control_button_hover") : UM.Theme.getColor("setting_control_button")
|
||||
source: UM.Theme.getIcon("cross1")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -112,7 +112,7 @@ Item {
|
|||
{
|
||||
id: customise_settings_button;
|
||||
anchors.right: profileSelection.right;
|
||||
height: UM.Theme.sizes.setting.height;
|
||||
height: UM.Theme.getSize("setting").height;
|
||||
visible: parseInt(UM.Preferences.getValue("cura/active_mode")) == 1
|
||||
|
||||
text: catalog.i18nc("@action:button", "Add Setting");
|
||||
|
@ -123,16 +123,16 @@ Item {
|
|||
{
|
||||
width: control.width;
|
||||
height: control.height;
|
||||
border.width: UM.Theme.sizes.default_lining.width;
|
||||
border.color: control.pressed ? UM.Theme.colors.action_button_active_border :
|
||||
control.hovered ? UM.Theme.colors.action_button_hovered_border : UM.Theme.colors.action_button_border
|
||||
color: control.pressed ? UM.Theme.colors.action_button_active :
|
||||
control.hovered ? UM.Theme.colors.action_button_hovered : UM.Theme.colors.action_button
|
||||
border.width: UM.Theme.getSize("default_lining").width;
|
||||
border.color: control.pressed ? UM.Theme.getColor("action_button_active_border") :
|
||||
control.hovered ? UM.Theme.getColor("action_button_hovered_border") : UM.Theme.getColor("action_button_border")
|
||||
color: control.pressed ? UM.Theme.getColor("action_button_active") :
|
||||
control.hovered ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("action_button")
|
||||
}
|
||||
label: Label
|
||||
{
|
||||
text: control.text;
|
||||
color: UM.Theme.colors.setting_control_text;
|
||||
color: UM.Theme.getColor("setting_control_text");
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
}
|
||||
|
@ -181,7 +181,7 @@ Item {
|
|||
}
|
||||
|
||||
Column {
|
||||
width: view.width - UM.Theme.sizes.default_margin.width * 2;
|
||||
width: view.width - UM.Theme.getSize("default_margin").width * 2;
|
||||
height: childrenRect.height;
|
||||
|
||||
Repeater {
|
||||
|
@ -212,11 +212,11 @@ Item {
|
|||
}
|
||||
label: Row
|
||||
{
|
||||
spacing: UM.Theme.sizes.default_margin.width;
|
||||
spacing: UM.Theme.getSize("default_margin").width;
|
||||
Image
|
||||
{
|
||||
anchors.verticalCenter: parent.verticalCenter;
|
||||
source: control.checked ? UM.Theme.icons.arrow_right : UM.Theme.icons.arrow_bottom;
|
||||
source: control.checked ? UM.Theme.getIcon("arrow_right") : UM.Theme.getIcon("arrow_bottom");
|
||||
}
|
||||
Label
|
||||
{
|
||||
|
@ -260,7 +260,7 @@ Item {
|
|||
|
||||
delegate: ToolButton {
|
||||
id: button;
|
||||
x: model.depth * UM.Theme.sizes.default_margin.width;
|
||||
x: model.depth * UM.Theme.getSize("default_margin").width;
|
||||
text: model.name;
|
||||
tooltip: model.description;
|
||||
visible: !model.global_only
|
||||
|
|
|
@ -21,7 +21,7 @@ UM.Dialog
|
|||
anchors.fill: parent;
|
||||
Row
|
||||
{
|
||||
spacing: UM.Theme.sizes.default_margin.width;
|
||||
spacing: UM.Theme.getSize("default_margin").width;
|
||||
Text
|
||||
{
|
||||
//: USB Printing dialog label, %1 is head temperature
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue