diff --git a/cura/ExtrudersModel.py b/cura/ExtrudersModel.py index e300a9d73f..7edbb8b7c5 100644 --- a/cura/ExtrudersModel.py +++ b/cura/ExtrudersModel.py @@ -18,8 +18,8 @@ class ExtrudersModel(UM.Qt.ListModel.ListModel): ## Human-readable name of the extruder. NameRole = Qt.UserRole + 2 - ## Color of the material loaded in the extruder. - ColorRole = Qt.UserRole + 3 + ## Colour of the material loaded in the extruder. + ColourRole = Qt.UserRole + 3 ## Index of the extruder, which is also the value of the setting itself. # @@ -28,9 +28,9 @@ class ExtrudersModel(UM.Qt.ListModel.ListModel): # containers. IndexRole = Qt.UserRole + 4 - ## List of colors to display if there is no material or the material has no known - # color. - defaultColors = ["#ffc924", "#86ec21", "#22eeee", "#245bff", "#9124ff", "#ff24c8"] + ## List of colours to display if there is no material or the material has no known + # colour. + defaultColours = ["#ffc924", "#86ec21", "#22eeee", "#245bff", "#9124ff", "#ff24c8"] ## Initialises the extruders model, defining the roles and listening for # changes in the data. @@ -41,7 +41,7 @@ class ExtrudersModel(UM.Qt.ListModel.ListModel): self.addRoleName(self.IdRole, "id") self.addRoleName(self.NameRole, "name") - self.addRoleName(self.ColorRole, "color") + self.addRoleName(self.ColourRole, "colour") self.addRoleName(self.IndexRole, "index") self._add_global = False @@ -99,11 +99,11 @@ class ExtrudersModel(UM.Qt.ListModel.ListModel): if self._add_global: material = global_container_stack.findContainer({ "type": "material" }) - color = material.getMetaDataEntry("color_code", default = self.defaultColors[0]) if material else self.defaultColors[0] + colour = material.getMetaDataEntry("color_code", default = self.defaultColours[0]) if material else self.defaultColours[0] item = { "id": global_container_stack.getId(), "name": "Global", - "color": color, + "colour": colour, "index": -1 } self.appendItem(item) @@ -118,12 +118,12 @@ class ExtrudersModel(UM.Qt.ListModel.ListModel): position = int(position) except ValueError: #Not a proper int. position = -1 - default_color = self.defaultColors[position] if position >= 0 and position < len(self.defaultColors) else defaultColors[0] - color = material.getMetaDataEntry("color_code", default = default_color) if material else default_color + default_colour = self.defaultColours[position] if position >= 0 and position < len(self.defaultColours) else defaultColours[0] + colour = material.getMetaDataEntry("color_code", default = default_colour) if material else default_colour item = { #Construct an item with only the relevant information. "id": extruder.getId(), "name": extruder_name, - "color": color, + "colour": colour, "index": position } self.appendItem(item) diff --git a/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml b/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml index 6c506b9404..aa4a749e92 100644 --- a/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml +++ b/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml @@ -78,7 +78,7 @@ Item { anchors.leftMargin: UM.Theme.getSize("default_lining").width anchors.verticalCenter: parent.verticalCenter - color: extruders_model.getItem(extruderSelector.currentIndex).color + color: extruders_model.getItem(extruderSelector.currentIndex).colour border.width: UM.Theme.getSize("default_lining").width border.color: !enabled ? UM.Theme.getColor("setting_control_disabled_border") : UM.Theme.getColor("setting_control_border") } diff --git a/plugins/SolidView/SolidView.py b/plugins/SolidView/SolidView.py index f69ac61a02..30b2105522 100644 --- a/plugins/SolidView/SolidView.py +++ b/plugins/SolidView/SolidView.py @@ -63,7 +63,7 @@ class SolidView(View): if extruder_id: extruder_index = max(0, self._extruders_model.find("id", extruder_id)) - extruder_color = self._extruders_model.getItem(extruder_index)["color"] + extruder_color = self._extruders_model.getItem(extruder_index)["colour"] try: # Colors are passed as rgb hex strings (eg "#ffffff"), and the shader needs # an rgba list of floats (eg [1.0, 1.0, 1.0, 1.0]) diff --git a/resources/qml/Settings/SettingExtruder.qml b/resources/qml/Settings/SettingExtruder.qml index 5c21b1f269..72c5299b15 100644 --- a/resources/qml/Settings/SettingExtruder.qml +++ b/resources/qml/Settings/SettingExtruder.qml @@ -64,7 +64,7 @@ SettingItem anchors.leftMargin: UM.Theme.getSize("default_lining").width anchors.verticalCenter: parent.verticalCenter - color: extruders_model.getItem(control.currentIndex).color + color: extruders_model.getItem(control.currentIndex).colour border.width: UM.Theme.getSize("default_lining").width border.color: !enabled ? UM.Theme.getColor("setting_control_disabled_border") : UM.Theme.getColor("setting_control_border") } diff --git a/resources/qml/SidebarHeader.qml b/resources/qml/SidebarHeader.qml index ceb4cec38b..a2304d1d3e 100644 --- a/resources/qml/SidebarHeader.qml +++ b/resources/qml/SidebarHeader.qml @@ -162,7 +162,7 @@ Column anchors.leftMargin: (parent.height - height) / 2 anchors.verticalCenter: parent.verticalCenter - color: model.color + color: model.colour border.width: UM.Theme.getSize("default_lining").width border.color: UM.Theme.getColor("toggle_checked") } diff --git a/resources/qml/SidebarSimple.qml b/resources/qml/SidebarSimple.qml index 26d552610d..6e6e28be3b 100644 --- a/resources/qml/SidebarSimple.qml +++ b/resources/qml/SidebarSimple.qml @@ -339,7 +339,7 @@ Item for(var extruderNr = 0; extruderNr < extruders.model.rowCount() ; extruderNr++) { extruderModel.append({ text: catalog.i18nc("@label", "Print using %1").arg(extruders.model.getItem(extruderNr).name), - color: extruders.model.getItem(extruderNr).color + color: extruders.model.getItem(extruderNr).colour }) } }