Merge branch 'ui_rework_4_0' of github.com:Ultimaker/Cura into CURA-6006-login-required

This commit is contained in:
Jaime van Kessel 2018-12-07 10:51:48 +01:00
commit ab8a2a9b2b
73 changed files with 3046 additions and 1215 deletions

View File

@ -63,7 +63,7 @@ class ExtruderManager(QObject):
if not self._application.getGlobalContainerStack(): if not self._application.getGlobalContainerStack():
return None # No active machine, so no active extruder. return None # No active machine, so no active extruder.
try: try:
return self._extruder_trains[self._application.getGlobalContainerStack().getId()][str(self._active_extruder_index)].getId() return self._extruder_trains[self._application.getGlobalContainerStack().getId()][str(self.activeExtruderIndex)].getId()
except KeyError: # Extruder index could be -1 if the global tab is selected, or the entry doesn't exist if the machine definition is wrong. except KeyError: # Extruder index could be -1 if the global tab is selected, or the entry doesn't exist if the machine definition is wrong.
return None return None
@ -144,7 +144,7 @@ class ExtruderManager(QObject):
@pyqtSlot(result = QObject) @pyqtSlot(result = QObject)
def getActiveExtruderStack(self) -> Optional["ExtruderStack"]: def getActiveExtruderStack(self) -> Optional["ExtruderStack"]:
return self.getExtruderStack(self._active_extruder_index) return self.getExtruderStack(self.activeExtruderIndex)
## Get an extruder stack by index ## Get an extruder stack by index
def getExtruderStack(self, index) -> Optional["ExtruderStack"]: def getExtruderStack(self, index) -> Optional["ExtruderStack"]:

View File

@ -52,8 +52,8 @@ class ExtruderStack(CuraContainerStack):
return super().getNextStack() return super().getNextStack()
def setEnabled(self, enabled: bool) -> None: def setEnabled(self, enabled: bool) -> None:
if "enabled" not in self._metadata: if self.getMetaDataEntry("enabled", True) == enabled: #No change.
self.setMetaDataEntry("enabled", "True") return #Don't emit a signal then.
self.setMetaDataEntry("enabled", str(enabled)) self.setMetaDataEntry("enabled", str(enabled))
self.enabledChanged.emit() self.enabledChanged.emit()

View File

@ -1,4 +1,4 @@
# Copyright (c) 2017 Ultimaker B.V. # Copyright (c) 2018 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher. # Cura is released under the terms of the LGPLv3 or higher.
from PyQt5.QtCore import Qt, pyqtSignal, pyqtSlot, pyqtProperty, QTimer from PyQt5.QtCore import Qt, pyqtSignal, pyqtSlot, pyqtProperty, QTimer
@ -165,7 +165,7 @@ class ExtrudersModel(UM.Qt.ListModel.ListModel):
def __updateExtruders(self): def __updateExtruders(self):
extruders_changed = False extruders_changed = False
if self.rowCount() != 0: if self.count != 0:
extruders_changed = True extruders_changed = True
items = [] items = []
@ -177,7 +177,7 @@ class ExtrudersModel(UM.Qt.ListModel.ListModel):
machine_extruder_count = global_container_stack.getProperty("machine_extruder_count", "value") machine_extruder_count = global_container_stack.getProperty("machine_extruder_count", "value")
for extruder in Application.getInstance().getExtruderManager().getActiveExtruderStacks(): for extruder in Application.getInstance().getExtruderManager().getActiveExtruderStacks():
position = extruder.getMetaDataEntry("position", default = "0") # Get the position position = extruder.getMetaDataEntry("position", default = "0")
try: try:
position = int(position) position = int(position)
except ValueError: except ValueError:

View File

@ -874,7 +874,7 @@ class MachineManager(QObject):
caution_message = Message(catalog.i18nc( caution_message = Message(catalog.i18nc(
"@info:generic", "@info:generic",
"Settings have been changed to match the current availability of extruders: [%s]" % ", ".join(add_user_changes)), "Settings have been changed to match the current availability of extruders: [%s]" % ", ".join(add_user_changes)),
lifetime=0, lifetime = 0,
title = catalog.i18nc("@info:title", "Settings updated")) title = catalog.i18nc("@info:title", "Settings updated"))
caution_message.show() caution_message.show()
@ -1553,7 +1553,7 @@ class MachineManager(QObject):
elif word.isdigit(): elif word.isdigit():
abbr_machine += word abbr_machine += word
else: else:
stripped_word = ''.join(char for char in unicodedata.normalize('NFD', word.upper()) if unicodedata.category(char) != 'Mn') stripped_word = "".join(char for char in unicodedata.normalize("NFD", word.upper()) if unicodedata.category(char) != "Mn")
# - use only the first character if the word is too long (> 3 characters) # - use only the first character if the word is too long (> 3 characters)
# - use the whole word if it's not too long (<= 3 characters) # - use the whole word if it's not too long (<= 3 characters)
if len(stripped_word) > 3: if len(stripped_word) > 3:

View File

@ -195,7 +195,7 @@ class ProcessSlicedLayersJob(Job):
if extruders: if extruders:
material_color_map = numpy.zeros((len(extruders), 4), dtype=numpy.float32) material_color_map = numpy.zeros((len(extruders), 4), dtype=numpy.float32)
for extruder in extruders: for extruder in extruders:
position = int(extruder.getMetaDataEntry("position", default="0")) # Get the position position = int(extruder.getMetaDataEntry("position", default = "0"))
try: try:
default_color = ExtrudersModel.defaultColors[position] default_color = ExtrudersModel.defaultColors[position]
except IndexError: except IndexError:

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016 Ultimaker B.V. // Copyright (c) 2018 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2 import QtQuick 2.2
@ -23,7 +23,7 @@ Cura.MachineAction
target: base.extrudersModel target: base.extrudersModel
onModelChanged: onModelChanged:
{ {
var extruderCount = base.extrudersModel.rowCount(); var extruderCount = base.extrudersModel.count;
base.extruderTabsCount = extruderCount; base.extruderTabsCount = extruderCount;
} }
} }

View File

@ -33,7 +33,6 @@ Button
{ {
width: UM.Theme.getSize("save_button_specs_icons").width; width: UM.Theme.getSize("save_button_specs_icons").width;
height: UM.Theme.getSize("save_button_specs_icons").height; height: UM.Theme.getSize("save_button_specs_icons").height;
sourceSize.width: width;
sourceSize.height: width; sourceSize.height: width;
color: control.hovered ? UM.Theme.getColor("text_scene_hover") : UM.Theme.getColor("text_scene"); color: control.hovered ? UM.Theme.getColor("text_scene_hover") : UM.Theme.getColor("text_scene");
source: "model_checker.svg" source: "model_checker.svg"

View File

@ -265,7 +265,6 @@ Item {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
width: parent.width width: parent.width
height: width height: width
sourceSize.width: width
sourceSize.height: width sourceSize.height: width
color: control.hovered ? UM.Theme.getColor("setting_control_button_hover") : UM.Theme.getColor("setting_control_button") color: control.hovered ? UM.Theme.getColor("setting_control_button_hover") : UM.Theme.getColor("setting_control_button")
source: UM.Theme.getIcon("minus") source: UM.Theme.getIcon("minus")

View File

@ -141,7 +141,6 @@ UM.Dialog
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
width: Math.round(control.width / 2.7) width: Math.round(control.width / 2.7)
height: Math.round(control.height / 2.7) height: Math.round(control.height / 2.7)
sourceSize.width: width
sourceSize.height: width sourceSize.height: width
color: palette.text color: palette.text
source: UM.Theme.getIcon("cross1") source: UM.Theme.getIcon("cross1")
@ -176,7 +175,6 @@ UM.Dialog
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
width: Math.round(control.width / 2.5) width: Math.round(control.width / 2.5)
height: Math.round(control.height / 2.5) height: Math.round(control.height / 2.5)
sourceSize.width: width
sourceSize.height: width sourceSize.height: width
color: control.enabled ? palette.text : disabledPalette.text color: control.enabled ? palette.text : disabledPalette.text
source: UM.Theme.getIcon("arrow_bottom") source: UM.Theme.getIcon("arrow_bottom")
@ -211,7 +209,6 @@ UM.Dialog
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
width: Math.round(control.width / 2.5) width: Math.round(control.width / 2.5)
height: Math.round(control.height / 2.5) height: Math.round(control.height / 2.5)
sourceSize.width: width
sourceSize.height: width sourceSize.height: width
color: control.enabled ? palette.text : disabledPalette.text color: control.enabled ? palette.text : disabledPalette.text
source: UM.Theme.getIcon("arrow_top") source: UM.Theme.getIcon("arrow_top")
@ -498,7 +495,6 @@ UM.Dialog
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
width: Math.round(parent.width / 2) width: Math.round(parent.width / 2)
height: Math.round(parent.height / 2) height: Math.round(parent.height / 2)
sourceSize.width: width
sourceSize.height: height sourceSize.height: height
color: !control.enabled ? UM.Theme.getColor("action_button_disabled_text") : color: !control.enabled ? UM.Theme.getColor("action_button_disabled_text") :
control.pressed ? UM.Theme.getColor("action_button_active_text") : control.pressed ? UM.Theme.getColor("action_button_active_text") :

View File

@ -61,7 +61,7 @@ Item
color: UM.Theme.getColor("lining") color: UM.Theme.getColor("lining")
} }
Cura.QuickConfigurationSelector Cura.ConfigurationMenu
{ {
Layout.fillHeight: true Layout.fillHeight: true
Layout.fillWidth: true Layout.fillWidth: true
@ -107,7 +107,6 @@ Item
height: UM.Theme.getSize("button_icon").height height: UM.Theme.getSize("button_icon").height
color: UM.Theme.getColor("toolbar_button_text") color: UM.Theme.getColor("toolbar_button_text")
sourceSize.width: width
sourceSize.height: height sourceSize.height: height
} }
} }

View File

@ -61,10 +61,9 @@ Item
iconSource: !is_simulation_playing ? "./resources/simulation_resume.svg": "./resources/simulation_pause.svg" iconSource: !is_simulation_playing ? "./resources/simulation_resume.svg": "./resources/simulation_pause.svg"
width: UM.Theme.getSize("small_button").width width: UM.Theme.getSize("small_button").width
height: UM.Theme.getSize("small_button").height height: UM.Theme.getSize("small_button").height
hoverBackgroundColor: UM.Theme.getColor("small_button_hover") hoverColor: UM.Theme.getColor("slider_handle_active")
hoverColor: UM.Theme.getColor("small_button_text_hover") color: UM.Theme.getColor("slider_handle")
color: UM.Theme.getColor("small_button_text") iconMargin: UM.Theme.getSize("thick_lining").width
iconMargin: 0.5 * UM.Theme.getSize("wide_lining").width
visible: !UM.SimulationView.compatibilityMode visible: !UM.SimulationView.compatibilityMode
Connections Connections

View File

@ -86,13 +86,13 @@ Item
Label Label
{ {
text: catalog.i18nc("@label", "Website") + ":" text: catalog.i18nc("@label", "Website") + ":"
font: UM.Theme.getFont("very_small") font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text_medium") color: UM.Theme.getColor("text_medium")
} }
Label Label
{ {
text: catalog.i18nc("@label", "Email") + ":" text: catalog.i18nc("@label", "Email") + ":"
font: UM.Theme.getFont("very_small") font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text_medium") color: UM.Theme.getColor("text_medium")
} }
} }
@ -118,7 +118,7 @@ Item
} }
return "" return ""
} }
font: UM.Theme.getFont("very_small") font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text") color: UM.Theme.getColor("text")
linkColor: UM.Theme.getColor("text_link") linkColor: UM.Theme.getColor("text_link")
onLinkActivated: Qt.openUrlExternally(link) onLinkActivated: Qt.openUrlExternally(link)
@ -134,7 +134,7 @@ Item
} }
return "" return ""
} }
font: UM.Theme.getFont("very_small") font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text") color: UM.Theme.getColor("text")
linkColor: UM.Theme.getColor("text_link") linkColor: UM.Theme.getColor("text_link")
onLinkActivated: Qt.openUrlExternally(link) onLinkActivated: Qt.openUrlExternally(link)

View File

@ -228,7 +228,7 @@ Item
return result return result
} }
font: UM.Theme.getFont("very_small") font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text") color: UM.Theme.getColor("text")
linkColor: UM.Theme.getColor("text_link") linkColor: UM.Theme.getColor("text_link")
onLinkActivated: Qt.openUrlExternally(link) onLinkActivated: Qt.openUrlExternally(link)

View File

@ -82,25 +82,25 @@ Item
Label Label
{ {
text: catalog.i18nc("@label", "Version") + ":" text: catalog.i18nc("@label", "Version") + ":"
font: UM.Theme.getFont("very_small") font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text_medium") color: UM.Theme.getColor("text_medium")
} }
Label Label
{ {
text: catalog.i18nc("@label", "Last updated") + ":" text: catalog.i18nc("@label", "Last updated") + ":"
font: UM.Theme.getFont("very_small") font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text_medium") color: UM.Theme.getColor("text_medium")
} }
Label Label
{ {
text: catalog.i18nc("@label", "Author") + ":" text: catalog.i18nc("@label", "Author") + ":"
font: UM.Theme.getFont("very_small") font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text_medium") color: UM.Theme.getColor("text_medium")
} }
Label Label
{ {
text: catalog.i18nc("@label", "Downloads") + ":" text: catalog.i18nc("@label", "Downloads") + ":"
font: UM.Theme.getFont("very_small") font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text_medium") color: UM.Theme.getColor("text_medium")
} }
} }
@ -119,7 +119,7 @@ Item
Label Label
{ {
text: details === null ? "" : (details.version || catalog.i18nc("@label", "Unknown")) text: details === null ? "" : (details.version || catalog.i18nc("@label", "Unknown"))
font: UM.Theme.getFont("very_small") font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text") color: UM.Theme.getColor("text")
} }
Label Label
@ -133,7 +133,7 @@ Item
var date = new Date(details.last_updated) var date = new Date(details.last_updated)
return date.toLocaleString(UM.Preferences.getValue("general/language")) return date.toLocaleString(UM.Preferences.getValue("general/language"))
} }
font: UM.Theme.getFont("very_small") font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text") color: UM.Theme.getColor("text")
} }
Label Label
@ -149,7 +149,7 @@ Item
return "<a href=\"" + details.website + "\">" + details.author_name + "</a>" return "<a href=\"" + details.website + "\">" + details.author_name + "</a>"
} }
} }
font: UM.Theme.getFont("very_small") font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text") color: UM.Theme.getColor("text")
linkColor: UM.Theme.getColor("text_link") linkColor: UM.Theme.getColor("text_link")
onLinkActivated: Qt.openUrlExternally(link) onLinkActivated: Qt.openUrlExternally(link)
@ -157,7 +157,7 @@ Item
Label Label
{ {
text: details === null ? "" : (details.download_count || catalog.i18nc("@label", "Unknown")) text: details === null ? "" : (details.download_count || catalog.i18nc("@label", "Unknown"))
font: UM.Theme.getFont("very_small") font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text") color: UM.Theme.getColor("text")
} }
} }

View File

@ -52,7 +52,6 @@ Item
bottom: parent.bottom bottom: parent.bottom
right: parent.right right: parent.right
} }
sourceSize.width: width
sourceSize.height: height sourceSize.height: height
visible: installedPackages != 0 visible: installedPackages != 0
color: (installedPackages == packageCount) ? UM.Theme.getColor("primary") : UM.Theme.getColor("border") color: (installedPackages == packageCount) ? UM.Theme.getColor("primary") : UM.Theme.getColor("border")
@ -83,7 +82,7 @@ Item
width: parent.width width: parent.width
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
color: UM.Theme.getColor("text_medium") color: UM.Theme.getColor("text_medium")
font: UM.Theme.getFont("very_small") font: UM.Theme.getFont("default")
} }
} }
} }

View File

@ -48,8 +48,6 @@ Rectangle
right: parent.right right: parent.right
bottomMargin: UM.Theme.getSize("default_lining").width bottomMargin: UM.Theme.getSize("default_lining").width
} }
sourceSize.width: width
sourceSize.height: height
visible: installedPackages != 0 visible: installedPackages != 0
color: (installedPackages == packageCount) ? UM.Theme.getColor("primary") : UM.Theme.getColor("border") color: (installedPackages == packageCount) ? UM.Theme.getColor("primary") : UM.Theme.getColor("border")
source: "../images/installed_check.svg" source: "../images/installed_check.svg"

View File

@ -64,6 +64,7 @@ Cura.MachineAction
width: parent.width width: parent.width
text: catalog.i18nc("@title:window", "Connect to Networked Printer") text: catalog.i18nc("@title:window", "Connect to Networked Printer")
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
renderType: Text.NativeRendering
font.pointSize: 18 font.pointSize: 18
} }
@ -72,6 +73,7 @@ Cura.MachineAction
id: pageDescription id: pageDescription
width: parent.width width: parent.width
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
renderType: Text.NativeRendering
text: catalog.i18nc("@label", "To print directly to your printer over the network, please make sure your printer is connected to the network using a network cable or by connecting your printer to your WIFI network. If you don't connect Cura with your printer, you can still use a USB drive to transfer g-code files to your printer.\n\nSelect your printer from the list below:") text: catalog.i18nc("@label", "To print directly to your printer over the network, please make sure your printer is connected to the network using a network cable or by connecting your printer to your WIFI network. If you don't connect Cura with your printer, you can still use a USB drive to transfer g-code files to your printer.\n\nSelect your printer from the list below:")
} }
@ -182,6 +184,7 @@ Cura.MachineAction
text: listview.model[index].name text: listview.model[index].name
color: parent.ListView.isCurrentItem ? palette.highlightedText : palette.text color: parent.ListView.isCurrentItem ? palette.highlightedText : palette.text
elide: Text.ElideRight elide: Text.ElideRight
renderType: Text.NativeRendering
} }
MouseArea MouseArea
@ -204,6 +207,7 @@ Cura.MachineAction
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
renderType: Text.NativeRendering
text: catalog.i18nc("@label", "If your printer is not listed, read the <a href='%1'>network printing troubleshooting guide</a>").arg("https://ultimaker.com/en/troubleshooting"); text: catalog.i18nc("@label", "If your printer is not listed, read the <a href='%1'>network printing troubleshooting guide</a>").arg("https://ultimaker.com/en/troubleshooting");
onLinkActivated: Qt.openUrlExternally(link) onLinkActivated: Qt.openUrlExternally(link)
} }
@ -221,6 +225,7 @@ Cura.MachineAction
text: base.selectedDevice ? base.selectedDevice.name : "" text: base.selectedDevice ? base.selectedDevice.name : ""
font: UM.Theme.getFont("large") font: UM.Theme.getFont("large")
elide: Text.ElideRight elide: Text.ElideRight
renderType: Text.NativeRendering
} }
Grid Grid
{ {
@ -231,12 +236,14 @@ Cura.MachineAction
{ {
width: Math.round(parent.width * 0.5) width: Math.round(parent.width * 0.5)
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
renderType: Text.NativeRendering
text: catalog.i18nc("@label", "Type") text: catalog.i18nc("@label", "Type")
} }
Label Label
{ {
width: Math.round(parent.width * 0.5) width: Math.round(parent.width * 0.5)
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
renderType: Text.NativeRendering
text: text:
{ {
if(base.selectedDevice) if(base.selectedDevice)
@ -268,24 +275,28 @@ Cura.MachineAction
{ {
width: Math.round(parent.width * 0.5) width: Math.round(parent.width * 0.5)
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
renderType: Text.NativeRendering
text: catalog.i18nc("@label", "Firmware version") text: catalog.i18nc("@label", "Firmware version")
} }
Label Label
{ {
width: Math.round(parent.width * 0.5) width: Math.round(parent.width * 0.5)
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
renderType: Text.NativeRendering
text: base.selectedDevice ? base.selectedDevice.firmwareVersion : "" text: base.selectedDevice ? base.selectedDevice.firmwareVersion : ""
} }
Label Label
{ {
width: Math.round(parent.width * 0.5) width: Math.round(parent.width * 0.5)
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
renderType: Text.NativeRendering
text: catalog.i18nc("@label", "Address") text: catalog.i18nc("@label", "Address")
} }
Label Label
{ {
width: Math.round(parent.width * 0.5) width: Math.round(parent.width * 0.5)
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
renderType: Text.NativeRendering
text: base.selectedDevice ? base.selectedDevice.ipAddress : "" text: base.selectedDevice ? base.selectedDevice.ipAddress : ""
} }
} }
@ -294,6 +305,7 @@ Cura.MachineAction
{ {
width: parent.width width: parent.width
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
renderType: Text.NativeRendering
text:{ text:{
// The property cluster size does not exist for older UM3 devices. // The property cluster size does not exist for older UM3 devices.
if(!base.selectedDevice || base.selectedDevice.clusterSize == null || base.selectedDevice.clusterSize == 1) if(!base.selectedDevice || base.selectedDevice.clusterSize == null || base.selectedDevice.clusterSize == 1)
@ -315,6 +327,7 @@ Cura.MachineAction
{ {
width: parent.width width: parent.width
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
renderType: Text.NativeRendering
visible: base.selectedDevice != null && !base.completeProperties visible: base.selectedDevice != null && !base.completeProperties
text: catalog.i18nc("@label", "The printer at this address has not yet responded." ) text: catalog.i18nc("@label", "The printer at this address has not yet responded." )
} }
@ -358,9 +371,10 @@ Cura.MachineAction
Label Label
{ {
text: catalog.i18nc("@alabel","Enter the IP address or hostname of your printer on the network.") text: catalog.i18nc("@alabel", "Enter the IP address or hostname of your printer on the network.")
width: parent.width width: parent.width
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
renderType: Text.NativeRendering
} }
TextField TextField

View File

@ -52,7 +52,7 @@ Item
id: buildplateLabel id: buildplateLabel
color: "#191919" // TODO: Theme! color: "#191919" // TODO: Theme!
elide: Text.ElideRight elide: Text.ElideRight
font: UM.Theme.getFont("very_small") // 12pt, regular font: UM.Theme.getFont("default") // 12pt, regular
text: "" text: ""
// FIXED-LINE-HEIGHT: // FIXED-LINE-HEIGHT:

View File

@ -49,7 +49,7 @@ Item
} }
color: "#191919" // TODO: Theme! color: "#191919" // TODO: Theme!
elide: Text.ElideRight elide: Text.ElideRight
font: UM.Theme.getFont("very_small") // 12pt, regular font: UM.Theme.getFont("default") // 12pt, regular
text: "" text: ""
// FIXED-LINE-HEIGHT: // FIXED-LINE-HEIGHT:
@ -66,7 +66,7 @@ Item
} }
color: "#191919" // TODO: Theme! color: "#191919" // TODO: Theme!
elide: Text.ElideRight elide: Text.ElideRight
font: UM.Theme.getFont("small") // 12pt, bold font: UM.Theme.getFont("default_bold") // 12pt, bold
text: "" text: ""
// FIXED-LINE-HEIGHT: // FIXED-LINE-HEIGHT:

View File

@ -179,13 +179,15 @@ Item
color: "#414054" // TODO: Theme! color: "#414054" // TODO: Theme!
font: UM.Theme.getFont("large") // 16pt, bold font: UM.Theme.getFont("large") // 16pt, bold
text: { text: {
if (printer && printer.state == "disabled"){ if (printer && printer.state == "disabled")
{
return catalog.i18nc("@label:status", "Unavailable") return catalog.i18nc("@label:status", "Unavailable")
} }
if (printer && printer.state == "unreachable"){ if (printer && printer.state == "unreachable")
return catalog.i18nc("@label:status", "Unavailable") {
return catalog.i18nc("@label:status", "Unreachable")
} }
if (printer && !printer.activePrintJob) if (printer && printer.state == "idle")
{ {
return catalog.i18nc("@label:status", "Idle") return catalog.i18nc("@label:status", "Idle")
} }

View File

@ -608,6 +608,16 @@ class ClusterUM3OutputDevice(NetworkedPrinterOutputDevice):
def _createMaterialOutputModel(self, material_data: Dict[str, Any]) -> "MaterialOutputModel": def _createMaterialOutputModel(self, material_data: Dict[str, Any]) -> "MaterialOutputModel":
material_manager = CuraApplication.getInstance().getMaterialManager() material_manager = CuraApplication.getInstance().getMaterialManager()
material_group_list = material_manager.getMaterialGroupListByGUID(material_data["guid"]) material_group_list = material_manager.getMaterialGroupListByGUID(material_data["guid"])
# This can happen if the connected machine has no material in one or more extruders (if GUID is empty), or the
# material is unknown to Cura, so we should return an "empty" or "unknown" material model.
if material_group_list is None:
material_name = "Empty" if len(material_data["guid"]) == 0 else "Unknown"
return MaterialOutputModel(guid = material_data["guid"],
type = material_data.get("type", ""),
color = material_data.get("color", ""),
brand = material_data.get("brand", ""),
name = material_data.get("name", material_name)
)
# Sort the material groups by "is_read_only = True" first, and then the name alphabetically. # Sort the material groups by "is_read_only = True" first, and then the name alphabetically.
read_only_material_group_list = list(filter(lambda x: x.is_read_only, material_group_list)) read_only_material_group_list = list(filter(lambda x: x.is_read_only, material_group_list))

View File

@ -7,14 +7,17 @@ import QtQuick.Controls 2.1
import QtGraphicalEffects 1.0 // For the dropshadow import QtGraphicalEffects 1.0 // For the dropshadow
import UM 1.1 as UM import UM 1.1 as UM
import Cura 1.0 as Cura
Button Button
{ {
id: button id: button
property alias iconSource: buttonIcon.source property alias iconSource: buttonIconLeft.source
property bool isIconOnRightSide: false
property alias textFont: buttonText.font property alias textFont: buttonText.font
property alias cornerRadius: backgroundRect.radius property alias cornerRadius: backgroundRect.radius
property alias tooltip: tooltip.text property alias tooltip: tooltip.text
property alias cornerSide: backgroundRect.cornerSide
property color color: UM.Theme.getColor("primary") property color color: UM.Theme.getColor("primary")
property color hoverColor: UM.Theme.getColor("primary_hover") property color hoverColor: UM.Theme.getColor("primary_hover")
@ -36,18 +39,21 @@ Button
// we elide the text to the right so the text will be cut off with the three dots at the end. // we elide the text to the right so the text will be cut off with the three dots at the end.
property var fixedWidthMode: false property var fixedWidthMode: false
leftPadding: UM.Theme.getSize("default_margin").width
rightPadding: UM.Theme.getSize("default_margin").width
height: UM.Theme.getSize("action_button").height
contentItem: Row contentItem: Row
{ {
//Left side icon. Only displayed if !isIconOnRightSide.
UM.RecolorImage UM.RecolorImage
{ {
id: buttonIcon id: buttonIconLeft
source: "" source: ""
height: Math.round(0.6 * parent.height) height: buttonText.height
width: height width: visible ? height : 0
sourceSize.width: width
sourceSize.height: height
color: button.hovered ? button.textHoverColor : button.textColor color: button.hovered ? button.textHoverColor : button.textColor
visible: source != "" visible: source != "" && !button.isIconOnRightSide
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
} }
@ -64,11 +70,24 @@ Button
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
elide: Text.ElideRight elide: Text.ElideRight
} }
//Right side icon. Only displayed if isIconOnRightSide.
UM.RecolorImage
{
id: buttonIconRight
source: buttonIconLeft.source
height: buttonText.height
width: visible ? height : 0
color: buttonIconLeft.color
visible: source != "" && button.isIconOnRightSide
anchors.verticalCenter: buttonIconLeft.verticalCenter
}
} }
background: Rectangle background: Cura.RoundedRectangle
{ {
id: backgroundRect id: backgroundRect
cornerSide: Cura.RoundedRectangle.Direction.All
color: button.enabled ? (button.hovered ? button.hoverColor : button.color) : button.disabledColor color: button.enabled ? (button.hovered ? button.hoverColor : button.color) : button.disabledColor
radius: UM.Theme.getSize("action_button_radius").width radius: UM.Theme.getSize("action_button_radius").width
border.width: UM.Theme.getSize("default_lining").width border.width: UM.Theme.getSize("default_lining").width

View File

@ -17,6 +17,7 @@ Item
id: saveToButton id: saveToButton
height: parent.height height: parent.height
fixedWidthMode: true fixedWidthMode: true
cornerSide: deviceSelectionMenu.visible ? Cura.RoundedRectangle.Direction.Left : Cura.RoundedRectangle.Direction.All
anchors anchors
{ {
@ -44,6 +45,7 @@ Item
shadowEnabled: true shadowEnabled: true
shadowColor: UM.Theme.getColor("primary_shadow") shadowColor: UM.Theme.getColor("primary_shadow")
cornerSide: Cura.RoundedRectangle.Direction.Right
anchors anchors
{ {
@ -51,6 +53,8 @@ Item
right: parent.right right: parent.right
} }
leftPadding: UM.Theme.getSize("narrow_margin").width //Need more space than usual here for wide text.
rightPadding: UM.Theme.getSize("narrow_margin").width
tooltip: catalog.i18nc("@info:tooltip", "Select the active output device") tooltip: catalog.i18nc("@info:tooltip", "Select the active output device")
iconSource: popup.opened ? UM.Theme.getIcon("arrow_top") : UM.Theme.getIcon("arrow_bottom") iconSource: popup.opened ? UM.Theme.getIcon("arrow_top") : UM.Theme.getIcon("arrow_bottom")
color: UM.Theme.getColor("action_panel_secondary") color: UM.Theme.getColor("action_panel_secondary")

View File

@ -51,7 +51,7 @@ Column
text: preSlicedData ? catalog.i18nc("@label", "No time estimation available") : PrintInformation.currentPrintTime.getDisplayString(UM.DurationFormat.Long) text: preSlicedData ? catalog.i18nc("@label", "No time estimation available") : PrintInformation.currentPrintTime.getDisplayString(UM.DurationFormat.Long)
source: UM.Theme.getIcon("clock") source: UM.Theme.getIcon("clock")
font: UM.Theme.getFont("small") font: UM.Theme.getFont("default_bold")
} }
Cura.IconLabel Cura.IconLabel
@ -84,7 +84,7 @@ Column
return totalWeights + "g · " + totalLengths.toFixed(2) + "m" return totalWeights + "g · " + totalLengths.toFixed(2) + "m"
} }
source: UM.Theme.getIcon("spool") source: UM.Theme.getIcon("spool")
font: UM.Theme.getFont("very_small") font: UM.Theme.getFont("default")
} }
} }
@ -101,17 +101,25 @@ Column
} }
} }
Row Item
{ {
id: buttonRow id: buttonRow
spacing: UM.Theme.getSize("default_margin").width anchors.right: parent.right
width: parent.width anchors.left: parent.left
height: UM.Theme.getSize("action_button").height
Cura.SecondaryButton Cura.SecondaryButton
{ {
id: previewStageShortcut id: previewStageShortcut
height: UM.Theme.getSize("action_panel_button").height anchors
{
left: parent.left
right: outputDevicesButton.left
rightMargin: UM.Theme.getSize("default_margin").width
}
height: UM.Theme.getSize("action_button").height
leftPadding: UM.Theme.getSize("default_margin").width leftPadding: UM.Theme.getSize("default_margin").width
rightPadding: UM.Theme.getSize("default_margin").width rightPadding: UM.Theme.getSize("default_margin").width
text: catalog.i18nc("@button", "Preview") text: catalog.i18nc("@button", "Preview")
@ -125,8 +133,11 @@ Column
Cura.OutputDevicesActionButton Cura.OutputDevicesActionButton
{ {
width: previewStageShortcut.visible ? UM.Theme.getSize("action_panel_button").width : parent.width id: outputDevicesButton
height: UM.Theme.getSize("action_panel_button").height
anchors.right: parent.right
width: previewStageShortcut.visible ? UM.Theme.getSize("action_button").width : parent.width
height: UM.Theme.getSize("action_button").height
} }
} }
} }

View File

@ -15,9 +15,6 @@ UM.RecolorImage
width: UM.Theme.getSize("section_icon").width width: UM.Theme.getSize("section_icon").width
height: UM.Theme.getSize("section_icon").height height: UM.Theme.getSize("section_icon").height
sourceSize.width: width
sourceSize.height: height
color: popup.opened ? UM.Theme.getColor("primary") : UM.Theme.getColor("text_medium") color: popup.opened ? UM.Theme.getColor("primary") : UM.Theme.getColor("text_medium")
MouseArea MouseArea

View File

@ -30,7 +30,7 @@ Column
{ {
text: catalog.i18nc("@label", "Time specification").toUpperCase() text: catalog.i18nc("@label", "Time specification").toUpperCase()
color: UM.Theme.getColor("primary") color: UM.Theme.getColor("primary")
font: UM.Theme.getFont("small") font: UM.Theme.getFont("default_bold")
renderType: Text.NativeRendering renderType: Text.NativeRendering
} }
@ -61,7 +61,7 @@ Column
} }
width: parent.width - 2 * UM.Theme.getSize("default_margin").width width: parent.width - 2 * UM.Theme.getSize("default_margin").width
color: UM.Theme.getColor("text") color: UM.Theme.getColor("text")
font: UM.Theme.getFont("very_small") font: UM.Theme.getFont("default")
renderType: Text.NativeRendering renderType: Text.NativeRendering
textFormat: Text.RichText textFormat: Text.RichText
} }
@ -79,7 +79,7 @@ Column
{ {
text: catalog.i18nc("@label", "Material specification").toUpperCase() text: catalog.i18nc("@label", "Material specification").toUpperCase()
color: UM.Theme.getColor("primary") color: UM.Theme.getColor("primary")
font: UM.Theme.getFont("small") font: UM.Theme.getFont("default_bold")
renderType: Text.NativeRendering renderType: Text.NativeRendering
} }
@ -151,7 +151,7 @@ Column
} }
width: parent.width - 2 * UM.Theme.getSize("default_margin").width width: parent.width - 2 * UM.Theme.getSize("default_margin").width
color: UM.Theme.getColor("text") color: UM.Theme.getColor("text")
font: UM.Theme.getFont("very_small") font: UM.Theme.getFont("default")
renderType: Text.NativeRendering renderType: Text.NativeRendering
textFormat: Text.RichText textFormat: Text.RichText
} }

View File

@ -48,7 +48,7 @@ Column
text: catalog.i18nc("@label:PrintjobStatus", "Auto slicing...") text: catalog.i18nc("@label:PrintjobStatus", "Auto slicing...")
color: UM.Theme.getColor("text") color: UM.Theme.getColor("text")
font: UM.Theme.getFont("very_small") font: UM.Theme.getFont("default")
renderType: Text.NativeRendering renderType: Text.NativeRendering
} }
@ -61,7 +61,7 @@ Column
text: catalog.i18nc("@label:PrintjobStatus", "Unable to Slice") text: catalog.i18nc("@label:PrintjobStatus", "Unable to Slice")
source: UM.Theme.getIcon("warning") source: UM.Theme.getIcon("warning")
color: UM.Theme.getColor("warning") color: UM.Theme.getColor("warning")
font: UM.Theme.getFont("very_small") font: UM.Theme.getFont("default")
} }
// Progress bar, only visible when the backend is in the process of slice the printjob // Progress bar, only visible when the backend is in the process of slice the printjob
@ -94,7 +94,6 @@ Column
} }
} }
Item Item
{ {
id: prepareButtons id: prepareButtons
@ -103,7 +102,7 @@ Column
// Disable the slice process when // Disable the slice process when
width: parent.width width: parent.width
height: UM.Theme.getSize("action_panel_button").height height: UM.Theme.getSize("action_button").height
visible: !autoSlice visible: !autoSlice
Cura.PrimaryButton Cura.PrimaryButton
{ {

View File

@ -88,6 +88,54 @@ UM.MainWindow
window: base window: base
} }
Rectangle
{
id: headerBackground
anchors
{
top: applicationMenu.bottom
left: parent.left
right: parent.right
}
height: stageMenu.source != "" ? Math.round(mainWindowHeader.height + stageMenu.height / 2) : mainWindowHeader.height
LinearGradient
{
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")
}
}
}
// This is the new fancy pattern
Image
{
id: backgroundPattern
anchors.fill: parent
fillMode: Image.Tile
source: UM.Theme.getImage("header_pattern")
horizontalAlignment: Image.AlignLeft
verticalAlignment: Image.AlignTop
}
}
MainWindowHeader MainWindowHeader
{ {
id: mainWindowHeader id: mainWindowHeader
@ -144,44 +192,6 @@ UM.MainWindow
} }
} }
Rectangle
{
id: stageMenuBackground
anchors
{
left: parent.left
right: parent.right
top: parent.top
}
visible: stageMenu.source != ""
height: visible ? Math.round(UM.Theme.getSize("stage_menu").height / 2) : 0
LinearGradient
{
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")
}
}
}
}
Connections Connections
{ {
target: stageMenu.item target: stageMenu.item
@ -257,7 +267,8 @@ UM.MainWindow
anchors anchors
{ {
top: stageMenuBackground.bottom // Align to the top of the stageMenu since the stageMenu may not exist
top: parent.top
left: parent.left left: parent.left
right: parent.right right: parent.right
bottom: parent.bottom bottom: parent.bottom

View File

@ -1,357 +0,0 @@
// Copyright (c) 2018 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.7
import QtQuick.Controls 1.1
import QtQuick.Controls.Styles 1.1
import UM 1.2 as UM
import Cura 1.0 as Cura
Rectangle
{
implicitWidth: parent.width
implicitHeight: parent.height
id: base
color: UM.Theme.getColor("main_background")
// Height has an extra 2x margin for the top & bottom margin.
height: childrenRect.height + 2 * UM.Theme.getSize("default_margin").width
Cura.ExtrudersModel { id: extrudersModel }
ListView
{
// Horizontal list that shows the extruders
id: extrudersList
visible: extrudersModel.items.length > 1
property var index: 0
height: UM.Theme.getSize("configuration_selector_mode_tabs").height
boundsBehavior: Flickable.StopAtBounds
anchors
{
left: parent.left
right: parent.right
top: parent.top
margins: UM.Theme.getSize("thick_margin").width
}
ExclusiveGroup { id: extruderMenuGroup }
orientation: ListView.Horizontal
model: extrudersModel
Connections
{
target: Cura.MachineManager
onGlobalContainerChanged: forceActiveFocus() // Changing focus applies the currently-being-typed values so it can change the displayed setting values.
}
delegate: Button
{
height: parent.height
width: Math.round(ListView.view.width / extrudersModel.rowCount())
text: model.name
tooltip: model.name
exclusiveGroup: extruderMenuGroup
checked: Cura.ExtruderManager.activeExtruderIndex == index
property bool extruder_enabled: true
MouseArea // TODO; This really should be fixed. It makes absolutely no sense to have a button AND a mouse area.
{
anchors.fill: parent
acceptedButtons: Qt.LeftButton | Qt.RightButton
onClicked:
{
switch (mouse.button)
{
case Qt.LeftButton:
extruder_enabled = Cura.MachineManager.getExtruder(model.index).isEnabled
if (extruder_enabled)
{
forceActiveFocus() // Changing focus applies the currently-being-typed values so it can change the displayed setting values.
Cura.ExtruderManager.setActiveExtruderIndex(index)
}
break
case Qt.RightButton:
extruder_enabled = Cura.MachineManager.getExtruder(model.index).isEnabled
extruderMenu.popup()
break
}
}
}
Menu
{
id: extruderMenu
MenuItem
{
text: catalog.i18nc("@action:inmenu", "Enable Extruder")
onTriggered: Cura.MachineManager.setExtruderEnabled(model.index, true)
visible: !extruder_enabled // using an intermediate variable prevents an empty popup that occured now and then
}
MenuItem
{
text: catalog.i18nc("@action:inmenu", "Disable Extruder")
onTriggered: Cura.MachineManager.setExtruderEnabled(model.index, false)
visible: extruder_enabled
enabled: Cura.MachineManager.numberExtrudersEnabled > 1
}
}
style: ButtonStyle
{
background: Rectangle
{
anchors.fill: parent
border.width: control.checked ? UM.Theme.getSize("default_lining").width * 2 : UM.Theme.getSize("default_lining").width
border.color:
{
if (Cura.MachineManager.getExtruder(index).isEnabled)
{
if(control.checked || control.pressed)
{
return UM.Theme.getColor("action_button_active_border")
}
else if (control.hovered)
{
return UM.Theme.getColor("action_button_hovered_border")
}
return UM.Theme.getColor("action_button_border")
}
return UM.Theme.getColor("action_button_disabled_border")
}
color:
{
if (Cura.MachineManager.getExtruder(index).isEnabled)
{
if(control.checked || control.pressed)
{
return UM.Theme.getColor("action_button_active");
}
else if (control.hovered)
{
return UM.Theme.getColor("action_button_hovered")
}
return UM.Theme.getColor("action_button")
}
return UM.Theme.getColor("action_button_disabled")
}
Behavior on color { ColorAnimation { duration: 50; } }
Item
{
id: extruderButtonFace
anchors.centerIn: parent
width: childrenRect.width
Label
{
// Static text that holds the "Extruder" label
id: extruderStaticText
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
color:
{
if (Cura.MachineManager.getExtruder(index).isEnabled)
{
if(control.checked || control.pressed)
{
return UM.Theme.getColor("action_button_active_text");
}
else if (control.hovered)
{
return UM.Theme.getColor("action_button_hovered_text")
}
return UM.Theme.getColor("action_button_text")
}
return UM.Theme.getColor("action_button_disabled_text")
}
font: UM.Theme.getFont("large_nonbold")
text: catalog.i18nc("@label", "Extruder")
visible: width < (control.width - extruderIcon.width - UM.Theme.getSize("default_margin").width)
elide: Text.ElideRight
}
ExtruderIcon
{
// Round icon with the extruder number and material color indicator.
id: extruderIcon
anchors.verticalCenter: parent.verticalCenter
anchors.left: extruderStaticText.right
anchors.leftMargin: UM.Theme.getSize("default_margin").width
width: control.height - Math.round(UM.Theme.getSize("default_margin").width / 2)
height: width
checked: control.checked
materialColor: model.color
textColor: extruderStaticText.color
}
}
}
label: Item {}
}
}
}
Item
{
id: materialRow
height: UM.Theme.getSize("print_setup_item").height
visible: Cura.MachineManager.hasMaterials
anchors
{
left: parent.left
right: parent.right
top: extrudersList.bottom
margins: UM.Theme.getSize("thick_margin").width
}
Label
{
id: materialLabel
text: catalog.i18nc("@label", "Material");
width: Math.round(parent.width * 0.45 - UM.Theme.getSize("default_margin").width)
height: parent.height
verticalAlignment: Text.AlignVCenter
font: UM.Theme.getFont("default");
color: UM.Theme.getColor("text");
}
ToolButton
{
id: materialSelection
property var activeExtruder: Cura.MachineManager.activeStack
property var hasActiveExtruder: activeExtruder != null
property var currentRootMaterialName: hasActiveExtruder ? activeExtruder.material.name : ""
text: currentRootMaterialName
tooltip: currentRootMaterialName
visible: Cura.MachineManager.hasMaterials
enabled: !extrudersList.visible || Cura.ExtruderManager.activeExtruderIndex > -1
height: UM.Theme.getSize("setting_control").height
width: Math.round(parent.width * 0.7) + UM.Theme.getSize("thick_margin").width
anchors.right: parent.right
style: UM.Theme.styles.sidebar_header_button
activeFocusOnPress: true;
menu: Cura.MaterialMenu
{
extruderIndex: Cura.ExtruderManager.activeExtruderIndex
}
property var valueError: hasActiveExtruder ? Cura.ContainerManager.getContainerMetaDataEntry(activeExtruder.material.id, "compatible", "") != "True" : true
property var valueWarning: ! Cura.MachineManager.isActiveQualitySupported
}
}
Item
{
id: variantRow
height: UM.Theme.getSize("print_setup_item").height
visible: Cura.MachineManager.hasVariants
anchors
{
left: parent.left
right: parent.right
top: materialRow.bottom
margins: UM.Theme.getSize("thick_margin").width
}
Label
{
id: variantLabel
text: Cura.MachineManager.activeDefinitionVariantsName;
width: Math.round(parent.width * 0.45 - UM.Theme.getSize("default_margin").width)
height: parent.height
verticalAlignment: Text.AlignVCenter
font: UM.Theme.getFont("default");
color: UM.Theme.getColor("text");
}
ToolButton
{
id: variantSelection
text: Cura.MachineManager.activeVariantName
tooltip: Cura.MachineManager.activeVariantName;
visible: Cura.MachineManager.hasVariants
height: UM.Theme.getSize("setting_control").height
width: Math.round(parent.width * 0.7 + UM.Theme.getSize("thick_margin").width)
anchors.right: parent.right
style: UM.Theme.styles.sidebar_header_button
activeFocusOnPress: true;
menu: Cura.NozzleMenu { extruderIndex: Cura.ExtruderManager.activeExtruderIndex }
}
}
Item
{
id: materialCompatibilityLink
height: UM.Theme.getSize("print_setup_item").height
anchors.right: parent.right
anchors.top: variantRow.bottom
anchors.margins: UM.Theme.getSize("thick_margin").width
UM.RecolorImage
{
id: warningImage
anchors.right: materialInfoLabel.left
anchors.rightMargin: UM.Theme.getSize("default_margin").width
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
}
Label
{
id: materialInfoLabel
wrapMode: Text.WordWrap
text: "<a href='%1'>" + catalog.i18nc("@label", "Check compatibility") + "</a>"
font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text")
linkColor: UM.Theme.getColor("text_link")
verticalAlignment: Text.AlignTop
anchors.right: parent.right
MouseArea
{
anchors.fill: parent
onClicked:
{
// open the material URL with web browser
Qt.openUrlExternally("https://ultimaker.com/incoming-links/cura/material-compatibilty");
}
}
}
}
}

View File

@ -35,12 +35,10 @@ UM.Dialog
{ {
id: logo id: logo
width: (base.minimumWidth * 0.85) | 0 width: (base.minimumWidth * 0.85) | 0
height: (width * (1/4.25)) | 0 height: (width * (UM.Theme.getSize("logo").height / UM.Theme.getSize("logo").width)) | 0
source: UM.Theme.getImage("logo") source: UM.Theme.getImage("logo_about")
sourceSize.width: width
sourceSize.height: height
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: ((base.minimumWidth - width) / 2) | 0 anchors.topMargin: ((base.minimumWidth - width) / 2) | 0
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter

View File

@ -1,4 +1,4 @@
// Copyright (c) 2017 Ultimaker B.V. // Copyright (c) 2018 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2 import QtQuick 2.2
@ -156,7 +156,6 @@ UM.Dialog
anchors.rightMargin: UM.Theme.getSize("default_margin").width anchors.rightMargin: UM.Theme.getSize("default_margin").width
width: UM.Theme.getSize("standard_arrow").width width: UM.Theme.getSize("standard_arrow").width
height: UM.Theme.getSize("standard_arrow").height height: UM.Theme.getSize("standard_arrow").height
sourceSize.width: width
sourceSize.height: width sourceSize.height: width
color: palette.windowText color: palette.windowText
source: base.activeCategory == section ? UM.Theme.getIcon("arrow_bottom") : UM.Theme.getIcon("arrow_right") source: base.activeCategory == section ? UM.Theme.getIcon("arrow_bottom") : UM.Theme.getIcon("arrow_right")
@ -170,7 +169,7 @@ UM.Dialog
if (machineList.model.getItem(machineList.currentIndex).section != section) if (machineList.model.getItem(machineList.currentIndex).section != section)
{ {
// Find the first machine from this section // Find the first machine from this section
for(var i = 0; i < machineList.model.rowCount(); i++) for(var i = 0; i < machineList.model.count; i++)
{ {
var item = machineList.model.getItem(i); var item = machineList.model.getItem(i);
if (item.section == section) if (item.section == section)

View File

@ -32,6 +32,8 @@ Item
property color headerBackgroundColor: UM.Theme.getColor("action_button") property color headerBackgroundColor: UM.Theme.getColor("action_button")
property color headerHoverColor: UM.Theme.getColor("action_button_hovered") property color headerHoverColor: UM.Theme.getColor("action_button_hovered")
property alias enabled: mouseArea.enabled
// Defines the alignment of the popup with respect of the headerItem, by default to the right // Defines the alignment of the popup with respect of the headerItem, by default to the right
property int popupAlignment: ExpandableComponent.PopupAlignment.AlignRight property int popupAlignment: ExpandableComponent.PopupAlignment.AlignRight
@ -139,9 +141,7 @@ Item
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
margins: background.padding margins: background.padding
} }
sourceSize.width: width visible: source != "" && base.enabled
sourceSize.height: height
visible: source != ""
width: height width: height
height: Math.round(0.2 * base.height) height: Math.round(0.2 * base.height)
color: UM.Theme.getColor("text") color: UM.Theme.getColor("text")

View File

@ -22,8 +22,6 @@ Item
id: mainIcon id: mainIcon
anchors.fill: parent anchors.fill: parent
sourceSize.width: parent.width
sourceSize.height: parent.height
source: UM.Theme.getIcon("extruder_button") source: UM.Theme.getIcon("extruder_button")
color: extruderEnabled ? materialColor: "gray" color: extruderEnabled ? materialColor: "gray"
} }
@ -50,7 +48,9 @@ Item
id: extruderNumberText id: extruderNumberText
anchors.centerIn: parent anchors.centerIn: parent
text: index + 1 text: index + 1
font: UM.Theme.getFont("extruder_icon") font: UM.Theme.getFont("very_small")
width: contentWidth
height: contentHeight
visible: extruderEnabled visible: extruderEnabled
renderType: Text.NativeRendering renderType: Text.NativeRendering
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
@ -62,7 +62,6 @@ Item
id: disabledIcon id: disabledIcon
anchors.fill: parent anchors.fill: parent
anchors.margins: UM.Theme.getSize("thick_lining").width anchors.margins: UM.Theme.getSize("thick_lining").width
sourceSize.width: width
sourceSize.height: width sourceSize.height: width
source: UM.Theme.getIcon("cross1") source: UM.Theme.getIcon("cross1")
visible: !extruderEnabled visible: !extruderEnabled

View File

@ -31,9 +31,6 @@ Item
width: UM.Theme.getSize("section_icon").width width: UM.Theme.getSize("section_icon").width
height: width height: width
sourceSize.width: width
sourceSize.height: height
color: label.color color: label.color
visible: source != "" visible: source != ""
} }
@ -48,7 +45,7 @@ Item
text: "Empty label" text: "Empty label"
elide: Text.ElideRight elide: Text.ElideRight
color: UM.Theme.getColor("text") color: UM.Theme.getColor("text")
font: UM.Theme.getFont("very_small") font: UM.Theme.getFont("default")
renderType: Text.NativeRendering renderType: Text.NativeRendering
} }
} }

View File

@ -37,8 +37,6 @@ Item
width: UM.Theme.getSize("section_icon").width width: UM.Theme.getSize("section_icon").width
height: UM.Theme.getSize("section_icon").height height: UM.Theme.getSize("section_icon").height
sourceSize.width: width
sourceSize.height: height
color: "black" color: "black"
anchors anchors

View File

@ -60,7 +60,6 @@ Item {
{ {
width: UM.Theme.getSize("save_button_specs_icons").width; width: UM.Theme.getSize("save_button_specs_icons").width;
height: UM.Theme.getSize("save_button_specs_icons").height; height: UM.Theme.getSize("save_button_specs_icons").height;
sourceSize.width: width;
sourceSize.height: width; sourceSize.height: width;
color: control.hovered ? UM.Theme.getColor("text_scene_hover") : UM.Theme.getColor("text_scene"); color: control.hovered ? UM.Theme.getColor("text_scene_hover") : UM.Theme.getColor("text_scene");
source: UM.Theme.getIcon("pencil"); source: UM.Theme.getIcon("pencil");
@ -124,7 +123,7 @@ Item {
} }
height: UM.Theme.getSize("jobspecs_line").height height: UM.Theme.getSize("jobspecs_line").height
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
font: UM.Theme.getFont("small") font: UM.Theme.getFont("default_bold")
color: UM.Theme.getColor("text_scene") color: UM.Theme.getColor("text_scene")
text: CuraApplication.getSceneBoundingBoxString text: CuraApplication.getSceneBoundingBoxString
} }

View File

@ -12,38 +12,13 @@ import QtGraphicalEffects 1.0
import "../Account" import "../Account"
Rectangle Item
{ {
id: base id: base
implicitHeight: UM.Theme.getSize("main_window_header").height implicitHeight: UM.Theme.getSize("main_window_header").height
implicitWidth: UM.Theme.getSize("main_window_header").width implicitWidth: UM.Theme.getSize("main_window_header").width
LinearGradient
{
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")
}
}
}
Image Image
{ {
id: logo id: logo
@ -54,9 +29,6 @@ Rectangle
source: UM.Theme.getImage("logo") source: UM.Theme.getImage("logo")
width: UM.Theme.getSize("logo").width width: UM.Theme.getSize("logo").width
height: UM.Theme.getSize("logo").height height: UM.Theme.getSize("logo").height
sourceSize.width: width
sourceSize.height: height
} }
Row Row

View File

@ -0,0 +1,39 @@
// Copyright (c) 2018 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.7
import QtQuick.Controls 2.0
import UM 1.3 as UM
import Cura 1.0 as Cura
Item
{
width: parent.width
height: childrenRect.height
Label
{
id: header
text: catalog.i18nc("@header", "Configurations")
font: UM.Theme.getFont("large")
color: UM.Theme.getColor("text")
height: contentHeight
renderType: Text.NativeRendering
anchors
{
left: parent.left
right: parent.right
}
}
ConfigurationListView
{
anchors.top: header.bottom
anchors.topMargin: UM.Theme.getSize("default_margin").width
width: parent.width
outputDevice: Cura.MachineManager.printerOutputDevices.length >= 1 ? Cura.MachineManager.printerOutputDevices[0] : null
}
}

View File

@ -7,143 +7,129 @@ import QtQuick.Controls 2.0
import UM 1.2 as UM import UM 1.2 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
Rectangle Button
{ {
id: configurationItem id: configurationItem
property var configuration: null property var configuration: null
property var selected: false hoverEnabled: true
signal activateConfiguration()
height: childrenRect.height height: background.height
border.width: UM.Theme.getSize("default_lining").width
border.color: updateBorderColor()
color: selected ? UM.Theme.getColor("configuration_item_active") : UM.Theme.getColor("configuration_item")
property var textColor: selected ? UM.Theme.getColor("configuration_item_text_active") : UM.Theme.getColor("configuration_item_text")
function updateBorderColor() background: Rectangle
{ {
border.color = selected ? UM.Theme.getColor("configuration_item_border_active") : UM.Theme.getColor("configuration_item_border") height: childrenRect.height
} color: parent.hovered ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("action_button")
border.color: (parent.checked || parent.hovered) ? UM.Theme.getColor("primary") : UM.Theme.getColor("lining")
border.width: parent.checked ? UM.Theme.getSize("thick_lining").width : UM.Theme.getSize("default_lining").width
radius: UM.Theme.getSize("default_radius").width
Column Column
{
id: contentColumn
width: parent.width
padding: UM.Theme.getSize("default_margin").width
spacing: Math.round(UM.Theme.getSize("default_margin").height / 2)
Row
{ {
id: extruderRow id: contentColumn
width: parent.width
padding: UM.Theme.getSize("wide_margin").width
spacing: Math.round(UM.Theme.getSize("default_margin").height / 2)
width: parent.width - 2 * parent.padding Row
height: childrenRect.height
spacing: UM.Theme.getSize("default_margin").width
Repeater
{ {
id: repeater id: extruderRow
height: childrenRect.height
model: configuration.extruderConfigurations anchors
delegate: PrintCoreConfiguration
{ {
width: Math.round(parent.width / 2) left: parent.left
printCoreConfiguration: modelData leftMargin: parent.padding
mainColor: textColor right: parent.right
rightMargin: parent.padding
}
height: childrenRect.height
spacing: UM.Theme.getSize("default_margin").width
Repeater
{
id: repeater
height: childrenRect.height
model: configuration.extruderConfigurations
delegate: PrintCoreConfiguration
{
width: Math.round(parent.width / 2)
printCoreConfiguration: modelData
}
}
}
//Buildplate row separator
Rectangle
{
id: separator
visible: buildplateInformation.visible
anchors
{
left: parent.left
leftMargin: parent.padding
right: parent.right
rightMargin: parent.padding
}
height: visible ? Math.round(UM.Theme.getSize("thick_lining").height / 2) : 0
color: UM.Theme.getColor("text")
}
Item
{
id: buildplateInformation
anchors
{
left: parent.left
leftMargin: parent.padding
right: parent.right
rightMargin: parent.padding
}
height: childrenRect.height
visible: configuration.buildplateConfiguration != ""
UM.RecolorImage
{
id: buildplateIcon
anchors.left: parent.left
width: UM.Theme.getSize("main_window_header_button_icon").width
height: UM.Theme.getSize("main_window_header_button_icon").height
source: UM.Theme.getIcon("buildplate")
color: UM.Theme.getColor("text")
}
Label
{
id: buildplateLabel
anchors.left: buildplateIcon.right
anchors.verticalCenter: buildplateIcon.verticalCenter
anchors.leftMargin: Math.round(UM.Theme.getSize("default_margin").height / 2)
text: configuration.buildplateConfiguration
renderType: Text.NativeRendering
color: UM.Theme.getColor("text")
} }
} }
} }
//Buildplate row separator Connections
Rectangle
{ {
id: separator target: Cura.MachineManager
onCurrentConfigurationChanged:
visible: buildplateInformation.visible
width: parent.width - 2 * parent.padding
height: visible ? Math.round(UM.Theme.getSize("thick_lining").height / 2) : 0
color: textColor
}
Item
{
id: buildplateInformation
width: parent.width - 2 * parent.padding
height: childrenRect.height
visible: configuration.buildplateConfiguration != ""
UM.RecolorImage {
id: buildplateIcon
anchors.left: parent.left
width: UM.Theme.getSize("main_window_header_button_icon").width
height: UM.Theme.getSize("main_window_header_button_icon").height
sourceSize.width: width
sourceSize.height: height
source: UM.Theme.getIcon("buildplate")
color: textColor
}
Label
{ {
id: buildplateLabel configurationItem.checked = Cura.MachineManager.matchesConfiguration(configuration)
anchors.left: buildplateIcon.right
anchors.verticalCenter: buildplateIcon.verticalCenter
anchors.leftMargin: Math.round(UM.Theme.getSize("default_margin").height / 2)
text: configuration.buildplateConfiguration
renderType: Text.NativeRendering
color: textColor
} }
} }
}
MouseArea Component.onCompleted:
{
id: mouse
anchors.fill: parent
onClicked: activateConfiguration()
cursorShape: Qt.PointingHandCursor
hoverEnabled: true
onEntered:
{ {
parent.border.color = UM.Theme.getColor("configuration_item_border_hover") configurationItem.checked = Cura.MachineManager.matchesConfiguration(configuration)
if (configurationItem.selected == false)
{
configurationItem.color = UM.Theme.getColor("wide_lining")
}
}
onExited:
{
updateBorderColor()
if (configurationItem.selected == false)
{
configurationItem.color = UM.Theme.getColor("configuration_item")
}
} }
} }
Connections onClicked:
{ {
target: Cura.MachineManager Cura.MachineManager.applyRemoteConfiguration(configuration)
onCurrentConfigurationChanged: {
configurationItem.selected = Cura.MachineManager.matchesConfiguration(configuration)
updateBorderColor()
}
}
Component.onCompleted:
{
configurationItem.selected = Cura.MachineManager.matchesConfiguration(configuration)
updateBorderColor()
}
onVisibleChanged:
{
if(visible)
{
// I cannot trigger function updateBorderColor() after visibility change
color = selected ? UM.Theme.getColor("configuration_item_active") : UM.Theme.getColor("configuration_item")
}
} }
} }

View File

@ -2,8 +2,7 @@
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 1.4 import QtQuick.Controls 2.3
import QtQuick.Controls.Styles 1.4
import UM 1.2 as UM import UM 1.2 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
@ -12,9 +11,7 @@ Column
{ {
id: base id: base
property var outputDevice: null property var outputDevice: null
property var computedHeight: container.height + configurationListHeading.height + 3 * padding
height: childrenRect.height + 2 * padding height: childrenRect.height + 2 * padding
padding: UM.Theme.getSize("default_margin").width
spacing: Math.round(UM.Theme.getSize("default_margin").height / 2) spacing: Math.round(UM.Theme.getSize("default_margin").height / 2)
function forceModelUpdate() function forceModelUpdate()
@ -27,60 +24,60 @@ Column
} }
} }
Label
{
id: configurationListHeading
text: catalog.i18nc("@label:header configurations", "Available configurations")
font: UM.Theme.getFont("large")
width: parent.width - 2 * parent.padding
color: UM.Theme.getColor("configuration_item_text")
}
Component
{
id: sectionHeading
Rectangle
{
height: childrenRect.height + UM.Theme.getSize("default_margin").height
Label
{
text: section
font: UM.Theme.getFont("default_bold")
color: UM.Theme.getColor("configuration_item_text")
}
}
}
ScrollView ScrollView
{ {
id: container id: container
width: parent.width - parent.padding width: parent.width
height: Math.min(configurationList.contentHeight, 350 * screenScaleFactor) readonly property int maximumHeight: 350 * screenScaleFactor
height: Math.round(Math.min(configurationList.height, maximumHeight))
contentHeight: configurationList.height
clip: true
style: UM.Theme.styles.scrollview ScrollBar.vertical.policy: (configurationList.height > maximumHeight) ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff //The AsNeeded policy also hides it when the cursor is away, and we don't want that.
__wheelAreaScrollSpeed: 75 // Scroll three lines in one scroll event ScrollBar.vertical.background: Rectangle
{
implicitWidth: UM.Theme.getSize("scrollbar").width
radius: width / 2
color: UM.Theme.getColor("scrollbar_background")
}
ScrollBar.vertical.contentItem: Rectangle
{
implicitWidth: UM.Theme.getSize("scrollbar").width
radius: width / 2
color: UM.Theme.getColor(parent.pressed ? "scrollbar_handle_down" : parent.hovered ? "scrollbar_handle_hover" : "scrollbar_handle")
}
ButtonGroup
{
buttons: configurationList.children
}
ListView ListView
{ {
id: configurationList id: configurationList
spacing: Math.round(UM.Theme.getSize("default_margin").height / 2) spacing: Math.round(UM.Theme.getSize("default_margin").height / 2)
width: container.width width: container.width - ((height > container.maximumHeight) ? container.ScrollBar.vertical.background.width : 0) //Make room for scroll bar if there is any.
contentHeight: childrenRect.height contentHeight: childrenRect.height
height: childrenRect.height
section.property: "modelData.printerType" section.property: "modelData.printerType"
section.criteria: ViewSection.FullString section.criteria: ViewSection.FullString
section.delegate: sectionHeading section.delegate: Item
{
height: printerTypeLabel.height + UM.Theme.getSize("default_margin").height
Cura.PrinterTypeLabel
{
id: printerTypeLabel
text: Cura.MachineManager.getAbbreviatedMachineName(section)
}
}
model: (outputDevice != null) ? outputDevice.uniqueConfigurations : [] model: (outputDevice != null) ? outputDevice.uniqueConfigurations : []
delegate: ConfigurationItem delegate: ConfigurationItem
{ {
width: parent.width - UM.Theme.getSize("default_margin").width width: parent.width
configuration: modelData configuration: modelData
onActivateConfiguration:
{
switchPopupState()
Cura.MachineManager.applyRemoteConfiguration(configuration)
}
} }
} }
} }

View File

@ -0,0 +1,203 @@
// Copyright (c) 2018 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.Controls.Styles 1.4
import UM 1.2 as UM
import Cura 1.0 as Cura
/**
* Menu that allows you to select the configuration of the current printer, such
* as the nozzle sizes and materials in each extruder.
*/
Cura.ExpandableComponent
{
id: base
Cura.ExtrudersModel
{
id: extrudersModel
}
UM.I18nCatalog
{
id: catalog
name: "cura"
}
enum ConfigurationMethod
{
AUTO,
CUSTOM
}
iconSource: expanded ? UM.Theme.getIcon("arrow_bottom") : UM.Theme.getIcon("arrow_left")
headerItem: Item
{
// Horizontal list that shows the extruders
ListView
{
id: extrudersList
orientation: ListView.Horizontal
anchors.fill: parent
model: extrudersModel
visible: base.enabled
delegate: Item
{
height: parent.height
width: Math.round(ListView.view.width / extrudersModel.count)
// Extruder icon. Shows extruder index and has the same color as the active material.
Cura.ExtruderIcon
{
id: extruderIcon
materialColor: model.color
extruderEnabled: model.enabled
height: parent.height
width: height
}
// Label for the brand of the material
Label
{
id: brandNameLabel
text: model.material_brand
elide: Text.ElideRight
font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text_inactive")
renderType: Text.NativeRendering
anchors
{
left: extruderIcon.right
leftMargin: UM.Theme.getSize("default_margin").width
right: parent.right
rightMargin: UM.Theme.getSize("default_margin").width
}
}
// Label that shows the name of the material
Label
{
text: model.material
elide: Text.ElideRight
font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text")
renderType: Text.NativeRendering
anchors
{
left: extruderIcon.right
leftMargin: UM.Theme.getSize("default_margin").width
right: parent.right
rightMargin: UM.Theme.getSize("default_margin").width
top: brandNameLabel.bottom
}
}
}
}
}
//Disable the menu if there are no materials, variants or build plates to change.
function updateEnabled()
{
var active_definition_id = Cura.MachineManager.activeMachine.definition.id;
var has_materials = Cura.ContainerManager.getContainerMetaDataEntry(active_definition_id, "has_materials");
var has_variants = Cura.ContainerManager.getContainerMetaDataEntry(active_definition_id, "has_variants");
var has_buildplates = Cura.ContainerManager.getContainerMetaDataEntry(active_definition_id, "has_variant_buildplates");
base.enabled = has_materials || has_variants || has_buildplates; //Only let it drop down if there is any configuration that you could change.
}
Connections
{
target: Cura.MachineManager
onGlobalContainerChanged: base.updateEnabled();
}
Component.onCompleted: updateEnabled();
popupItem: Column
{
id: popupItem
width: base.width - 2 * UM.Theme.getSize("default_margin").width
height: implicitHeight //Required because ExpandableComponent will try to use this to determine the size of the background of the pop-up.
spacing: UM.Theme.getSize("default_margin").height
property bool is_connected: false //If current machine is connected to a printer. Only evaluated upon making popup visible.
onVisibleChanged:
{
is_connected = Cura.MachineManager.activeMachineNetworkKey !== "" && Cura.MachineManager.printerConnected //Re-evaluate.
}
property int configuration_method: is_connected ? ConfigurationMenu.ConfigurationMethod.AUTO : ConfigurationMenu.ConfigurationMethod.CUSTOM //Auto if connected to a printer at start-up, or Custom if not.
Item
{
width: parent.width
height: childrenRect.height
AutoConfiguration
{
id: autoConfiguration
visible: popupItem.configuration_method == ConfigurationMenu.ConfigurationMethod.AUTO
}
CustomConfiguration
{
id: customConfiguration
visible: popupItem.configuration_method == ConfigurationMenu.ConfigurationMethod.CUSTOM
}
}
Rectangle
{
id: separator
visible: buttonBar.visible
x: -popupPadding
width: base.width
height: UM.Theme.getSize("default_lining").height
color: UM.Theme.getColor("lining")
}
//Allow switching between custom and auto.
Item
{
id: buttonBar
visible: popupItem.is_connected //Switching only makes sense if the "auto" part is possible.
width: parent.width
height: childrenRect.height
Cura.SecondaryButton
{
id: goToCustom
visible: popupItem.configuration_method == ConfigurationMenu.ConfigurationMethod.AUTO
text: catalog.i18nc("@label", "Custom")
anchors.right: parent.right
iconSource: UM.Theme.getIcon("arrow_right")
isIconOnRightSide: true
onClicked: popupItem.configuration_method = ConfigurationMenu.ConfigurationMethod.CUSTOM
}
Cura.SecondaryButton
{
id: goToAuto
visible: popupItem.configuration_method == ConfigurationMenu.ConfigurationMethod.CUSTOM
text: catalog.i18nc("@label", "Configurations")
iconSource: UM.Theme.getIcon("arrow_left")
onClicked: popupItem.configuration_method = ConfigurationMenu.ConfigurationMethod.AUTO
}
}
}
}

View File

@ -0,0 +1,250 @@
// Copyright (c) 2018 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.6
import QtQuick.Controls 2.0
import QtQuick.Controls 1.1 as OldControls
import Cura 1.0 as Cura
import UM 1.3 as UM
Item
{
UM.I18nCatalog
{
id: catalog
name: "cura"
}
width: parent.width
height: childrenRect.height
Label
{
id: header
text: catalog.i18nc("@header", "Custom")
font: UM.Theme.getFont("large")
color: UM.Theme.getColor("text")
height: contentHeight
renderType: Text.NativeRendering
anchors
{
top: parent.top
left: parent.left
right: parent.right
}
}
UM.TabRow
{
id: tabBar
anchors.top: header.bottom
anchors.topMargin: UM.Theme.getSize("default_margin").height
visible: extrudersModel.count > 1
Repeater
{
id: repeater
model: extrudersModel
delegate: UM.TabRowButton
{
contentItem: Item
{
Cura.ExtruderIcon
{
anchors.horizontalCenter: parent.horizontalCenter
materialColor: model.color
extruderEnabled: model.enabled
width: parent.height
height: parent.height
}
}
onClicked:
{
Cura.ExtruderManager.setActiveExtruderIndex(tabBar.currentIndex)
}
}
}
//When active extruder changes for some other reason, switch tabs.
//Don't directly link currentIndex to Cura.ExtruderManager.activeExtruderIndex!
//This causes a segfault in Qt 5.11. Something with VisualItemModel removing index -1. We have to use setCurrentIndex instead.
Connections
{
target: Cura.ExtruderManager
onActiveExtruderChanged:
{
tabBar.setCurrentIndex(Cura.ExtruderManager.activeExtruderIndex);
}
}
//When the model of the extruders is rebuilt, the list of extruders is briefly emptied and rebuilt.
//This causes the currentIndex of the tab to be in an invalid position which resets it to 0.
//Therefore we need to change it back to what it was: The active extruder index.
Connections
{
target: repeater.model
onModelChanged:
{
tabBar.setCurrentIndex(Cura.ExtruderManager.activeExtruderIndex)
}
}
}
Rectangle
{
width: parent.width
height: childrenRect.height
anchors.top: tabBar.bottom
radius: tabBar.visible ? UM.Theme.getSize("default_radius").width : 0
border.width: tabBar.visible ? UM.Theme.getSize("default_lining").width : 0
border.color: UM.Theme.getColor("lining")
color: UM.Theme.getColor("main_background")
//Remove rounding and lining at the top.
Rectangle
{
width: parent.width
height: parent.radius
anchors.top: parent.top
color: UM.Theme.getColor("lining")
visible: tabBar.visible
Rectangle
{
anchors
{
left: parent.left
leftMargin: parent.parent.border.width
right: parent.right
rightMargin: parent.parent.border.width
top: parent.top
}
height: parent.parent.radius
color: parent.parent.color
}
}
Column
{
id: selectors
padding: UM.Theme.getSize("default_margin").width
spacing: UM.Theme.getSize("default_margin").height
property var model: extrudersModel.items[tabBar.currentIndex]
readonly property real paddedWidth: parent.width - padding * 2
property real textWidth: Math.round(paddedWidth * 0.3)
property real controlWidth: paddedWidth - textWidth
Row
{
height: UM.Theme.getSize("print_setup_item").height
Label
{
text: catalog.i18nc("@label", "Enabled")
verticalAlignment: Text.AlignVCenter
font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text")
height: parent.height
width: selectors.textWidth
visible: extrudersModel.count > 1
renderType: Text.NativeRendering
}
OldControls.CheckBox
{
checked: Cura.MachineManager.activeStack != null ? Cura.MachineManager.activeStack.isEnabled : false
enabled: !checked || Cura.MachineManager.numberExtrudersEnabled > 1 //Disable if it's the last enabled extruder.
height: UM.Theme.getSize("setting_control").height
style: UM.Theme.styles.checkbox
visible: extrudersModel.count > 1
/* Use a MouseArea to process the click on this checkbox.
This is necessary because actually clicking the checkbox
causes the "checked" property to be overwritten. After
it's been overwritten, the original link that made it
depend on the active extruder stack is broken. */
MouseArea
{
anchors.fill: parent
onClicked: Cura.MachineManager.setExtruderEnabled(Cura.ExtruderManager.activeExtruderIndex, !parent.checked)
enabled: parent.enabled
}
}
}
Row
{
height: UM.Theme.getSize("print_setup_item").height
Label
{
text: catalog.i18nc("@label", "Material")
verticalAlignment: Text.AlignVCenter
font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text")
height: parent.height
width: selectors.textWidth
visible: materialSelection.visible
renderType: Text.NativeRendering
}
OldControls.ToolButton
{
id: materialSelection
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 : ""
tooltip: text
visible: Cura.MachineManager.hasMaterials
height: UM.Theme.getSize("setting_control").height
width: selectors.controlWidth
style: UM.Theme.styles.sidebar_header_button
activeFocusOnPress: true
menu: Cura.MaterialMenu
{
extruderIndex: Cura.ExtruderManager.activeExtruderIndex
}
}
}
Row
{
height: UM.Theme.getSize("print_setup_item").height
Label
{
text: Cura.MachineManager.activeDefinitionVariantsName
verticalAlignment: Text.AlignVCenter
font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text")
height: parent.height
width: selectors.textWidth
visible: variantSelection.visible
renderType: Text.NativeRendering
}
OldControls.ToolButton
{
id: variantSelection
text: Cura.MachineManager.activeVariantName
tooltip: Cura.MachineManager.activeVariantName;
visible: Cura.MachineManager.hasVariants
height: UM.Theme.getSize("setting_control").height
width: selectors.controlWidth
style: UM.Theme.styles.sidebar_header_button
activeFocusOnPress: true;
menu: Cura.NozzleMenu { extruderIndex: Cura.ExtruderManager.activeExtruderIndex }
}
}
}
}
}

View File

@ -5,87 +5,50 @@ import QtQuick 2.7
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
import UM 1.2 as UM import UM 1.2 as UM
import Cura 1.0 as Cura
Row
Column
{ {
id: extruderInfo id: extruderInfo
property var printCoreConfiguration property var printCoreConfiguration
property var mainColor: "black"
spacing: Math.round(UM.Theme.getSize("default_margin").height / 2)
height: childrenRect.height height: information.height
spacing: UM.Theme.getSize("default_margin").width
Item //Extruder icon.
Cura.ExtruderIcon
{ {
id: extruder materialColor: printCoreConfiguration.material.color
width: parent.width anchors.verticalCenter: parent.verticalCenter
height: childrenRect.height extruderEnabled: printCoreConfiguration.material.name !== "" && printCoreConfiguration.hotendID !== ""
}
Column
{
id: information
Label Label
{ {
id: extruderLabel text: printCoreConfiguration.material.brand ? printCoreConfiguration.material.brand : " " //Use space so that the height is still correct.
text: catalog.i18nc("@label:extruder label", "Extruder")
renderType: Text.NativeRendering renderType: Text.NativeRendering
elide: Text.ElideRight elide: Text.ElideRight
anchors.left: parent.left
font: UM.Theme.getFont("default") font: UM.Theme.getFont("default")
color: mainColor color: UM.Theme.getColor("text_inactive")
} }
Label
// Rounded item to show the extruder number
Item
{ {
id: extruderIconItem text: printCoreConfiguration.material.name ? printCoreConfiguration.material.name : " " //Use space so that the height is still correct.
anchors.verticalCenter: extruderLabel.verticalCenter renderType: Text.NativeRendering
anchors.left: extruderLabel.right elide: Text.ElideRight
anchors.leftMargin: Math.round(UM.Theme.getSize("default_margin").width / 2) font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text")
width: UM.Theme.getSize("section_icon").width }
height: UM.Theme.getSize("section_icon").height Label
{
UM.RecolorImage { text: printCoreConfiguration.hotendID ? printCoreConfiguration.hotendID : " " //Use space so that the height is still correct.
id: mainCircle renderType: Text.NativeRendering
anchors.fill: parent elide: Text.ElideRight
font: UM.Theme.getFont("default")
anchors.centerIn: parent color: UM.Theme.getColor("text_inactive")
sourceSize.width: parent.width
sourceSize.height: parent.height
source: UM.Theme.getIcon("extruder_button")
color: mainColor
}
Label
{
id: extruderNumberText
anchors.centerIn: parent
text: printCoreConfiguration.position + 1
renderType: Text.NativeRendering
font: UM.Theme.getFont("default")
color: mainColor
}
} }
}
Label
{
id: materialLabel
text: printCoreConfiguration.material == null ? "" : printCoreConfiguration.material.name
renderType: Text.NativeRendering
elide: Text.ElideRight
width: parent.width
font: UM.Theme.getFont("default_bold")
color: mainColor
}
Label
{
id: printCoreTypeLabel
text: printCoreConfiguration.hotendID
renderType: Text.NativeRendering
elide: Text.ElideRight
width: parent.width
font: UM.Theme.getFont("default")
color: mainColor
} }
} }

View File

@ -1,243 +0,0 @@
// Copyright (c) 2018 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.Controls.Styles 1.4
import QtQuick.Layouts 1.3
import QtQuick.Controls 1.1 as OldControls
import UM 1.2 as UM
import Cura 1.0 as Cura
Cura.ExpandableComponent
{
id: base
Cura.ExtrudersModel
{
id: extrudersModel
}
UM.I18nCatalog
{
id: catalog
name: "cura"
}
iconSource: expanded ? UM.Theme.getIcon("arrow_bottom") : UM.Theme.getIcon("arrow_left")
headerItem: Item
{
// Horizontal list that shows the extruders
ListView
{
id: extrudersList
orientation: ListView.Horizontal
anchors.fill: parent
model: extrudersModel
delegate: Item
{
height: parent.height
width: Math.round(ListView.view.width / extrudersModel.rowCount())
// Extruder icon. Shows extruder index and has the same color as the active material.
Cura.ExtruderIcon
{
id: extruderIcon
materialColor: model.color
extruderEnabled: model.enabled
anchors.verticalCenter: parent.verticalCenter
}
// Label for the brand of the material
Label
{
id: brandNameLabel
text: model.material_brand
elide: Text.ElideRight
font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text")
anchors
{
left: extruderIcon.right
leftMargin: UM.Theme.getSize("default_margin").width
right: parent.right
rightMargin: UM.Theme.getSize("default_margin").width
}
}
// Label that shows the name of the material
Label
{
text: model.material
elide: Text.ElideRight
font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text")
anchors
{
left: extruderIcon.right
leftMargin: UM.Theme.getSize("default_margin").width
right: parent.right
rightMargin: UM.Theme.getSize("default_margin").width
top: brandNameLabel.bottom
}
}
}
}
}
popupItem: Item
{
width: base.width - 2 * UM.Theme.getSize("default_margin").width
height: 200
TabBar
{
id: tabBar
onCurrentIndexChanged: Cura.ExtruderManager.setActiveExtruderIndex(currentIndex)
width: parent.width
height: 50
Repeater
{
model: extrudersModel
delegate: TabButton
{
width: ListView.view != null ? Math.round(ListView.view.width / extrudersModel.rowCount()): 0
height: parent.height
contentItem: Item
{
Cura.ExtruderIcon
{
anchors.horizontalCenter: parent.horizontalCenter
materialColor: model.color
extruderEnabled: model.enabled
width: parent.height
height: parent.height
}
}
}
}
}
Item
{
id: tabControl
width: parent.width
anchors.top: tabBar.bottom
anchors.bottom: parent.bottom
property var model: extrudersModel.items[tabBar.currentIndex]
property real textWidth: Math.round(width * 0.3)
property real controlWidth: width - textWidth
Column
{
spacing: UM.Theme.getSize("default_margin").height
Row
{
height: UM.Theme.getSize("print_setup_item").height
Label
{
text: catalog.i18nc("@label", "Enabled")
verticalAlignment: Text.AlignVCenter
font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text")
height: parent.height
width: tabControl.textWidth
renderType: Text.NativeRendering
}
OldControls.CheckBox
{
checked: tabControl.model != null ? Cura.MachineManager.getExtruder(tabControl.model.index).isEnabled: false
onClicked: Cura.MachineManager.setExtruderEnabled(tabControl.model.index, checked)
height: UM.Theme.getSize("setting_control").height
style: UM.Theme.styles.checkbox
}
}
Row
{
height: UM.Theme.getSize("print_setup_item").height
Label
{
text: catalog.i18nc("@label", "Material")
verticalAlignment: Text.AlignVCenter
font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text")
height: parent.height
width: tabControl.textWidth
renderType: Text.NativeRendering
}
OldControls.ToolButton
{
id: materialSelection
property var activeExtruder: Cura.MachineManager.activeStack
property var hasActiveExtruder: activeExtruder != null
property var currentRootMaterialName: hasActiveExtruder ? activeExtruder.material.name : ""
property var valueError: hasActiveExtruder ? Cura.ContainerManager.getContainerMetaDataEntry(activeExtruder.material.id, "compatible", "") != "True" : true
property var valueWarning: ! Cura.MachineManager.isActiveQualitySupported
text: currentRootMaterialName
tooltip: currentRootMaterialName
visible: Cura.MachineManager.hasMaterials
enabled: Cura.ExtruderManager.activeExtruderIndex > -1
height: UM.Theme.getSize("setting_control").height
width: tabControl.controlWidth
style: UM.Theme.styles.sidebar_header_button
activeFocusOnPress: true
menu: Cura.MaterialMenu
{
extruderIndex: Cura.ExtruderManager.activeExtruderIndex
}
}
}
Row
{
height: UM.Theme.getSize("print_setup_item").height
Label
{
text: Cura.MachineManager.activeDefinitionVariantsName
verticalAlignment: Text.AlignVCenter
font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text")
height: parent.height
width: tabControl.textWidth
renderType: Text.NativeRendering
}
OldControls.ToolButton
{
id: variantSelection
text: Cura.MachineManager.activeVariantName
tooltip: Cura.MachineManager.activeVariantName;
visible: Cura.MachineManager.hasVariants
height: UM.Theme.getSize("setting_control").height
width: tabControl.controlWidth
style: UM.Theme.styles.sidebar_header_button
activeFocusOnPress: true;
menu: Cura.NozzleMenu { extruderIndex: Cura.ExtruderManager.activeExtruderIndex }
}
}
}
}
}
}

View File

@ -1,102 +0,0 @@
// Copyright (c) 2018 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.7
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import UM 1.2 as UM
import Cura 1.0 as Cura
Button
{
id: base
property var outputDevice: null
property var matched: updateOnSync()
text: matched == true ? catalog.i18nc("@label:extruder label", "Yes") : catalog.i18nc("@label:extruder label", "No")
width: parent.width
height: parent.height
function updateOnSync()
{
if (outputDevice != undefined)
{
for (var index in outputDevice.uniqueConfigurations)
{
var configuration = outputDevice.uniqueConfigurations[index]
if (Cura.MachineManager.matchesConfiguration(configuration))
{
base.matched = true;
return;
}
}
}
base.matched = false;
}
style: ButtonStyle
{
background: Rectangle
{
color:
{
if(control.pressed)
{
return UM.Theme.getColor("machine_selector_active");
}
else if(control.hovered)
{
return UM.Theme.getColor("machine_selector_hover");
}
else
{
return UM.Theme.getColor("machine_selector_bar");
}
}
Behavior on color { ColorAnimation { duration: 50; } }
UM.RecolorImage
{
id: downArrow
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
anchors.rightMargin: UM.Theme.getSize("default_margin").width
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_emphasis")
source: UM.Theme.getIcon("arrow_bottom")
}
UM.RecolorImage
{
id: sidebarComboBoxLabel
anchors.left: parent.left
anchors.leftMargin: UM.Theme.getSize("default_margin").width
anchors.verticalCenter: parent.verticalCenter;
width: UM.Theme.getSize("printer_sync_icon").width
height: UM.Theme.getSize("printer_sync_icon").height
color: control.matched ? UM.Theme.getColor("printer_config_matched") : UM.Theme.getColor("printer_config_mismatch")
source: UM.Theme.getIcon("tab_status_connected")
sourceSize.width: width
sourceSize.height: height
}
}
label: Label {}
}
Connections
{
target: outputDevice
onUniqueConfigurationsChanged: updateOnSync()
}
Connections
{
target: Cura.MachineManager
onCurrentConfigurationChanged: updateOnSync()
onOutputDevicesChanged: updateOnSync()
}
}

View File

@ -37,7 +37,7 @@ Menu
MenuSeparator MenuSeparator
{ {
id: customSeparator id: customSeparator
visible: Cura.CustomQualityProfilesDropDownMenuModel.rowCount > 0 visible: Cura.CustomQualityProfilesDropDownMenuModel.count > 0
} }
Instantiator Instantiator
@ -48,7 +48,7 @@ Menu
Connections Connections
{ {
target: Cura.CustomQualityProfilesDropDownMenuModel target: Cura.CustomQualityProfilesDropDownMenuModel
onModelReset: customSeparator.visible = Cura.CustomQualityProfilesDropDownMenuModel.rowCount() > 0 onModelReset: customSeparator.visible = Cura.CustomQualityProfilesDropDownMenuModel.count > 0
} }
MenuItem MenuItem
@ -62,12 +62,12 @@ Menu
onObjectAdded: onObjectAdded:
{ {
customSeparator.visible = model.rowCount() > 0; customSeparator.visible = model.count > 0;
menu.insertItem(index, object); menu.insertItem(index, object);
} }
onObjectRemoved: onObjectRemoved:
{ {
customSeparator.visible = model.rowCount() > 0; customSeparator.visible = model.count > 0;
menu.removeItem(object); menu.removeItem(object);
} }
} }

View File

@ -1,4 +1,4 @@
// Copyright (c) 2017 Ultimaker B.V. // Copyright (c) 2018 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2 import QtQuick 2.2
@ -55,7 +55,6 @@ Rectangle
{ {
width: control.width width: control.width
height: control.height height: control.height
sourceSize.width: width
sourceSize.height: width sourceSize.height: width
color: UM.Theme.getColor("setting_control_text") color: UM.Theme.getColor("setting_control_text")
source: collapsed ? UM.Theme.getIcon("arrow_left") : UM.Theme.getIcon("arrow_bottom") source: collapsed ? UM.Theme.getIcon("arrow_left") : UM.Theme.getIcon("arrow_bottom")

View File

@ -21,8 +21,10 @@ UM.ManagementPage
function activeMachineIndex() function activeMachineIndex()
{ {
for(var i = 0; i < model.rowCount(); i++) { for(var i = 0; i < model.count; i++)
if (model.getItem(i).id == Cura.MachineManager.activeMachineId) { {
if (model.getItem(i).id == Cura.MachineManager.activeMachineId)
{
return i; return i;
} }
} }
@ -47,7 +49,7 @@ UM.ManagementPage
{ {
text: catalog.i18nc("@action:button", "Remove"); text: catalog.i18nc("@action:button", "Remove");
iconName: "list-remove"; iconName: "list-remove";
enabled: base.currentItem != null && model.rowCount() > 1 enabled: base.currentItem != null && model.count > 1
onClicked: confirmDialog.open(); onClicked: confirmDialog.open();
}, },
Button Button

View File

@ -55,7 +55,8 @@ Rectangle
text: "" text: ""
implicitWidth: UM.Theme.getSize("favorites_button").width implicitWidth: UM.Theme.getSize("favorites_button").width
implicitHeight: UM.Theme.getSize("favorites_button").height implicitHeight: UM.Theme.getSize("favorites_button").height
UM.RecolorImage { UM.RecolorImage
{
anchors anchors
{ {
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
@ -63,8 +64,6 @@ Rectangle
} }
width: UM.Theme.getSize("standard_arrow").width width: UM.Theme.getSize("standard_arrow").width
height: UM.Theme.getSize("standard_arrow").height height: UM.Theme.getSize("standard_arrow").height
sourceSize.width: width
sourceSize.height: height
color: "black" color: "black"
source: brand_section.expanded ? UM.Theme.getIcon("arrow_bottom") : UM.Theme.getIcon("arrow_left") source: brand_section.expanded ? UM.Theme.getIcon("arrow_bottom") : UM.Theme.getIcon("arrow_left")
} }

View File

@ -57,7 +57,7 @@ Item
var currentItemId = base.currentItem == null ? "" : base.currentItem.root_material_id var currentItemId = base.currentItem == null ? "" : base.currentItem.root_material_id
search_root_id = currentItemId search_root_id = currentItemId
} }
for (var material_idx = 0; material_idx < genericMaterialsModel.rowCount(); material_idx++) for (var material_idx = 0; material_idx < genericMaterialsModel.count; material_idx++)
{ {
var material = genericMaterialsModel.getItem(material_idx) var material = genericMaterialsModel.getItem(material_idx)
if (material.root_material_id == search_root_id) if (material.root_material_id == search_root_id)
@ -72,15 +72,15 @@ Item
return true return true
} }
} }
for (var brand_idx = 0; brand_idx < materialsModel.rowCount(); brand_idx++) for (var brand_idx = 0; brand_idx < materialsModel.count; brand_idx++)
{ {
var brand = materialsModel.getItem(brand_idx) var brand = materialsModel.getItem(brand_idx)
var types_model = brand.material_types var types_model = brand.material_types
for (var type_idx = 0; type_idx < types_model.rowCount(); type_idx++) for (var type_idx = 0; type_idx < types_model.count; type_idx++)
{ {
var type = types_model.getItem(type_idx) var type = types_model.getItem(type_idx)
var colors_model = type.colors var colors_model = type.colors
for (var material_idx = 0; material_idx < colors_model.rowCount(); material_idx++) for (var material_idx = 0; material_idx < colors_model.count; material_idx++)
{ {
var material = colors_model.getItem(material_idx) var material = colors_model.getItem(material_idx)
if (material.root_material_id == search_root_id) if (material.root_material_id == search_root_id)

View File

@ -95,8 +95,6 @@ Rectangle
} }
width: UM.Theme.getSize("favorites_button_icon").width width: UM.Theme.getSize("favorites_button_icon").width
height: UM.Theme.getSize("favorites_button_icon").height height: UM.Theme.getSize("favorites_button_icon").height
sourceSize.width: width
sourceSize.height: height
color: color:
{ {
if (favorite_button.hovered) if (favorite_button.hovered)

View File

@ -74,8 +74,6 @@ Rectangle
} }
width: UM.Theme.getSize("standard_arrow").width width: UM.Theme.getSize("standard_arrow").width
height: UM.Theme.getSize("standard_arrow").height height: UM.Theme.getSize("standard_arrow").height
sourceSize.width: width
sourceSize.height: height
color: "black" color: "black"
source: material_type_section.expanded ? UM.Theme.getIcon("arrow_bottom") : UM.Theme.getIcon("arrow_left") source: material_type_section.expanded ? UM.Theme.getIcon("arrow_bottom") : UM.Theme.getIcon("arrow_left")
} }

View File

@ -188,21 +188,27 @@ Item
Connections Connections
{ {
target: qualitiesModel target: qualitiesModel
onItemsChanged: { onItemsChanged:
{
var toSelectItemName = base.currentItem == null ? "" : base.currentItem.name; var toSelectItemName = base.currentItem == null ? "" : base.currentItem.name;
if (newQualityNameToSelect != "") { if (newQualityNameToSelect != "")
{
toSelectItemName = newQualityNameToSelect; toSelectItemName = newQualityNameToSelect;
} }
var newIdx = -1; // Default to nothing if nothing can be found var newIdx = -1; // Default to nothing if nothing can be found
if (toSelectItemName != "") { if (toSelectItemName != "")
{
// Select the required quality name if given // Select the required quality name if given
for (var idx = 0; idx < qualitiesModel.rowCount(); ++idx) { for (var idx = 0; idx < qualitiesModel.count; ++idx)
{
var item = qualitiesModel.getItem(idx); var item = qualitiesModel.getItem(idx);
if (item.name == toSelectItemName) { if (item.name == toSelectItemName)
{
// Switch to the newly created profile if needed // Switch to the newly created profile if needed
newIdx = idx; newIdx = idx;
if (base.toActivateNewQuality) { if (base.toActivateNewQuality)
{
// Activate this custom quality if required // Activate this custom quality if required
Cura.MachineManager.setQualityChangesGroup(item.quality_changes_group); Cura.MachineManager.setQualityChangesGroup(item.quality_changes_group);
} }
@ -382,9 +388,11 @@ Item
var selectedItemName = Cura.MachineManager.activeQualityOrQualityChangesName; var selectedItemName = Cura.MachineManager.activeQualityOrQualityChangesName;
// Select the required quality name if given // Select the required quality name if given
for (var idx = 0; idx < qualitiesModel.rowCount(); idx++) { for (var idx = 0; idx < qualitiesModel.count; idx++)
{
var item = qualitiesModel.getItem(idx); var item = qualitiesModel.getItem(idx);
if (item.name == selectedItemName) { if (item.name == selectedItemName)
{
currentIndex = idx; currentIndex = idx;
break; break;
} }

View File

@ -50,7 +50,7 @@ UM.PreferencesPage
{ {
return Qt.Unchecked return Qt.Unchecked
} }
else if(definitionsModel.visibleCount == definitionsModel.rowCount(null)) else if(definitionsModel.visibleCount == definitionsModel.count)
{ {
return Qt.Checked return Qt.Checked
} }

View File

@ -47,7 +47,7 @@ Item
{ {
id: extruderTargetTemperature id: extruderTargetTemperature
text: Math.round(extruderModel.targetHotendTemperature) + "°C" text: Math.round(extruderModel.targetHotendTemperature) + "°C"
font: UM.Theme.getFont("small") font: UM.Theme.getFont("default_bold")
color: UM.Theme.getColor("text_inactive") color: UM.Theme.getColor("text_inactive")
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: UM.Theme.getSize("default_margin").width anchors.rightMargin: UM.Theme.getSize("default_margin").width

View File

@ -35,7 +35,7 @@ Item
{ {
id: bedTargetTemperature id: bedTargetTemperature
text: printerModel != null ? printerModel.targetBedTemperature + "°C" : "" text: printerModel != null ? printerModel.targetBedTemperature + "°C" : ""
font: UM.Theme.getFont("small") font: UM.Theme.getFont("default_bold")
color: UM.Theme.getColor("text_inactive") color: UM.Theme.getColor("text_inactive")
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: UM.Theme.getSize("default_margin").width anchors.rightMargin: UM.Theme.getSize("default_margin").width

View File

@ -43,7 +43,7 @@ Item
{ {
id: outputDeviceAddressLabel id: outputDeviceAddressLabel
text: (outputDevice != null && outputDevice.address != null) ? outputDevice.address : "" text: (outputDevice != null && outputDevice.address != null) ? outputDevice.address : ""
font: UM.Theme.getFont("small") font: UM.Theme.getFont("default_bold")
color: UM.Theme.getColor("text_inactive") color: UM.Theme.getColor("text_inactive")
anchors.top: outputDeviceNameLabel.bottom anchors.top: outputDeviceNameLabel.bottom
anchors.left: parent.left anchors.left: parent.left
@ -54,7 +54,7 @@ Item
{ {
text: outputDevice != null ? "" : catalog.i18nc("@info:status", "The printer is not connected.") text: outputDevice != null ? "" : catalog.i18nc("@info:status", "The printer is not connected.")
color: outputDevice != null && outputDevice.acceptsCommands ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text") color: outputDevice != null && outputDevice.acceptsCommands ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text")
font: UM.Theme.getFont("very_small") font: UM.Theme.getFont("default")
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: UM.Theme.getSize("default_margin").width anchors.leftMargin: UM.Theme.getSize("default_margin").width

View File

@ -25,29 +25,52 @@ Cura.ExpandableComponent
name: "cura" name: "cura"
} }
headerItem: Cura.IconLabel headerItem: Item
{ {
text: isNetworkPrinter ? Cura.MachineManager.activeMachineNetworkGroupName : Cura.MachineManager.activeMachineName implicitHeight: icon.height
source:
{
if (isNetworkPrinter)
{
if (machineSelector.outputDevice != null && machineSelector.outputDevice.clusterSize > 1)
{
return UM.Theme.getIcon("printer_group")
}
return UM.Theme.getIcon("printer_single")
}
return ""
}
font: UM.Theme.getFont("medium")
color: UM.Theme.getColor("text")
iconSize: UM.Theme.getSize("machine_selector_icon").width
UM.RecolorImage UM.RecolorImage
{ {
id: icon id: icon
anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter
source:
{
if (isNetworkPrinter)
{
if (machineSelector.outputDevice != null && machineSelector.outputDevice.clusterSize > 1)
{
return UM.Theme.getIcon("printer_group")
}
return UM.Theme.getIcon("printer_single")
}
return ""
}
width: UM.Theme.getSize("machine_selector_icon").width
height: width
color: UM.Theme.getColor("machine_selector_printer_icon")
visible: source != ""
}
Label
{
id: label
anchors.left: icon.visible ? icon.right : parent.left
anchors.right: parent.right
anchors.leftMargin: UM.Theme.getSize("thin_margin").width
anchors.verticalCenter: icon.verticalCenter
text: isNetworkPrinter ? Cura.MachineManager.activeMachineNetworkGroupName : Cura.MachineManager.activeMachineName
elide: Text.ElideRight
color: UM.Theme.getColor("text")
font: UM.Theme.getFont("medium")
renderType: Text.NativeRendering
}
UM.RecolorImage
{
anchors anchors
{ {
bottom: parent.bottom bottom: parent.bottom
@ -59,9 +82,6 @@ Cura.ExpandableComponent
width: UM.Theme.getSize("printer_status_icon").width width: UM.Theme.getSize("printer_status_icon").width
height: UM.Theme.getSize("printer_status_icon").height height: UM.Theme.getSize("printer_status_icon").height
sourceSize.width: width
sourceSize.height: height
color: UM.Theme.getColor("primary") color: UM.Theme.getColor("primary")
visible: isNetworkPrinter && isPrinterConnected visible: isNetworkPrinter && isPrinterConnected

View File

@ -13,7 +13,7 @@ Column
Label Label
{ {
text: catalog.i18nc("@label", "Network connected printers") text: catalog.i18nc("@label", "Connected printers")
visible: networkedPrintersModel.items.length > 0 visible: networkedPrintersModel.items.length > 0
leftPadding: UM.Theme.getSize("default_margin").width leftPadding: UM.Theme.getSize("default_margin").width
height: visible ? contentHeight + 2 * UM.Theme.getSize("default_margin").height : 0 height: visible ? contentHeight + 2 * UM.Theme.getSize("default_margin").height : 0

View File

@ -28,7 +28,7 @@ Item
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
renderType: Text.NativeRendering renderType: Text.NativeRendering
font: UM.Theme.getFont("very_small") font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text") color: UM.Theme.getColor("text")
} }
} }

View File

@ -129,23 +129,26 @@ Button
anchors.rightMargin: UM.Theme.getSize("default_margin").width anchors.rightMargin: UM.Theme.getSize("default_margin").width
width: UM.Theme.getSize("standard_arrow").width width: UM.Theme.getSize("standard_arrow").width
height: UM.Theme.getSize("standard_arrow").height height: UM.Theme.getSize("standard_arrow").height
sourceSize.width: width
sourceSize.height: width sourceSize.height: width
color: color:
{ {
if (!base.enabled) if (!base.enabled)
{ {
return UM.Theme.getColor("setting_category_disabled_text") return UM.Theme.getColor("setting_category_disabled_text")
} else if ((base.hovered || base.activeFocus) && base.checkable && base.checked) }
else if ((base.hovered || base.activeFocus) && base.checkable && base.checked)
{ {
return UM.Theme.getColor("setting_category_active_hover_text") return UM.Theme.getColor("setting_category_active_hover_text")
} else if (base.pressed || (base.checkable && base.checked)) }
else if (base.pressed || (base.checkable && base.checked))
{ {
return UM.Theme.getColor("setting_category_active_text") return UM.Theme.getColor("setting_category_active_text")
} else if (base.hovered || base.activeFocus) }
else if (base.hovered || base.activeFocus)
{ {
return UM.Theme.getColor("setting_category_hover_text") return UM.Theme.getColor("setting_category_hover_text")
} else }
else
{ {
return UM.Theme.getColor("setting_category_text") return UM.Theme.getColor("setting_category_text")
} }

View File

@ -115,12 +115,12 @@ SettingItem
return UM.Theme.getColor("setting_control_border") return UM.Theme.getColor("setting_control_border")
} }
UM.RecolorImage { UM.RecolorImage
{
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
width: Math.round(parent.width / 2.5) width: Math.round(parent.width / 2.5)
height: Math.round(parent.height / 2.5) height: Math.round(parent.height / 2.5)
sourceSize.width: width
sourceSize.height: width sourceSize.height: width
color: !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("setting_control_text"); color: !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("setting_control_text");
source: UM.Theme.getIcon("check") source: UM.Theme.getIcon("check")

View File

@ -1,5 +1,5 @@
// Copyright (c) 2016 Ultimaker B.V. // Copyright (c) 2018 Ultimaker B.V.
// Uranium is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
@ -31,12 +31,15 @@ SettingItem
{ {
forceActiveFocus(); forceActiveFocus();
propertyProvider.setPropertyValue("value", model.getItem(index).index); propertyProvider.setPropertyValue("value", model.getItem(index).index);
} else }
else
{ {
if (propertyProvider.properties.value == -1) if (propertyProvider.properties.value == -1)
{ {
control.currentIndex = model.rowCount() - 1; // we know the last item is "Not overriden" control.currentIndex = model.count - 1; // we know the last item is "Not overriden"
} else { }
else
{
control.currentIndex = propertyProvider.properties.value; // revert to the old value control.currentIndex = propertyProvider.properties.value; // revert to the old value
} }
} }

View File

@ -1,5 +1,5 @@
// Copyright (c) 2017 Ultimaker B.V. // Copyright (c) 2018 Ultimaker B.V.
// Uranium is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 1.1 import QtQuick.Controls 1.1
@ -129,13 +129,14 @@ Item
} }
style: ButtonStyle style: ButtonStyle
{ {
background: Item { background: Item
UM.RecolorImage { {
UM.RecolorImage
{
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
width: UM.Theme.getSize("standard_arrow").width width: UM.Theme.getSize("standard_arrow").width
height: UM.Theme.getSize("standard_arrow").height height: UM.Theme.getSize("standard_arrow").height
sourceSize.width: width
sourceSize.height: width sourceSize.height: width
color: control.enabled ? UM.Theme.getColor("setting_category_text") : UM.Theme.getColor("setting_category_disabled_text") color: control.enabled ? UM.Theme.getColor("setting_category_text") : UM.Theme.getColor("setting_category_disabled_text")
source: UM.Theme.getIcon("menu") source: UM.Theme.getIcon("menu")

View File

@ -106,7 +106,7 @@ Item
var availableMin = -1 var availableMin = -1
var availableMax = -1 var availableMax = -1
for (var i = 0; i < Cura.QualityProfilesDropDownMenuModel.rowCount(); i++) for (var i = 0; i < Cura.QualityProfilesDropDownMenuModel.count; i++)
{ {
var qualityItem = Cura.QualityProfilesDropDownMenuModel.getItem(i) var qualityItem = Cura.QualityProfilesDropDownMenuModel.getItem(i)
@ -183,7 +183,7 @@ Item
qualityModel.existingQualityProfile = 0 qualityModel.existingQualityProfile = 0
// check, the ticks count cannot be less than zero // check, the ticks count cannot be less than zero
qualityModel.totalTicks = Math.max(0, Cura.QualityProfilesDropDownMenuModel.rowCount() - 1) qualityModel.totalTicks = Math.max(0, Cura.QualityProfilesDropDownMenuModel.count - 1)
} }
} }
@ -731,7 +731,6 @@ Item
{ {
anchors.fill: parent anchors.fill: parent
anchors.margins: 2 * screenScaleFactor anchors.margins: 2 * screenScaleFactor
sourceSize.width: width
sourceSize.height: width sourceSize.height: width
source: UM.Theme.getIcon(model.icon) source: UM.Theme.getIcon(model.icon)
color: UM.Theme.getColor("quality_slider_unavailable") color: UM.Theme.getColor("quality_slider_unavailable")
@ -1156,7 +1155,7 @@ Item
function populateExtruderModel() function populateExtruderModel()
{ {
extruderModel.clear(); extruderModel.clear();
for(var extruderNumber = 0; extruderNumber < extruders.rowCount() ; extruderNumber++) for(var extruderNumber = 0; extruderNumber < extruders.count; extruderNumber++)
{ {
extruderModel.append({ extruderModel.append({
text: extruders.getItem(extruderNumber).name, text: extruders.getItem(extruderNumber).name,

View File

@ -62,7 +62,7 @@ Item
enabled: model.enabled && UM.Selection.hasSelection && UM.Controller.toolsEnabled enabled: model.enabled && UM.Selection.hasSelection && UM.Controller.toolsEnabled
isTopElement: toolsModel.getItem(0).id == model.id isTopElement: toolsModel.getItem(0).id == model.id
isBottomElement: toolsModel.getItem(toolsModel.rowCount() - 1).id == model.id isBottomElement: toolsModel.getItem(toolsModel.count - 1).id == model.id
toolItem: UM.RecolorImage toolItem: UM.RecolorImage
{ {

View File

@ -19,7 +19,7 @@ Cura.ExpandableComponent
property var activeView: property var activeView:
{ {
for (var i = 0; i < viewModel.rowCount(); i++) for (var i = 0; i < viewModel.count; i++)
{ {
if (viewModel.items[i].active) if (viewModel.items[i].active)
{ {
@ -74,6 +74,8 @@ Cura.ExpandableComponent
{ {
id: viewSelectorPopup id: viewSelectorPopup
width: viewSelector.width - 2 * viewSelector.popupPadding width: viewSelector.width - 2 * viewSelector.popupPadding
leftPadding: UM.Theme.getSize("default_lining").width
rightPadding: UM.Theme.getSize("default_lining").width
// For some reason the height/width of the column gets set to 0 if this is not set... // For some reason the height/width of the column gets set to 0 if this is not set...
Component.onCompleted: Component.onCompleted:
@ -91,7 +93,7 @@ Cura.ExpandableComponent
{ {
id: viewsSelectorButton id: viewsSelectorButton
text: model.name text: model.name
width: parent.width width: parent.width - viewSelectorPopup.leftPadding - viewSelectorPopup.rightPadding
height: UM.Theme.getSize("action_button").height height: UM.Theme.getSize("action_button").height
leftPadding: UM.Theme.getSize("default_margin").width leftPadding: UM.Theme.getSize("default_margin").width
rightPadding: UM.Theme.getSize("default_margin").width rightPadding: UM.Theme.getSize("default_margin").width

View File

@ -1,7 +1,6 @@
module Cura module Cura
MachineSelector 1.0 MachineSelector.qml MachineSelector 1.0 MachineSelector.qml
QuickConfigurationSelector 1.0 QuickConfigurationSelector.qml
CustomConfigurationSelector 1.0 CustomConfigurationSelector.qml CustomConfigurationSelector 1.0 CustomConfigurationSelector.qml
PrintSetupSelector 1.0 PrintSetupSelector.qml PrintSetupSelector 1.0 PrintSetupSelector.qml
ActionButton 1.0 ActionButton.qml ActionButton 1.0 ActionButton.qml

View File

@ -15,7 +15,7 @@
"primary_hover": [48, 182, 231, 255], "primary_hover": [48, 182, 231, 255],
"primary_text": [255, 255, 255, 204], "primary_text": [255, 255, 255, 204],
"border": [127, 127, 127, 255], "border": [127, 127, 127, 255],
"secondary": [241, 242, 242, 255], "secondary": [95, 95, 95, 255],
"main_window_header_button_text_inactive": [128, 128, 128, 255], "main_window_header_button_text_inactive": [128, 128, 128, 255],
"main_window_header_button_text_hovered": [255, 255, 255, 255], "main_window_header_button_text_hovered": [255, 255, 255, 255],
@ -196,14 +196,6 @@
"layerview_support_interface": [64, 192, 255, 255], "layerview_support_interface": [64, 192, 255, 255],
"layerview_nozzle": [181, 166, 66, 120], "layerview_nozzle": [181, 166, 66, 120],
"configuration_item": [0, 0, 0, 0],
"configuration_item_active": [12, 169, 227, 179],
"configuration_item_text": [255, 255, 255, 255],
"configuration_item_text_active": [255, 255, 255, 255],
"configuration_item_border": [255, 255, 255, 255],
"configuration_item_border_active": [12, 169, 227, 179],
"configuration_item_border_hover": [12, 169, 227, 179],
"material_compatibility_warning": [255, 255, 255, 255], "material_compatibility_warning": [255, 255, 255, 255],
"quality_slider_unavailable": [179, 179, 179, 255], "quality_slider_unavailable": [179, 179, 179, 255],

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 310 KiB

After

Width:  |  Height:  |  Size: 785 KiB

View File

@ -0,0 +1,172 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="110mm"
height="33mm"
viewBox="0 0 110 33"
version="1.1"
id="svg8"
inkscape:version="0.92.2 (5c3e80d, 2017-08-06)"
sodipodi:docname="logo.svg">
<defs
id="defs2" />
<sodipodi:namedview
id="base"
pagecolor="#000000"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.979899"
inkscape:cx="97.165681"
inkscape:cy="69.313647"
inkscape:document-units="mm"
inkscape:current-layer="g4570"
showgrid="false"
inkscape:window-width="1920"
inkscape:window-height="1137"
inkscape:window-x="2872"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:pagecheckerboard="true" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-264)">
<g
id="g4570"
transform="matrix(0.1443759,0,0,0.14575971,-5.7750359,237.12191)">
<polygon
id="polygon4506"
points="741.8,410.8 781.7,410.8 801.9,390.6 801.9,350.7 762,350.7 741.8,370.9 "
class="st0"
style="fill:#3282ff;fill-opacity:1" />
<path
id="path4508"
d="m 40,334.7 c 0,44.3 28.1,76.1 74.4,76.1 h 70.3 V 371 H 114.4 C 91,370.9 79.5,354.4 79.5,334.7 79.5,315 91,298.8 114.4,298.6 h 70.3 V 258.9 H 114.4 C 68.1,258.9 40,290.4 40,334.7 Z"
class="st1"
inkscape:connector-curvature="0"
style="fill:#000000" />
<path
id="path4510"
d="m 336.7,338.8 c 0,22.6 -16.5,34.7 -36.2,34.7 -19.7,0 -35.9,-12.1 -35.9,-34.7 v -79.9 h -39.9 v 79.9 c 0,44.7 31.5,71.9 75.8,71.9 44.3,0 76.1,-27.1 76.1,-71.9 v -79.9 h -39.9 z"
class="st1"
inkscape:connector-curvature="0"
style="fill:#000000" />
<path
id="path4512"
d="m 624.1,258.9 c -46.3,0 -74.4,31.5 -74.4,75.8 0,44.3 28.1,76.1 74.4,76.1 h 16.4 V 371 h -16.4 c -23.4,-0.1 -34.9,-16.6 -34.9,-36.3 0,-19.7 11.5,-35.9 34.9,-36.1 h 37.3 v 52 20.4 39.8 h 39.9 v -2.3 -37.5 -72.4 -32.8 -7 h -77.2 z"
class="st1"
inkscape:connector-curvature="0"
style="fill:#000000" />
<path
id="path4514"
d="m 416.6,333 v 77.8 H 456 V 333 c 0,-19.3 11.5,-35.1 34.9,-35.3 h 28.8 V 258.8 H 491 c -46.3,0.1 -74.4,30.9 -74.4,74.2 z"
class="st1"
inkscape:connector-curvature="0"
style="fill:#000000" />
<g
id="g4542">
<path
id="path4518"
d="m 456.3,198.8 c -3.1,0 -5.3,1.8 -5.3,5.3 v 29.4 c 0,3.5 2.1,5.3 5.3,5.3 3.2,0 5.3,-1.8 5.3,-5.3 v -29.4 c -0.1,-3.5 -2.2,-5.3 -5.3,-5.3 z"
class="st1"
inkscape:connector-curvature="0"
style="fill:#000000" />
<path
id="path4520"
d="m 456.3,184.4 c -2.9,0 -5.3,2.4 -5.3,5.4 0,0 0,0.1 0,0.1 0,3 2.5,5.3 5.5,5.3 3,0 5.3,-2.5 5.3,-5.5 -0.1,-3 -2.6,-5.3 -5.5,-5.3 z"
class="st1"
inkscape:connector-curvature="0"
style="fill:#000000" />
<path
id="path4522"
d="m 408.8,184.6 v 0 l -9.4,-0.1 c -1.6,0 -3,1.3 -3,3 0,1.6 1.3,3 3,3 h 3.6 v 43 c 0,3.5 2.1,5.3 5.3,5.3 3.1,0 5.3,-1.8 5.3,-5.3 v -43.6 c -0.2,-3.4 -2,-5.1 -4.8,-5.3 z"
class="st1"
inkscape:connector-curvature="0"
style="fill:#000000" />
<path
id="path4524"
d="m 521.3,204.9 c -1.1,-2.9 -3.8,-4.8 -6.8,-4.7 -0.4,0 -0.7,0.1 -1.1,0.1 -2.6,0.3 -4.8,2 -5.7,4.5 l -6.4,15.2 -6.4,-15.3 c -1.1,-2.8 -3.8,-4.6 -6.8,-4.6 -0.2,0 -0.3,0 -0.5,0 h -8.9 c -1.6,0 -3,1.3 -3,3 0,1.6 1.3,3 3,3 h 2.2 l -9.2,25.8 c -1,2.7 0.4,5.7 3.1,6.7 0.6,0.2 1.1,0.3 1.7,0.3 2.2,0 4.1,-1.4 4.9,-3.5 l 6.9,-19.2 7.9,18.8 c 0.5,1.7 1.8,3 3.5,3.5 0,0 0.1,0 0.1,0 0.2,0.1 0.4,0.1 0.6,0.1 0.3,0 0.5,0.1 0.8,0.1 0,0 0,0 0.1,0 0,0 0,0 0,0 v 0 0.1 c 2.1,0 4,-1.3 4.8,-3.2 l 8.1,-19.5 6.9,19.3 c 0.7,2.1 2.7,3.4 4.9,3.5 h 0.1 c 0.6,0 1.2,-0.1 1.7,-0.3 0,0 0,0 0,0 2.7,-1 4.1,-3.9 3.1,-6.6 z"
class="st1"
inkscape:connector-curvature="0"
style="fill:#000000" />
<path
id="path4526"
d="m 476.5,238.8 c 0,0 0,0 0,0 0,0 0,0 0,0 z"
class="st1"
inkscape:connector-curvature="0"
style="fill:#000000" />
<path
id="path4528"
d="m 608.9,215.4 7.8,-8.1 c 1.1,-0.8 1.6,-2.1 1.6,-3.5 -0.2,-2.6 -2.3,-4.7 -5,-4.8 -1.6,0.1 -3,0.8 -4,2 l -9.1,10.2 c -1.1,1.3 -1.7,2.9 -1.7,4.6 v 0 c 0,3.2 2.8,6.3 2.8,6.3 l 10,14.1 c 1,1.6 2.8,2.5 4.7,2.5 2.8,-0.1 5,-2.3 5,-5.1 0,-1.2 -0.4,-2.4 -1.1,-3.4 z"
class="st1"
inkscape:connector-curvature="0"
style="fill:#000000" />
<path
id="path4530"
d="m 590.9,184.6 v 0 l -9.4,-0.1 c -1.6,0 -3,1.3 -3,3 0,1.7 1.3,3 3,3 h 3.6 v 42.9 c 0,3.5 2.1,5.3 5.3,5.3 3.2,0 5.3,-1.8 5.3,-5.3 v -8 -35.5 c -0.1,-3.4 -1.9,-5.1 -4.8,-5.3 z"
class="st1"
inkscape:connector-curvature="0"
style="fill:#000000" />
<path
id="path4532"
d="m 440.7,200.2 h -3.3 v -6.7 c 0,-3.5 -2.1,-5.3 -5.3,-5.3 -3.1,0 -5.3,1.8 -5.3,5.3 v 6.7 c -1.6,0 -3,1.3 -3,3 0,1.6 1.3,3 3,3 v 27.4 c 0,3.5 2.2,5.3 5.3,5.3 3.1,0 5.3,-1.8 5.3,-5.3 V 228 206.2 h 3.3 c 1.6,0 3,-1.3 3,-3 0,-1.7 -1.3,-3 -3,-3 z"
class="st1"
inkscape:connector-curvature="0"
style="fill:#000000" />
<path
id="path4534"
d="m 573.4,227.7 v -18.6 c 0,-7.6 -7.7,-11.2 -21.5,-10.1 -2.3,0.2 -9.2,1.5 -9.2,1.5 -2.1,0.5 -4.2,1.6 -4.2,4.2 -0.1,2 1.4,3.7 3.4,3.8 0,0 0,0 0,0 0.3,0 0.6,0 0.8,0 0,0 7.4,-1.4 10,-1.6 1.3,-0.1 2.7,-0.1 4,-0.1 3.5,0.1 6.2,0.5 6.2,3.6 v 13.8 c 0,3.9 -3.5,7.6 -9.3,7.6 -3.6,0 -5.8,-1.9 -5.8,-4.3 0,-3.2 2.4,-4.5 6.8,-5.2 1.6,-0.3 2.6,-1.8 2.3,-3.4 0,0 0,0 0,0 0,-0.1 -0.1,-0.3 -0.1,-0.4 -0.8,-3.1 -4.7,-2.7 -4.7,-2.7 -8.1,0.9 -14.7,3.4 -14.7,12.1 0,6.6 5.9,10.7 11.9,10.7 5.5,0 10.3,-1.6 14.4,-6.1 0.2,3.2 1.7,6.1 6.2,6.1 2.5,0 4.8,-1.7 4.8,-4 -0.2,-1.4 -1.3,-2.5 -1.3,-6.9 z"
class="st1"
inkscape:connector-curvature="0"
style="fill:#000000" />
<path
id="path4536"
d="m 387.8,213 -0.1,0.1 v -22.7 c -0.2,-3 -2.6,-5.4 -5.5,-5.5 -3.3,-0.2 -6.1,2.3 -6.3,5.5 v 28.5 c 0,7 -4,10.2 -10.7,10.2 -6.8,0 -10.7,-3.2 -10.7,-10.2 v -28.5 c 0,-0.2 0,-0.5 0,-0.7 0,0 0,0 0,0 -0.2,-3.1 -2.8,-5.4 -5.9,-5.2 v 0 0 h -0.7 -8.7 c -1.6,0 -3,1.3 -3,3 0,1.7 1.3,3 3,3 h 3.5 c 0,0 0,0 0,0 l 0.1,27.5 c 0,14.3 8.8,20.7 22.5,20.7 5.3,0 9.9,-1 13.5,-3 0.9,1.7 2.5,2.9 5.4,2.9 2.5,0 4.8,-1.7 4.8,-4 0,-1.7 -1.1,-2.7 -1.1,-7.1 V 213 Z"
class="st1"
inkscape:connector-curvature="0"
style="fill:#000000" />
<path
id="path4538"
d="m 645.5,199 c -12.5,0 -19.9,8.2 -19.9,20.5 0,9.2 5.4,19.1 20.3,19.1 2.9,0 12.5,-2.2 12.5,-2.2 2.5,-0.5 4.3,-1.7 3.7,-5 -0.5,-2.3 -2.3,-3.3 -5,-2.9 0,0 -8.3,1.6 -11.2,1.8 -6.1,0.5 -9.7,-4 -9.7,-9.6 0,0 -1.7,-14.4 9.6,-14.4 4.6,0 8.2,3.7 8.9,8.4 h -11.1 c -1.6,0 -3,1.3 -3,3 0,1.7 1.3,3 3,3 v 0 0 H 660 c 3.5,0 4.6,-0.9 4.6,-4.5 -0.1,-8.6 -7,-17.2 -19.1,-17.2 z"
class="st1"
inkscape:connector-curvature="0"
style="fill:#000000" />
<path
id="path4540"
d="m 696.9,198.9 c -0.3,0 -0.6,0 -0.9,0 h -5.5 c -2.9,0 -4.9,1.5 -5.2,4.4 -0.3,-2.9 -2.3,-4.3 -5.2,-4.3 h -9.4 c -1.6,0 -3,1.3 -3,3 0,1.6 1.3,3 3,3 h 4.2 v 28.6 c 0,3.5 2.1,5.3 5.3,5.3 3.1,0 5.3,-1.8 5.3,-5.3 v -21.1 c 0,-1.6 1.3,-3 3,-3 h 7.7 c 3.5,0 5.3,-2.1 5.3,-5.3 0,-2.8 -1.9,-5.1 -4.6,-5.3 z"
class="st1"
inkscape:connector-curvature="0"
style="fill:#000000" />
</g>
</g>
</g>
<style
id="style4504"
type="text/css">
.st0{fill:#333333;}
.st1{fill:#000000;}
</style>
</svg>

After

Width:  |  Height:  |  Size: 8.5 KiB

View File

@ -73,7 +73,6 @@ QtObject
anchors.rightMargin: Theme.getSize("default_margin").width anchors.rightMargin: Theme.getSize("default_margin").width
width: Theme.getSize("standard_arrow").width width: Theme.getSize("standard_arrow").width
height: Theme.getSize("standard_arrow").height height: Theme.getSize("standard_arrow").height
sourceSize.width: width
sourceSize.height: width sourceSize.height: width
color: control.enabled ? Theme.getColor("setting_category_text") : Theme.getColor("setting_category_disabled_text") color: control.enabled ? Theme.getColor("setting_category_text") : Theme.getColor("setting_category_disabled_text")
source: Theme.getIcon("arrow_bottom") source: Theme.getIcon("arrow_bottom")
@ -146,7 +145,7 @@ QtObject
text: control.text text: control.text
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
font: UM.Theme.getFont("medium_bold") font: UM.Theme.getFont("medium")
color: color:
{ {
if (control.checked) if (control.checked)
@ -257,7 +256,6 @@ QtObject
anchors.bottomMargin: Theme.getSize("button").height - Math.round(Theme.getSize("button_icon").height / 4) anchors.bottomMargin: Theme.getSize("button").height - Math.round(Theme.getSize("button_icon").height / 4)
width: Theme.getSize("standard_arrow").width width: Theme.getSize("standard_arrow").width
height: Theme.getSize("standard_arrow").height height: Theme.getSize("standard_arrow").height
sourceSize.width: width
sourceSize.height: width sourceSize.height: width
visible: control.menu != null; visible: control.menu != null;
color: color:
@ -529,7 +527,7 @@ QtObject
implicitWidth: Theme.getSize("checkbox").width implicitWidth: Theme.getSize("checkbox").width
implicitHeight: Theme.getSize("checkbox").height implicitHeight: Theme.getSize("checkbox").height
color: (control.hovered || control._hovered) ? Theme.getColor("checkbox_hover") : Theme.getColor("checkbox") color: (control.hovered || control._hovered) ? Theme.getColor("checkbox_hover") : (control.enabled ? Theme.getColor("checkbox") : Theme.getColor("checkbox_disabled"))
Behavior on color { ColorAnimation { duration: 50; } } Behavior on color { ColorAnimation { duration: 50; } }
radius: control.exclusiveGroup ? Math.round(Theme.getSize("checkbox").width / 2) : 0 radius: control.exclusiveGroup ? Math.round(Theme.getSize("checkbox").width / 2) : 0
@ -543,7 +541,6 @@ QtObject
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
width: Math.round(parent.width / 2.5) width: Math.round(parent.width / 2.5)
height: Math.round(parent.height / 2.5) height: Math.round(parent.height / 2.5)
sourceSize.width: width
sourceSize.height: width sourceSize.height: width
color: Theme.getColor("checkbox_mark") color: Theme.getColor("checkbox_mark")
source: control.exclusiveGroup ? Theme.getIcon("dot") : Theme.getIcon("check") source: control.exclusiveGroup ? Theme.getIcon("dot") : Theme.getIcon("check")
@ -585,7 +582,6 @@ QtObject
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
width: Math.round(parent.width / 2.5) width: Math.round(parent.width / 2.5)
height: Math.round(parent.height / 2.5) height: Math.round(parent.height / 2.5)
sourceSize.width: width
sourceSize.height: width sourceSize.height: width
color: Theme.getColor("checkbox_mark") color: Theme.getColor("checkbox_mark")
source: source:
@ -836,7 +832,6 @@ QtObject
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
width: Math.floor(control.width / 2) width: Math.floor(control.width / 2)
height: Math.floor(control.height / 2) height: Math.floor(control.height / 2)
sourceSize.width: width
sourceSize.height: width sourceSize.height: width
color: color:
{ {

View File

@ -41,12 +41,12 @@
"family": "Noto Sans" "family": "Noto Sans"
}, },
"small": { "small": {
"size": 1.0, "size": 0.85,
"weight": 63, "weight": 50,
"family": "Noto Sans" "family": "Noto Sans"
}, },
"very_small": { "very_small": {
"size": 1.0, "size": 0.7,
"weight": 50, "weight": 50,
"family": "Noto Sans" "family": "Noto Sans"
}, },
@ -64,12 +64,6 @@
"size": 1.15, "size": 1.15,
"weight": 50, "weight": 50,
"family": "Noto Sans" "family": "Noto Sans"
},
"extruder_icon":
{
"size": 0.7,
"weight": 50,
"family": "Noto Sans"
} }
}, },
@ -99,14 +93,14 @@
"secondary_button_hover": [228, 228, 228, 255], "secondary_button_hover": [228, 228, 228, 255],
"secondary_button_text": [30, 102, 215, 255], "secondary_button_text": [30, 102, 215, 255],
"main_window_header_background": [10, 8, 80, 255], "main_window_header_background": [8, 7, 63, 255],
"main_window_header_background_gradient": [25, 23, 91, 255], "main_window_header_background_gradient": [25, 23, 91, 255],
"main_window_header_button_text_active": [10, 8, 80, 255], "main_window_header_button_text_active": [8, 7, 63, 255],
"main_window_header_button_text_inactive": [255, 255, 255, 255], "main_window_header_button_text_inactive": [255, 255, 255, 255],
"main_window_header_button_text_hovered": [255, 255, 255, 255], "main_window_header_button_text_hovered": [255, 255, 255, 255],
"main_window_header_button_background_active": [255, 255, 255, 255], "main_window_header_button_background_active": [255, 255, 255, 255],
"main_window_header_button_background_inactive": [255, 255, 255, 0], "main_window_header_button_background_inactive": [255, 255, 255, 0],
"main_window_header_button_background_hovered": [255, 255, 255, 102], "main_window_header_button_background_hovered": [117, 114, 159, 255],
"account_widget_outline_active": [70, 66, 126, 255], "account_widget_outline_active": [70, 66, 126, 255],
@ -114,12 +108,13 @@
"machine_selector_active": [68, 72, 75, 255], "machine_selector_active": [68, 72, 75, 255],
"machine_selector_hover": [68, 72, 75, 255], "machine_selector_hover": [68, 72, 75, 255],
"machine_selector_text_active": [255, 255, 255, 255], "machine_selector_text_active": [255, 255, 255, 255],
"machine_selector_printer_icon": [8, 7, 63, 255],
"action_panel_secondary": [27, 95, 202, 255], "action_panel_secondary": [27, 95, 202, 255],
"toolbar_background": [255, 255, 255, 255], "toolbar_background": [255, 255, 255, 255],
"printer_type_label_background": [171, 171, 191, 255], "printer_type_label_background": [228, 228, 242, 255],
"text": [0, 0, 0, 255], "text": [0, 0, 0, 255],
"text_detail": [174, 174, 174, 128], "text_detail": [174, 174, 174, 128],
@ -133,9 +128,9 @@
"text_scene_hover": [70, 84, 113, 255], "text_scene_hover": [70, 84, 113, 255],
"error": [255, 140, 0, 255], "error": [255, 140, 0, 255],
"warning": [255, 190, 35, 255], "warning": [245, 166, 35, 255],
"toolbar_button_text": [10, 8, 80, 255], "toolbar_button_text": [8, 7, 63, 255],
"toolbar_button_hover": [232, 242, 252, 255], "toolbar_button_hover": [232, 242, 252, 255],
"toolbar_button_active": [232, 242, 252, 255], "toolbar_button_active": [232, 242, 252, 255],
"toolbar_button_active_hover": [232, 242, 252, 255], "toolbar_button_active_hover": [232, 242, 252, 255],
@ -150,9 +145,9 @@
"button_text_active_hover": [255, 255, 255, 255], "button_text_active_hover": [255, 255, 255, 255],
"small_button": [0, 0, 0, 0], "small_button": [0, 0, 0, 0],
"small_button_hover": [10, 8, 80, 255], "small_button_hover": [8, 7, 63, 255],
"small_button_active": [10, 8, 80, 255], "small_button_active": [8, 7, 63, 255],
"small_button_active_hover": [10, 8, 80, 255], "small_button_active_hover": [8, 7, 63, 255],
"small_button_text": [171, 171, 191, 255], "small_button_text": [171, 171, 191, 255],
"small_button_text_hover": [255, 255, 255, 255], "small_button_text_hover": [255, 255, 255, 255],
"small_button_text_active": [255, 255, 255, 255], "small_button_text_active": [255, 255, 255, 255],
@ -228,8 +223,8 @@
"progressbar_control": [50, 130, 255, 255], "progressbar_control": [50, 130, 255, 255],
"slider_groove": [223, 223, 223, 255], "slider_groove": [223, 223, 223, 255],
"slider_groove_fill": [10, 8, 80, 255], "slider_groove_fill": [8, 7, 63, 255],
"slider_handle": [10, 8, 80, 255], "slider_handle": [8, 7, 63, 255],
"slider_handle_active": [50, 130, 255, 255], "slider_handle_active": [50, 130, 255, 255],
"slider_text_background": [255, 255, 255, 255], "slider_text_background": [255, 255, 255, 255],
@ -241,6 +236,7 @@
"checkbox_border": [64, 69, 72, 255], "checkbox_border": [64, 69, 72, 255],
"checkbox_border_hover": [50, 130, 255, 255], "checkbox_border_hover": [50, 130, 255, 255],
"checkbox_mark": [119, 122, 124, 255], "checkbox_mark": [119, 122, 124, 255],
"checkbox_disabled": [223, 223, 223, 255],
"checkbox_text": [27, 27, 27, 255], "checkbox_text": [27, 27, 27, 255],
"tooltip": [68, 192, 255, 255], "tooltip": [68, 192, 255, 255],
@ -310,14 +306,6 @@
"layerview_support_interface": [64, 192, 255, 255], "layerview_support_interface": [64, 192, 255, 255],
"layerview_nozzle": [181, 166, 66, 50], "layerview_nozzle": [181, 166, 66, 50],
"configuration_item": [255, 255, 255, 0],
"configuration_item_active": [12, 169, 227, 32],
"configuration_item_text": [0, 0, 0, 255],
"configuration_item_text_active": [0, 0, 0, 255],
"configuration_item_border": [127, 127, 127, 255],
"configuration_item_border_active": [12, 169, 227, 32],
"configuration_item_border_hover": [50, 130, 255, 255],
"tab_status_connected": [50, 130, 255, 255], "tab_status_connected": [50, 130, 255, 255],
"tab_status_disconnected": [200, 200, 200, 255], "tab_status_disconnected": [200, 200, 200, 255],
@ -377,7 +365,6 @@
"action_panel_widget": [25.0, 0.0], "action_panel_widget": [25.0, 0.0],
"action_panel_information_widget": [20.0, 0.0], "action_panel_information_widget": [20.0, 0.0],
"action_panel_button": [15.0, 3.0],
"machine_selector_widget": [20.0, 4.0], "machine_selector_widget": [20.0, 4.0],
"machine_selector_widget_content": [25.0, 32.0], "machine_selector_widget_content": [25.0, 32.0],
@ -423,6 +410,9 @@
"button_icon": [2.5, 2.5], "button_icon": [2.5, 2.5],
"button_lining": [0, 0], "button_lining": [0, 0],
"action_button": [15.0, 3.0],
"action_button_radius": [0.15, 0.15],
"small_button": [2, 2], "small_button": [2, 2],
"small_button_icon": [1.5, 1.5], "small_button_icon": [1.5, 1.5],
@ -511,9 +501,6 @@
"avatar_image": [6.8, 6.8], "avatar_image": [6.8, 6.8],
"action_button": [15.0, 3.0],
"action_button_radius": [0.15, 0.15],
"monitor_config_override_box": [1.0, 14.0], "monitor_config_override_box": [1.0, 14.0],
"monitor_extruder_circle": [2.75, 2.75], "monitor_extruder_circle": [2.75, 2.75],
"monitor_text_line": [1.16, 1.16], "monitor_text_line": [1.16, 1.16],