mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-16 03:07:53 -06:00
Merge branch 'CURA-5876-Configuration_dropdown' into ui_rework_4_0
This commit is contained in:
commit
024bf409c9
65 changed files with 759 additions and 1099 deletions
|
@ -63,7 +63,7 @@ class ExtruderManager(QObject):
|
|||
if not self._application.getGlobalContainerStack():
|
||||
return None # No active machine, so no active extruder.
|
||||
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.
|
||||
return None
|
||||
|
||||
|
@ -144,7 +144,7 @@ class ExtruderManager(QObject):
|
|||
|
||||
@pyqtSlot(result = QObject)
|
||||
def getActiveExtruderStack(self) -> Optional["ExtruderStack"]:
|
||||
return self.getExtruderStack(self._active_extruder_index)
|
||||
return self.getExtruderStack(self.activeExtruderIndex)
|
||||
|
||||
## Get an extruder stack by index
|
||||
def getExtruderStack(self, index) -> Optional["ExtruderStack"]:
|
||||
|
|
|
@ -52,8 +52,8 @@ class ExtruderStack(CuraContainerStack):
|
|||
return super().getNextStack()
|
||||
|
||||
def setEnabled(self, enabled: bool) -> None:
|
||||
if "enabled" not in self._metadata:
|
||||
self.setMetaDataEntry("enabled", "True")
|
||||
if self.getMetaDataEntry("enabled", True) == enabled: #No change.
|
||||
return #Don't emit a signal then.
|
||||
self.setMetaDataEntry("enabled", str(enabled))
|
||||
self.enabledChanged.emit()
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
||||
from PyQt5.QtCore import Qt, pyqtSignal, pyqtSlot, pyqtProperty, QTimer
|
||||
|
@ -165,7 +165,7 @@ class ExtrudersModel(UM.Qt.ListModel.ListModel):
|
|||
def __updateExtruders(self):
|
||||
extruders_changed = False
|
||||
|
||||
if self.rowCount() != 0:
|
||||
if self.count != 0:
|
||||
extruders_changed = True
|
||||
|
||||
items = []
|
||||
|
@ -177,7 +177,7 @@ class ExtrudersModel(UM.Qt.ListModel.ListModel):
|
|||
machine_extruder_count = global_container_stack.getProperty("machine_extruder_count", "value")
|
||||
|
||||
for extruder in Application.getInstance().getExtruderManager().getActiveExtruderStacks():
|
||||
position = extruder.getMetaDataEntry("position", default = "0") # Get the position
|
||||
position = extruder.getMetaDataEntry("position", default = "0")
|
||||
try:
|
||||
position = int(position)
|
||||
except ValueError:
|
||||
|
|
|
@ -874,7 +874,7 @@ class MachineManager(QObject):
|
|||
caution_message = Message(catalog.i18nc(
|
||||
"@info:generic",
|
||||
"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"))
|
||||
caution_message.show()
|
||||
|
||||
|
@ -1553,7 +1553,7 @@ class MachineManager(QObject):
|
|||
elif word.isdigit():
|
||||
abbr_machine += word
|
||||
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 the whole word if it's not too long (<= 3 characters)
|
||||
if len(stripped_word) > 3:
|
||||
|
|
|
@ -195,7 +195,7 @@ class ProcessSlicedLayersJob(Job):
|
|||
if extruders:
|
||||
material_color_map = numpy.zeros((len(extruders), 4), dtype=numpy.float32)
|
||||
for extruder in extruders:
|
||||
position = int(extruder.getMetaDataEntry("position", default="0")) # Get the position
|
||||
position = int(extruder.getMetaDataEntry("position", default = "0"))
|
||||
try:
|
||||
default_color = ExtrudersModel.defaultColors[position]
|
||||
except IndexError:
|
||||
|
|
|
@ -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.
|
||||
|
||||
import QtQuick 2.2
|
||||
|
@ -23,7 +23,7 @@ Cura.MachineAction
|
|||
target: base.extrudersModel
|
||||
onModelChanged:
|
||||
{
|
||||
var extruderCount = base.extrudersModel.rowCount();
|
||||
var extruderCount = base.extrudersModel.count;
|
||||
base.extruderTabsCount = extruderCount;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,7 +33,6 @@ Button
|
|||
{
|
||||
width: UM.Theme.getSize("save_button_specs_icons").width;
|
||||
height: UM.Theme.getSize("save_button_specs_icons").height;
|
||||
sourceSize.width: width;
|
||||
sourceSize.height: width;
|
||||
color: control.hovered ? UM.Theme.getColor("text_scene_hover") : UM.Theme.getColor("text_scene");
|
||||
source: "model_checker.svg"
|
||||
|
|
|
@ -265,7 +265,6 @@ Item {
|
|||
anchors.verticalCenter: parent.verticalCenter
|
||||
width: parent.width
|
||||
height: width
|
||||
sourceSize.width: width
|
||||
sourceSize.height: width
|
||||
color: control.hovered ? UM.Theme.getColor("setting_control_button_hover") : UM.Theme.getColor("setting_control_button")
|
||||
source: UM.Theme.getIcon("minus")
|
||||
|
|
|
@ -141,7 +141,6 @@ UM.Dialog
|
|||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: Math.round(control.width / 2.7)
|
||||
height: Math.round(control.height / 2.7)
|
||||
sourceSize.width: width
|
||||
sourceSize.height: width
|
||||
color: palette.text
|
||||
source: UM.Theme.getIcon("cross1")
|
||||
|
@ -176,7 +175,6 @@ UM.Dialog
|
|||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: Math.round(control.width / 2.5)
|
||||
height: Math.round(control.height / 2.5)
|
||||
sourceSize.width: width
|
||||
sourceSize.height: width
|
||||
color: control.enabled ? palette.text : disabledPalette.text
|
||||
source: UM.Theme.getIcon("arrow_bottom")
|
||||
|
@ -211,7 +209,6 @@ UM.Dialog
|
|||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: Math.round(control.width / 2.5)
|
||||
height: Math.round(control.height / 2.5)
|
||||
sourceSize.width: width
|
||||
sourceSize.height: width
|
||||
color: control.enabled ? palette.text : disabledPalette.text
|
||||
source: UM.Theme.getIcon("arrow_top")
|
||||
|
@ -498,7 +495,6 @@ UM.Dialog
|
|||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: Math.round(parent.width / 2)
|
||||
height: Math.round(parent.height / 2)
|
||||
sourceSize.width: width
|
||||
sourceSize.height: height
|
||||
color: !control.enabled ? UM.Theme.getColor("action_button_disabled_text") :
|
||||
control.pressed ? UM.Theme.getColor("action_button_active_text") :
|
||||
|
|
|
@ -61,7 +61,7 @@ Item
|
|||
color: UM.Theme.getColor("lining")
|
||||
}
|
||||
|
||||
Cura.QuickConfigurationSelector
|
||||
Cura.ConfigurationMenu
|
||||
{
|
||||
Layout.fillHeight: true
|
||||
Layout.fillWidth: true
|
||||
|
@ -107,7 +107,6 @@ Item
|
|||
height: UM.Theme.getSize("button_icon").height
|
||||
color: UM.Theme.getColor("toolbar_button_text")
|
||||
|
||||
sourceSize.width: width
|
||||
sourceSize.height: height
|
||||
}
|
||||
}
|
||||
|
|
|
@ -86,13 +86,13 @@ Item
|
|||
Label
|
||||
{
|
||||
text: catalog.i18nc("@label", "Website") + ":"
|
||||
font: UM.Theme.getFont("very_small")
|
||||
font: UM.Theme.getFont("default")
|
||||
color: UM.Theme.getColor("text_medium")
|
||||
}
|
||||
Label
|
||||
{
|
||||
text: catalog.i18nc("@label", "Email") + ":"
|
||||
font: UM.Theme.getFont("very_small")
|
||||
font: UM.Theme.getFont("default")
|
||||
color: UM.Theme.getColor("text_medium")
|
||||
}
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ Item
|
|||
}
|
||||
return ""
|
||||
}
|
||||
font: UM.Theme.getFont("very_small")
|
||||
font: UM.Theme.getFont("default")
|
||||
color: UM.Theme.getColor("text")
|
||||
linkColor: UM.Theme.getColor("text_link")
|
||||
onLinkActivated: Qt.openUrlExternally(link)
|
||||
|
@ -134,7 +134,7 @@ Item
|
|||
}
|
||||
return ""
|
||||
}
|
||||
font: UM.Theme.getFont("very_small")
|
||||
font: UM.Theme.getFont("default")
|
||||
color: UM.Theme.getColor("text")
|
||||
linkColor: UM.Theme.getColor("text_link")
|
||||
onLinkActivated: Qt.openUrlExternally(link)
|
||||
|
|
|
@ -228,7 +228,7 @@ Item
|
|||
|
||||
return result
|
||||
}
|
||||
font: UM.Theme.getFont("very_small")
|
||||
font: UM.Theme.getFont("default")
|
||||
color: UM.Theme.getColor("text")
|
||||
linkColor: UM.Theme.getColor("text_link")
|
||||
onLinkActivated: Qt.openUrlExternally(link)
|
||||
|
|
|
@ -82,25 +82,25 @@ Item
|
|||
Label
|
||||
{
|
||||
text: catalog.i18nc("@label", "Version") + ":"
|
||||
font: UM.Theme.getFont("very_small")
|
||||
font: UM.Theme.getFont("default")
|
||||
color: UM.Theme.getColor("text_medium")
|
||||
}
|
||||
Label
|
||||
{
|
||||
text: catalog.i18nc("@label", "Last updated") + ":"
|
||||
font: UM.Theme.getFont("very_small")
|
||||
font: UM.Theme.getFont("default")
|
||||
color: UM.Theme.getColor("text_medium")
|
||||
}
|
||||
Label
|
||||
{
|
||||
text: catalog.i18nc("@label", "Author") + ":"
|
||||
font: UM.Theme.getFont("very_small")
|
||||
font: UM.Theme.getFont("default")
|
||||
color: UM.Theme.getColor("text_medium")
|
||||
}
|
||||
Label
|
||||
{
|
||||
text: catalog.i18nc("@label", "Downloads") + ":"
|
||||
font: UM.Theme.getFont("very_small")
|
||||
font: UM.Theme.getFont("default")
|
||||
color: UM.Theme.getColor("text_medium")
|
||||
}
|
||||
}
|
||||
|
@ -119,7 +119,7 @@ Item
|
|||
Label
|
||||
{
|
||||
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")
|
||||
}
|
||||
Label
|
||||
|
@ -133,7 +133,7 @@ Item
|
|||
var date = new Date(details.last_updated)
|
||||
return date.toLocaleString(UM.Preferences.getValue("general/language"))
|
||||
}
|
||||
font: UM.Theme.getFont("very_small")
|
||||
font: UM.Theme.getFont("default")
|
||||
color: UM.Theme.getColor("text")
|
||||
}
|
||||
Label
|
||||
|
@ -149,7 +149,7 @@ Item
|
|||
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")
|
||||
linkColor: UM.Theme.getColor("text_link")
|
||||
onLinkActivated: Qt.openUrlExternally(link)
|
||||
|
@ -157,7 +157,7 @@ Item
|
|||
Label
|
||||
{
|
||||
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")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,7 +52,6 @@ Item
|
|||
bottom: parent.bottom
|
||||
right: parent.right
|
||||
}
|
||||
sourceSize.width: width
|
||||
sourceSize.height: height
|
||||
visible: installedPackages != 0
|
||||
color: (installedPackages == packageCount) ? UM.Theme.getColor("primary") : UM.Theme.getColor("border")
|
||||
|
@ -81,7 +80,7 @@ Item
|
|||
width: parent.width
|
||||
wrapMode: Text.WordWrap
|
||||
color: UM.Theme.getColor("text_medium")
|
||||
font: UM.Theme.getFont("very_small")
|
||||
font: UM.Theme.getFont("default")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,8 +48,6 @@ Rectangle
|
|||
right: parent.right
|
||||
bottomMargin: UM.Theme.getSize("default_lining").width
|
||||
}
|
||||
sourceSize.width: width
|
||||
sourceSize.height: height
|
||||
visible: installedPackages != 0
|
||||
color: (installedPackages == packageCount) ? UM.Theme.getColor("primary") : UM.Theme.getColor("border")
|
||||
source: "../images/installed_check.svg"
|
||||
|
|
|
@ -52,7 +52,7 @@ Item
|
|||
id: buildplateLabel
|
||||
color: "#191919" // TODO: Theme!
|
||||
elide: Text.ElideRight
|
||||
font: UM.Theme.getFont("very_small") // 12pt, regular
|
||||
font: UM.Theme.getFont("default") // 12pt, regular
|
||||
text: ""
|
||||
|
||||
// FIXED-LINE-HEIGHT:
|
||||
|
|
|
@ -49,7 +49,7 @@ Item
|
|||
}
|
||||
color: "#191919" // TODO: Theme!
|
||||
elide: Text.ElideRight
|
||||
font: UM.Theme.getFont("very_small") // 12pt, regular
|
||||
font: UM.Theme.getFont("default") // 12pt, regular
|
||||
text: ""
|
||||
|
||||
// FIXED-LINE-HEIGHT:
|
||||
|
@ -66,7 +66,7 @@ Item
|
|||
}
|
||||
color: "#191919" // TODO: Theme!
|
||||
elide: Text.ElideRight
|
||||
font: UM.Theme.getFont("small") // 12pt, bold
|
||||
font: UM.Theme.getFont("default_bold") // 12pt, bold
|
||||
text: ""
|
||||
|
||||
// FIXED-LINE-HEIGHT:
|
||||
|
|
|
@ -11,7 +11,8 @@ import UM 1.1 as UM
|
|||
Button
|
||||
{
|
||||
id: button
|
||||
property alias iconSource: buttonIcon.source
|
||||
property alias iconSource: buttonIconLeft.source
|
||||
property bool isIconOnRightSide: false
|
||||
property alias textFont: buttonText.font
|
||||
property alias cornerRadius: backgroundRect.radius
|
||||
property alias tooltip: tooltip.text
|
||||
|
@ -36,18 +37,21 @@ Button
|
|||
// 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
|
||||
|
||||
leftPadding: UM.Theme.getSize("default_margin").width
|
||||
rightPadding: UM.Theme.getSize("default_margin").width
|
||||
height: UM.Theme.getSize("action_button").height
|
||||
|
||||
contentItem: Row
|
||||
{
|
||||
//Left side icon. Only displayed if !isIconOnRightSide.
|
||||
UM.RecolorImage
|
||||
{
|
||||
id: buttonIcon
|
||||
id: buttonIconLeft
|
||||
source: ""
|
||||
height: Math.round(0.6 * parent.height)
|
||||
width: height
|
||||
sourceSize.width: width
|
||||
sourceSize.height: height
|
||||
height: buttonText.height
|
||||
width: visible ? height : 0
|
||||
color: button.hovered ? button.textHoverColor : button.textColor
|
||||
visible: source != ""
|
||||
visible: source != "" && !button.isIconOnRightSide
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
|
@ -64,6 +68,18 @@ Button
|
|||
horizontalAlignment: Text.AlignHCenter
|
||||
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
|
||||
|
|
|
@ -51,6 +51,8 @@ Item
|
|||
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")
|
||||
iconSource: popup.opened ? UM.Theme.getIcon("arrow_top") : UM.Theme.getIcon("arrow_bottom")
|
||||
color: UM.Theme.getColor("action_panel_secondary")
|
||||
|
|
|
@ -51,7 +51,7 @@ Column
|
|||
|
||||
text: preSlicedData ? catalog.i18nc("@label", "No time estimation available") : PrintInformation.currentPrintTime.getDisplayString(UM.DurationFormat.Long)
|
||||
source: UM.Theme.getIcon("clock")
|
||||
font: UM.Theme.getFont("small")
|
||||
font: UM.Theme.getFont("default_bold")
|
||||
}
|
||||
|
||||
Cura.IconLabel
|
||||
|
@ -84,7 +84,7 @@ Column
|
|||
return totalWeights + "g · " + totalLengths.toFixed(2) + "m"
|
||||
}
|
||||
source: UM.Theme.getIcon("spool")
|
||||
font: UM.Theme.getFont("very_small")
|
||||
font: UM.Theme.getFont("default")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -111,7 +111,7 @@ Column
|
|||
{
|
||||
id: previewStageShortcut
|
||||
|
||||
height: UM.Theme.getSize("action_panel_button").height
|
||||
height: UM.Theme.getSize("action_button").height
|
||||
leftPadding: UM.Theme.getSize("default_margin").width
|
||||
rightPadding: UM.Theme.getSize("default_margin").width
|
||||
text: catalog.i18nc("@button", "Preview")
|
||||
|
@ -125,8 +125,8 @@ Column
|
|||
|
||||
Cura.OutputDevicesActionButton
|
||||
{
|
||||
width: previewStageShortcut.visible ? UM.Theme.getSize("action_panel_button").width : parent.width
|
||||
height: UM.Theme.getSize("action_panel_button").height
|
||||
width: previewStageShortcut.visible ? UM.Theme.getSize("action_button").width : parent.width
|
||||
height: UM.Theme.getSize("action_button").height
|
||||
}
|
||||
}
|
||||
}
|
|
@ -15,9 +15,6 @@ UM.RecolorImage
|
|||
width: UM.Theme.getSize("section_icon").width
|
||||
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")
|
||||
|
||||
MouseArea
|
||||
|
|
|
@ -30,7 +30,7 @@ Column
|
|||
{
|
||||
text: catalog.i18nc("@label", "Time specification").toUpperCase()
|
||||
color: UM.Theme.getColor("primary")
|
||||
font: UM.Theme.getFont("small")
|
||||
font: UM.Theme.getFont("default_bold")
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
|
||||
|
@ -61,7 +61,7 @@ Column
|
|||
}
|
||||
width: parent.width - 2 * UM.Theme.getSize("default_margin").width
|
||||
color: UM.Theme.getColor("text")
|
||||
font: UM.Theme.getFont("very_small")
|
||||
font: UM.Theme.getFont("default")
|
||||
renderType: Text.NativeRendering
|
||||
textFormat: Text.RichText
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ Column
|
|||
{
|
||||
text: catalog.i18nc("@label", "Material specification").toUpperCase()
|
||||
color: UM.Theme.getColor("primary")
|
||||
font: UM.Theme.getFont("small")
|
||||
font: UM.Theme.getFont("default_bold")
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
|
||||
|
@ -151,7 +151,7 @@ Column
|
|||
}
|
||||
width: parent.width - 2 * UM.Theme.getSize("default_margin").width
|
||||
color: UM.Theme.getColor("text")
|
||||
font: UM.Theme.getFont("very_small")
|
||||
font: UM.Theme.getFont("default")
|
||||
renderType: Text.NativeRendering
|
||||
textFormat: Text.RichText
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ Column
|
|||
|
||||
text: catalog.i18nc("@label:PrintjobStatus", "Auto slicing...")
|
||||
color: UM.Theme.getColor("text")
|
||||
font: UM.Theme.getFont("very_small")
|
||||
font: UM.Theme.getFont("default")
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
|
||||
|
@ -61,7 +61,7 @@ Column
|
|||
text: catalog.i18nc("@label:PrintjobStatus", "Unable to Slice")
|
||||
source: UM.Theme.getIcon("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
|
||||
|
@ -94,7 +94,6 @@ Column
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
Item
|
||||
{
|
||||
id: prepareButtons
|
||||
|
@ -103,7 +102,7 @@ Column
|
|||
// Disable the slice process when
|
||||
|
||||
width: parent.width
|
||||
height: UM.Theme.getSize("action_panel_button").height
|
||||
height: UM.Theme.getSize("action_button").height
|
||||
visible: !autoSlice
|
||||
Cura.PrimaryButton
|
||||
{
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -39,8 +39,6 @@ UM.Dialog
|
|||
|
||||
source: UM.Theme.getImage("logo")
|
||||
|
||||
sourceSize.width: width
|
||||
sourceSize.height: height
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: ((base.minimumWidth - width) / 2) | 0
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
|
|
@ -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.
|
||||
|
||||
import QtQuick 2.2
|
||||
|
@ -156,7 +156,6 @@ UM.Dialog
|
|||
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: width
|
||||
color: palette.windowText
|
||||
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)
|
||||
{
|
||||
// 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);
|
||||
if (item.section == section)
|
||||
|
|
|
@ -139,8 +139,6 @@ Item
|
|||
verticalCenter: parent.verticalCenter
|
||||
margins: background.padding
|
||||
}
|
||||
sourceSize.width: width
|
||||
sourceSize.height: height
|
||||
visible: source != ""
|
||||
width: height
|
||||
height: Math.round(0.2 * base.height)
|
||||
|
|
|
@ -22,8 +22,6 @@ Item
|
|||
id: mainIcon
|
||||
anchors.fill: parent
|
||||
|
||||
sourceSize.width: parent.width
|
||||
sourceSize.height: parent.height
|
||||
source: UM.Theme.getIcon("extruder_button")
|
||||
color: extruderEnabled ? materialColor: "gray"
|
||||
}
|
||||
|
@ -50,7 +48,9 @@ Item
|
|||
id: extruderNumberText
|
||||
anchors.centerIn: parent
|
||||
text: index + 1
|
||||
font: UM.Theme.getFont("extruder_icon")
|
||||
font: UM.Theme.getFont("very_small")
|
||||
width: contentWidth
|
||||
height: contentHeight
|
||||
visible: extruderEnabled
|
||||
renderType: Text.NativeRendering
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
|
@ -62,7 +62,6 @@ Item
|
|||
id: disabledIcon
|
||||
anchors.fill: parent
|
||||
anchors.margins: UM.Theme.getSize("thick_lining").width
|
||||
sourceSize.width: width
|
||||
sourceSize.height: width
|
||||
source: UM.Theme.getIcon("cross1")
|
||||
visible: !extruderEnabled
|
||||
|
|
|
@ -31,9 +31,6 @@ Item
|
|||
width: UM.Theme.getSize("section_icon").width
|
||||
height: width
|
||||
|
||||
sourceSize.width: width
|
||||
sourceSize.height: height
|
||||
|
||||
color: label.color
|
||||
visible: source != ""
|
||||
}
|
||||
|
@ -48,7 +45,7 @@ Item
|
|||
text: "Empty label"
|
||||
elide: Text.ElideRight
|
||||
color: UM.Theme.getColor("text")
|
||||
font: UM.Theme.getFont("very_small")
|
||||
font: UM.Theme.getFont("default")
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
}
|
|
@ -37,8 +37,6 @@ Item
|
|||
width: UM.Theme.getSize("section_icon").width
|
||||
height: UM.Theme.getSize("section_icon").height
|
||||
|
||||
sourceSize.width: width
|
||||
sourceSize.height: height
|
||||
color: "black"
|
||||
|
||||
anchors
|
||||
|
|
|
@ -60,7 +60,6 @@ Item {
|
|||
{
|
||||
width: UM.Theme.getSize("save_button_specs_icons").width;
|
||||
height: UM.Theme.getSize("save_button_specs_icons").height;
|
||||
sourceSize.width: width;
|
||||
sourceSize.height: width;
|
||||
color: control.hovered ? UM.Theme.getColor("text_scene_hover") : UM.Theme.getColor("text_scene");
|
||||
source: UM.Theme.getIcon("pencil");
|
||||
|
@ -124,7 +123,7 @@ Item {
|
|||
}
|
||||
height: UM.Theme.getSize("jobspecs_line").height
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
font: UM.Theme.getFont("small")
|
||||
font: UM.Theme.getFont("default_bold")
|
||||
color: UM.Theme.getColor("text_scene")
|
||||
text: CuraApplication.getSceneBoundingBoxString
|
||||
}
|
||||
|
|
|
@ -54,9 +54,6 @@ Rectangle
|
|||
source: UM.Theme.getImage("logo")
|
||||
width: UM.Theme.getSize("logo").width
|
||||
height: UM.Theme.getSize("logo").height
|
||||
|
||||
sourceSize.width: width
|
||||
sourceSize.height: height
|
||||
}
|
||||
|
||||
Row
|
||||
|
|
38
resources/qml/Menus/ConfigurationMenu/AutoConfiguration.qml
Normal file
38
resources/qml/Menus/ConfigurationMenu/AutoConfiguration.qml
Normal file
|
@ -0,0 +1,38 @@
|
|||
// 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: visible ? childrenRect.height : 0
|
||||
|
||||
Label
|
||||
{
|
||||
id: header
|
||||
text: catalog.i18nc("@header", "Configurations")
|
||||
font: UM.Theme.getFont("large")
|
||||
color: UM.Theme.getColor("text")
|
||||
height: contentHeight
|
||||
|
||||
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
|
||||
}
|
||||
}
|
|
@ -7,143 +7,129 @@ import QtQuick.Controls 2.0
|
|||
import UM 1.2 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
Rectangle
|
||||
Button
|
||||
{
|
||||
id: configurationItem
|
||||
|
||||
property var configuration: null
|
||||
property var selected: false
|
||||
signal activateConfiguration()
|
||||
hoverEnabled: true
|
||||
|
||||
height: childrenRect.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
|
||||
{
|
||||
id: contentColumn
|
||||
width: parent.width
|
||||
padding: UM.Theme.getSize("default_margin").width
|
||||
spacing: Math.round(UM.Theme.getSize("default_margin").height / 2)
|
||||
|
||||
Row
|
||||
Column
|
||||
{
|
||||
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
|
||||
height: childrenRect.height
|
||||
|
||||
spacing: UM.Theme.getSize("default_margin").width
|
||||
|
||||
Repeater
|
||||
Row
|
||||
{
|
||||
id: repeater
|
||||
height: childrenRect.height
|
||||
model: configuration.extruderConfigurations
|
||||
delegate: PrintCoreConfiguration
|
||||
id: extruderRow
|
||||
|
||||
anchors
|
||||
{
|
||||
width: Math.round(parent.width / 2)
|
||||
printCoreConfiguration: modelData
|
||||
mainColor: textColor
|
||||
left: parent.left
|
||||
leftMargin: parent.padding
|
||||
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
|
||||
Rectangle
|
||||
Connections
|
||||
{
|
||||
id: separator
|
||||
|
||||
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
|
||||
target: Cura.MachineManager
|
||||
onCurrentConfigurationChanged:
|
||||
{
|
||||
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: textColor
|
||||
configurationItem.checked = Cura.MachineManager.matchesConfiguration(configuration)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea
|
||||
{
|
||||
id: mouse
|
||||
anchors.fill: parent
|
||||
onClicked: activateConfiguration()
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
hoverEnabled: true
|
||||
onEntered:
|
||||
Component.onCompleted:
|
||||
{
|
||||
parent.border.color = UM.Theme.getColor("configuration_item_border_hover")
|
||||
if (configurationItem.selected == false)
|
||||
{
|
||||
configurationItem.color = UM.Theme.getColor("wide_lining")
|
||||
}
|
||||
}
|
||||
onExited:
|
||||
{
|
||||
updateBorderColor()
|
||||
if (configurationItem.selected == false)
|
||||
{
|
||||
configurationItem.color = UM.Theme.getColor("configuration_item")
|
||||
}
|
||||
configurationItem.checked = Cura.MachineManager.matchesConfiguration(configuration)
|
||||
}
|
||||
}
|
||||
|
||||
Connections
|
||||
onClicked:
|
||||
{
|
||||
target: Cura.MachineManager
|
||||
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")
|
||||
}
|
||||
Cura.MachineManager.applyRemoteConfiguration(configuration)
|
||||
}
|
||||
}
|
|
@ -2,8 +2,7 @@
|
|||
// 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 QtQuick.Controls 2.3
|
||||
|
||||
import UM 1.2 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
@ -12,9 +11,7 @@ Column
|
|||
{
|
||||
id: base
|
||||
property var outputDevice: null
|
||||
property var computedHeight: container.height + configurationListHeading.height + 3 * padding
|
||||
height: childrenRect.height + 2 * padding
|
||||
padding: UM.Theme.getSize("default_margin").width
|
||||
spacing: Math.round(UM.Theme.getSize("default_margin").height / 2)
|
||||
|
||||
function forceModelUpdate()
|
||||
|
@ -27,38 +24,16 @@ 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
|
||||
{
|
||||
id: container
|
||||
width: parent.width - parent.padding
|
||||
width: parent.width
|
||||
height: Math.min(configurationList.contentHeight, 350 * screenScaleFactor)
|
||||
|
||||
style: UM.Theme.styles.scrollview
|
||||
__wheelAreaScrollSpeed: 75 // Scroll three lines in one scroll event
|
||||
ButtonGroup
|
||||
{
|
||||
buttons: configurationList.children
|
||||
}
|
||||
|
||||
ListView
|
||||
{
|
||||
|
@ -69,18 +44,22 @@ Column
|
|||
|
||||
section.property: "modelData.printerType"
|
||||
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 : []
|
||||
|
||||
delegate: ConfigurationItem
|
||||
{
|
||||
width: parent.width - UM.Theme.getSize("default_margin").width
|
||||
width: parent.width
|
||||
configuration: modelData
|
||||
onActivateConfiguration:
|
||||
{
|
||||
switchPopupState()
|
||||
Cura.MachineManager.applyRemoteConfiguration(configuration)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
182
resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml
Normal file
182
resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml
Normal file
|
@ -0,0 +1,182 @@
|
|||
// 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
|
||||
|
||||
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")
|
||||
|
||||
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: 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
|
||||
|
||||
width: parent.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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
246
resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml
Normal file
246
resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml
Normal file
|
@ -0,0 +1,246 @@
|
|||
// 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: visible ? childrenRect.height : 0
|
||||
|
||||
Label
|
||||
{
|
||||
id: header
|
||||
text: catalog.i18nc("@header", "Custom")
|
||||
font: UM.Theme.getFont("large")
|
||||
color: UM.Theme.getColor("text")
|
||||
height: contentHeight
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
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 }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -5,87 +5,50 @@ import QtQuick 2.7
|
|||
import QtQuick.Controls 2.0
|
||||
|
||||
import UM 1.2 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
|
||||
Column
|
||||
Row
|
||||
{
|
||||
id: extruderInfo
|
||||
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
|
||||
width: parent.width
|
||||
height: childrenRect.height
|
||||
materialColor: printCoreConfiguration.material.color
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
extruderEnabled: printCoreConfiguration.material.name !== "" && printCoreConfiguration.hotendID !== ""
|
||||
}
|
||||
|
||||
Column
|
||||
{
|
||||
id: information
|
||||
Label
|
||||
{
|
||||
id: extruderLabel
|
||||
text: catalog.i18nc("@label:extruder label", "Extruder")
|
||||
text: printCoreConfiguration.material.brand ? printCoreConfiguration.material.brand : " " //Use space so that the height is still correct.
|
||||
renderType: Text.NativeRendering
|
||||
elide: Text.ElideRight
|
||||
anchors.left: parent.left
|
||||
font: UM.Theme.getFont("default")
|
||||
color: mainColor
|
||||
color: UM.Theme.getColor("text_inactive")
|
||||
}
|
||||
|
||||
// Rounded item to show the extruder number
|
||||
Item
|
||||
Label
|
||||
{
|
||||
id: extruderIconItem
|
||||
anchors.verticalCenter: extruderLabel.verticalCenter
|
||||
anchors.left: extruderLabel.right
|
||||
anchors.leftMargin: Math.round(UM.Theme.getSize("default_margin").width / 2)
|
||||
|
||||
width: UM.Theme.getSize("section_icon").width
|
||||
height: UM.Theme.getSize("section_icon").height
|
||||
|
||||
UM.RecolorImage {
|
||||
id: mainCircle
|
||||
anchors.fill: parent
|
||||
|
||||
anchors.centerIn: parent
|
||||
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
|
||||
}
|
||||
text: printCoreConfiguration.material.name ? printCoreConfiguration.material.name : " " //Use space so that the height is still correct.
|
||||
renderType: Text.NativeRendering
|
||||
elide: Text.ElideRight
|
||||
font: UM.Theme.getFont("default")
|
||||
color: UM.Theme.getColor("text")
|
||||
}
|
||||
Label
|
||||
{
|
||||
text: printCoreConfiguration.hotendID ? printCoreConfiguration.hotendID : " " //Use space so that the height is still correct.
|
||||
renderType: Text.NativeRendering
|
||||
elide: Text.ElideRight
|
||||
font: UM.Theme.getFont("default")
|
||||
color: UM.Theme.getColor("text_inactive")
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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()
|
||||
}
|
||||
}
|
|
@ -37,7 +37,7 @@ Menu
|
|||
MenuSeparator
|
||||
{
|
||||
id: customSeparator
|
||||
visible: Cura.CustomQualityProfilesDropDownMenuModel.rowCount > 0
|
||||
visible: Cura.CustomQualityProfilesDropDownMenuModel.count > 0
|
||||
}
|
||||
|
||||
Instantiator
|
||||
|
@ -48,7 +48,7 @@ Menu
|
|||
Connections
|
||||
{
|
||||
target: Cura.CustomQualityProfilesDropDownMenuModel
|
||||
onModelReset: customSeparator.visible = Cura.CustomQualityProfilesDropDownMenuModel.rowCount() > 0
|
||||
onModelReset: customSeparator.visible = Cura.CustomQualityProfilesDropDownMenuModel.count > 0
|
||||
}
|
||||
|
||||
MenuItem
|
||||
|
@ -62,12 +62,12 @@ Menu
|
|||
|
||||
onObjectAdded:
|
||||
{
|
||||
customSeparator.visible = model.rowCount() > 0;
|
||||
customSeparator.visible = model.count > 0;
|
||||
menu.insertItem(index, object);
|
||||
}
|
||||
onObjectRemoved:
|
||||
{
|
||||
customSeparator.visible = model.rowCount() > 0;
|
||||
customSeparator.visible = model.count > 0;
|
||||
menu.removeItem(object);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
|
||||
import QtQuick 2.2
|
||||
|
@ -55,7 +55,6 @@ Rectangle
|
|||
{
|
||||
width: control.width
|
||||
height: control.height
|
||||
sourceSize.width: width
|
||||
sourceSize.height: width
|
||||
color: UM.Theme.getColor("setting_control_text")
|
||||
source: collapsed ? UM.Theme.getIcon("arrow_left") : UM.Theme.getIcon("arrow_bottom")
|
||||
|
|
|
@ -21,8 +21,10 @@ UM.ManagementPage
|
|||
|
||||
function activeMachineIndex()
|
||||
{
|
||||
for(var i = 0; i < model.rowCount(); i++) {
|
||||
if (model.getItem(i).id == Cura.MachineManager.activeMachineId) {
|
||||
for(var i = 0; i < model.count; i++)
|
||||
{
|
||||
if (model.getItem(i).id == Cura.MachineManager.activeMachineId)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
@ -47,7 +49,7 @@ UM.ManagementPage
|
|||
{
|
||||
text: catalog.i18nc("@action:button", "Remove");
|
||||
iconName: "list-remove";
|
||||
enabled: base.currentItem != null && model.rowCount() > 1
|
||||
enabled: base.currentItem != null && model.count > 1
|
||||
onClicked: confirmDialog.open();
|
||||
},
|
||||
Button
|
||||
|
|
|
@ -55,7 +55,8 @@ Rectangle
|
|||
text: ""
|
||||
implicitWidth: UM.Theme.getSize("favorites_button").width
|
||||
implicitHeight: UM.Theme.getSize("favorites_button").height
|
||||
UM.RecolorImage {
|
||||
UM.RecolorImage
|
||||
{
|
||||
anchors
|
||||
{
|
||||
verticalCenter: parent.verticalCenter
|
||||
|
@ -63,8 +64,6 @@ Rectangle
|
|||
}
|
||||
width: UM.Theme.getSize("standard_arrow").width
|
||||
height: UM.Theme.getSize("standard_arrow").height
|
||||
sourceSize.width: width
|
||||
sourceSize.height: height
|
||||
color: "black"
|
||||
source: brand_section.expanded ? UM.Theme.getIcon("arrow_bottom") : UM.Theme.getIcon("arrow_left")
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ Item
|
|||
var currentItemId = base.currentItem == null ? "" : base.currentItem.root_material_id
|
||||
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)
|
||||
if (material.root_material_id == search_root_id)
|
||||
|
@ -72,15 +72,15 @@ Item
|
|||
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 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 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)
|
||||
if (material.root_material_id == search_root_id)
|
||||
|
|
|
@ -95,8 +95,6 @@ Rectangle
|
|||
}
|
||||
width: UM.Theme.getSize("favorites_button_icon").width
|
||||
height: UM.Theme.getSize("favorites_button_icon").height
|
||||
sourceSize.width: width
|
||||
sourceSize.height: height
|
||||
color:
|
||||
{
|
||||
if (favorite_button.hovered)
|
||||
|
|
|
@ -74,8 +74,6 @@ Rectangle
|
|||
}
|
||||
width: UM.Theme.getSize("standard_arrow").width
|
||||
height: UM.Theme.getSize("standard_arrow").height
|
||||
sourceSize.width: width
|
||||
sourceSize.height: height
|
||||
color: "black"
|
||||
source: material_type_section.expanded ? UM.Theme.getIcon("arrow_bottom") : UM.Theme.getIcon("arrow_left")
|
||||
}
|
||||
|
|
|
@ -188,21 +188,27 @@ Item
|
|||
Connections
|
||||
{
|
||||
target: qualitiesModel
|
||||
onItemsChanged: {
|
||||
onItemsChanged:
|
||||
{
|
||||
var toSelectItemName = base.currentItem == null ? "" : base.currentItem.name;
|
||||
if (newQualityNameToSelect != "") {
|
||||
if (newQualityNameToSelect != "")
|
||||
{
|
||||
toSelectItemName = newQualityNameToSelect;
|
||||
}
|
||||
|
||||
var newIdx = -1; // Default to nothing if nothing can be found
|
||||
if (toSelectItemName != "") {
|
||||
if (toSelectItemName != "")
|
||||
{
|
||||
// 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);
|
||||
if (item.name == toSelectItemName) {
|
||||
if (item.name == toSelectItemName)
|
||||
{
|
||||
// Switch to the newly created profile if needed
|
||||
newIdx = idx;
|
||||
if (base.toActivateNewQuality) {
|
||||
if (base.toActivateNewQuality)
|
||||
{
|
||||
// Activate this custom quality if required
|
||||
Cura.MachineManager.setQualityChangesGroup(item.quality_changes_group);
|
||||
}
|
||||
|
@ -382,9 +388,11 @@ Item
|
|||
var selectedItemName = Cura.MachineManager.activeQualityOrQualityChangesName;
|
||||
|
||||
// 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);
|
||||
if (item.name == selectedItemName) {
|
||||
if (item.name == selectedItemName)
|
||||
{
|
||||
currentIndex = idx;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ UM.PreferencesPage
|
|||
{
|
||||
return Qt.Unchecked
|
||||
}
|
||||
else if(definitionsModel.visibleCount == definitionsModel.rowCount(null))
|
||||
else if(definitionsModel.visibleCount == definitionsModel.count)
|
||||
{
|
||||
return Qt.Checked
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ Item
|
|||
{
|
||||
id: extruderTargetTemperature
|
||||
text: Math.round(extruderModel.targetHotendTemperature) + "°C"
|
||||
font: UM.Theme.getFont("small")
|
||||
font: UM.Theme.getFont("default_bold")
|
||||
color: UM.Theme.getColor("text_inactive")
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
||||
|
|
|
@ -35,7 +35,7 @@ Item
|
|||
{
|
||||
id: bedTargetTemperature
|
||||
text: printerModel != null ? printerModel.targetBedTemperature + "°C" : ""
|
||||
font: UM.Theme.getFont("small")
|
||||
font: UM.Theme.getFont("default_bold")
|
||||
color: UM.Theme.getColor("text_inactive")
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
||||
|
|
|
@ -43,7 +43,7 @@ Item
|
|||
{
|
||||
id: outputDeviceAddressLabel
|
||||
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")
|
||||
anchors.top: outputDeviceNameLabel.bottom
|
||||
anchors.left: parent.left
|
||||
|
@ -54,7 +54,7 @@ Item
|
|||
{
|
||||
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")
|
||||
font: UM.Theme.getFont("very_small")
|
||||
font: UM.Theme.getFont("default")
|
||||
wrapMode: Text.WordWrap
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||
|
|
|
@ -59,9 +59,6 @@ Cura.ExpandableComponent
|
|||
width: UM.Theme.getSize("printer_status_icon").width
|
||||
height: UM.Theme.getSize("printer_status_icon").height
|
||||
|
||||
sourceSize.width: width
|
||||
sourceSize.height: height
|
||||
|
||||
color: UM.Theme.getColor("primary")
|
||||
visible: isNetworkPrinter && isPrinterConnected
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ Item
|
|||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
renderType: Text.NativeRendering
|
||||
font: UM.Theme.getFont("very_small")
|
||||
font: UM.Theme.getFont("default")
|
||||
color: UM.Theme.getColor("text")
|
||||
}
|
||||
}
|
|
@ -129,23 +129,26 @@ Button
|
|||
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: width
|
||||
color:
|
||||
{
|
||||
if (!base.enabled)
|
||||
{
|
||||
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")
|
||||
} else if (base.pressed || (base.checkable && base.checked))
|
||||
}
|
||||
else if (base.pressed || (base.checkable && base.checked))
|
||||
{
|
||||
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")
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
return UM.Theme.getColor("setting_category_text")
|
||||
}
|
||||
|
|
|
@ -115,12 +115,12 @@ SettingItem
|
|||
return UM.Theme.getColor("setting_control_border")
|
||||
}
|
||||
|
||||
UM.RecolorImage {
|
||||
UM.RecolorImage
|
||||
{
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: Math.round(parent.width / 2.5)
|
||||
height: Math.round(parent.height / 2.5)
|
||||
sourceSize.width: width
|
||||
sourceSize.height: width
|
||||
color: !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("setting_control_text");
|
||||
source: UM.Theme.getIcon("check")
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// Copyright (c) 2016 Ultimaker B.V.
|
||||
// Uranium is released under the terms of the LGPLv3 or higher.
|
||||
// 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
|
||||
|
@ -31,12 +31,15 @@ SettingItem
|
|||
{
|
||||
forceActiveFocus();
|
||||
propertyProvider.setPropertyValue("value", model.getItem(index).index);
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
if (propertyProvider.properties.value == -1)
|
||||
{
|
||||
control.currentIndex = model.rowCount() - 1; // we know the last item is "Not overriden"
|
||||
} else {
|
||||
control.currentIndex = model.count - 1; // we know the last item is "Not overriden"
|
||||
}
|
||||
else
|
||||
{
|
||||
control.currentIndex = propertyProvider.properties.value; // revert to the old value
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// Copyright (c) 2017 Ultimaker B.V.
|
||||
// Uranium is released under the terms of the LGPLv3 or higher.
|
||||
// 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
|
||||
|
@ -129,13 +129,14 @@ Item
|
|||
}
|
||||
style: ButtonStyle
|
||||
{
|
||||
background: Item {
|
||||
UM.RecolorImage {
|
||||
background: Item
|
||||
{
|
||||
UM.RecolorImage
|
||||
{
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: UM.Theme.getSize("standard_arrow").width
|
||||
height: UM.Theme.getSize("standard_arrow").height
|
||||
sourceSize.width: width
|
||||
sourceSize.height: width
|
||||
color: control.enabled ? UM.Theme.getColor("setting_category_text") : UM.Theme.getColor("setting_category_disabled_text")
|
||||
source: UM.Theme.getIcon("menu")
|
||||
|
|
|
@ -106,7 +106,7 @@ Item
|
|||
var availableMin = -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)
|
||||
|
||||
|
@ -183,7 +183,7 @@ Item
|
|||
qualityModel.existingQualityProfile = 0
|
||||
|
||||
// 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.margins: 2 * screenScaleFactor
|
||||
sourceSize.width: width
|
||||
sourceSize.height: width
|
||||
source: UM.Theme.getIcon(model.icon)
|
||||
color: UM.Theme.getColor("quality_slider_unavailable")
|
||||
|
@ -1156,7 +1155,7 @@ Item
|
|||
function populateExtruderModel()
|
||||
{
|
||||
extruderModel.clear();
|
||||
for(var extruderNumber = 0; extruderNumber < extruders.rowCount() ; extruderNumber++)
|
||||
for(var extruderNumber = 0; extruderNumber < extruders.count; extruderNumber++)
|
||||
{
|
||||
extruderModel.append({
|
||||
text: extruders.getItem(extruderNumber).name,
|
||||
|
|
|
@ -62,7 +62,7 @@ Item
|
|||
enabled: model.enabled && UM.Selection.hasSelection && UM.Controller.toolsEnabled
|
||||
|
||||
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
|
||||
{
|
||||
|
|
|
@ -19,7 +19,7 @@ Cura.ExpandableComponent
|
|||
|
||||
property var activeView:
|
||||
{
|
||||
for (var i = 0; i < viewModel.rowCount(); i++)
|
||||
for (var i = 0; i < viewModel.count; i++)
|
||||
{
|
||||
if (viewModel.items[i].active)
|
||||
{
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
module Cura
|
||||
|
||||
MachineSelector 1.0 MachineSelector.qml
|
||||
QuickConfigurationSelector 1.0 QuickConfigurationSelector.qml
|
||||
CustomConfigurationSelector 1.0 CustomConfigurationSelector.qml
|
||||
PrintSetupSelector 1.0 PrintSetupSelector.qml
|
||||
ActionButton 1.0 ActionButton.qml
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
"primary_hover": [48, 182, 231, 255],
|
||||
"primary_text": [255, 255, 255, 204],
|
||||
"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_hovered": [255, 255, 255, 255],
|
||||
|
@ -196,14 +196,6 @@
|
|||
"layerview_support_interface": [64, 192, 255, 255],
|
||||
"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],
|
||||
|
||||
"quality_slider_unavailable": [179, 179, 179, 255],
|
||||
|
|
|
@ -73,7 +73,6 @@ QtObject
|
|||
anchors.rightMargin: Theme.getSize("default_margin").width
|
||||
width: Theme.getSize("standard_arrow").width
|
||||
height: Theme.getSize("standard_arrow").height
|
||||
sourceSize.width: width
|
||||
sourceSize.height: width
|
||||
color: control.enabled ? Theme.getColor("setting_category_text") : Theme.getColor("setting_category_disabled_text")
|
||||
source: Theme.getIcon("arrow_bottom")
|
||||
|
@ -257,7 +256,6 @@ QtObject
|
|||
anchors.bottomMargin: Theme.getSize("button").height - Math.round(Theme.getSize("button_icon").height / 4)
|
||||
width: Theme.getSize("standard_arrow").width
|
||||
height: Theme.getSize("standard_arrow").height
|
||||
sourceSize.width: width
|
||||
sourceSize.height: width
|
||||
visible: control.menu != null;
|
||||
color:
|
||||
|
@ -529,7 +527,7 @@ QtObject
|
|||
implicitWidth: Theme.getSize("checkbox").width
|
||||
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; } }
|
||||
|
||||
radius: control.exclusiveGroup ? Math.round(Theme.getSize("checkbox").width / 2) : 0
|
||||
|
@ -543,7 +541,6 @@ QtObject
|
|||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: Math.round(parent.width / 2.5)
|
||||
height: Math.round(parent.height / 2.5)
|
||||
sourceSize.width: width
|
||||
sourceSize.height: width
|
||||
color: Theme.getColor("checkbox_mark")
|
||||
source: control.exclusiveGroup ? Theme.getIcon("dot") : Theme.getIcon("check")
|
||||
|
@ -585,7 +582,6 @@ QtObject
|
|||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: Math.round(parent.width / 2.5)
|
||||
height: Math.round(parent.height / 2.5)
|
||||
sourceSize.width: width
|
||||
sourceSize.height: width
|
||||
color: Theme.getColor("checkbox_mark")
|
||||
source:
|
||||
|
@ -836,7 +832,6 @@ QtObject
|
|||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: Math.floor(control.width / 2)
|
||||
height: Math.floor(control.height / 2)
|
||||
sourceSize.width: width
|
||||
sourceSize.height: width
|
||||
color:
|
||||
{
|
||||
|
|
|
@ -41,12 +41,12 @@
|
|||
"family": "Noto Sans"
|
||||
},
|
||||
"small": {
|
||||
"size": 1.0,
|
||||
"weight": 63,
|
||||
"size": 0.85,
|
||||
"weight": 50,
|
||||
"family": "Noto Sans"
|
||||
},
|
||||
"very_small": {
|
||||
"size": 1.0,
|
||||
"size": 0.7,
|
||||
"weight": 50,
|
||||
"family": "Noto Sans"
|
||||
},
|
||||
|
@ -64,12 +64,6 @@
|
|||
"size": 1.15,
|
||||
"weight": 50,
|
||||
"family": "Noto Sans"
|
||||
},
|
||||
"extruder_icon":
|
||||
{
|
||||
"size": 0.7,
|
||||
"weight": 50,
|
||||
"family": "Noto Sans"
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -241,6 +235,7 @@
|
|||
"checkbox_border": [64, 69, 72, 255],
|
||||
"checkbox_border_hover": [50, 130, 255, 255],
|
||||
"checkbox_mark": [119, 122, 124, 255],
|
||||
"checkbox_disabled": [223, 223, 223, 255],
|
||||
"checkbox_text": [27, 27, 27, 255],
|
||||
|
||||
"tooltip": [68, 192, 255, 255],
|
||||
|
@ -310,14 +305,6 @@
|
|||
"layerview_support_interface": [64, 192, 255, 255],
|
||||
"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_disconnected": [200, 200, 200, 255],
|
||||
|
||||
|
@ -377,7 +364,6 @@
|
|||
|
||||
"action_panel_widget": [25.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_content": [25.0, 32.0],
|
||||
|
@ -423,6 +409,9 @@
|
|||
"button_icon": [2.5, 2.5],
|
||||
"button_lining": [0, 0],
|
||||
|
||||
"action_button": [15.0, 3.0],
|
||||
"action_button_radius": [0.15, 0.15],
|
||||
|
||||
"small_button": [2, 2],
|
||||
"small_button_icon": [1.5, 1.5],
|
||||
|
||||
|
@ -511,9 +500,6 @@
|
|||
|
||||
"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_extruder_circle": [2.75, 2.75],
|
||||
"monitor_text_line": [1.16, 1.16],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue