mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-08 22:35:03 -06:00
Merge branch '4.0' into CURA-6011_connection_types
This commit is contained in:
commit
b5d8db6a77
62 changed files with 971 additions and 867 deletions
|
@ -43,12 +43,13 @@ Button
|
|||
|
||||
contentItem: Row
|
||||
{
|
||||
spacing: UM.Theme.getSize("narrow_margin").width
|
||||
//Left side icon. Only displayed if !isIconOnRightSide.
|
||||
UM.RecolorImage
|
||||
{
|
||||
id: buttonIconLeft
|
||||
source: ""
|
||||
height: buttonText.height
|
||||
height: UM.Theme.getSize("action_button_icon").height
|
||||
width: visible ? height : 0
|
||||
sourceSize.width: width
|
||||
sourceSize.height: height
|
||||
|
@ -62,7 +63,7 @@ Button
|
|||
id: buttonText
|
||||
text: button.text
|
||||
color: button.enabled ? (button.hovered ? button.textHoverColor : button.textColor): button.textDisabledColor
|
||||
font: UM.Theme.getFont("action_button")
|
||||
font: UM.Theme.getFont("medium")
|
||||
visible: text != ""
|
||||
renderType: Text.NativeRendering
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
@ -76,7 +77,7 @@ Button
|
|||
{
|
||||
id: buttonIconRight
|
||||
source: buttonIconLeft.source
|
||||
height: buttonText.height
|
||||
height: UM.Theme.getSize("action_button_icon").height
|
||||
width: visible ? height : 0
|
||||
sourceSize.width: width
|
||||
sourceSize.height: height
|
||||
|
|
|
@ -41,7 +41,7 @@ Column
|
|||
{
|
||||
left: parent.left
|
||||
right: printInformationPanel.left
|
||||
rightMargin: UM.Theme.getSize("thin_margin").height
|
||||
rightMargin: printInformationPanel.visible ? UM.Theme.getSize("thin_margin").width : 0
|
||||
}
|
||||
|
||||
Cura.IconWithText
|
||||
|
@ -119,9 +119,9 @@ Column
|
|||
}
|
||||
|
||||
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")
|
||||
tooltip: text
|
||||
fixedWidthMode: true
|
||||
|
||||
onClicked: UM.Controller.setActiveStage("PreviewStage")
|
||||
visible: UM.Controller.activeStage != null && UM.Controller.activeStage.stageId != "PreviewStage"
|
||||
|
|
|
@ -12,10 +12,10 @@ UM.RecolorImage
|
|||
id: widget
|
||||
|
||||
source: UM.Theme.getIcon("info")
|
||||
width: UM.Theme.getSize("section_icon").width
|
||||
width: visible ? UM.Theme.getSize("section_icon").width : 0
|
||||
height: UM.Theme.getSize("section_icon").height
|
||||
|
||||
color: popup.opened ? UM.Theme.getColor("primary") : UM.Theme.getColor("text_medium")
|
||||
color: UM.Theme.getColor("icon")
|
||||
|
||||
MouseArea
|
||||
{
|
||||
|
|
|
@ -60,7 +60,7 @@ Column
|
|||
|
||||
text: catalog.i18nc("@label:PrintjobStatus", "Unable to Slice")
|
||||
source: UM.Theme.getIcon("warning")
|
||||
color: UM.Theme.getColor("warning")
|
||||
iconColor: UM.Theme.getColor("warning")
|
||||
}
|
||||
|
||||
// Progress bar, only visible when the backend is in the process of slice the printjob
|
||||
|
|
|
@ -252,7 +252,7 @@ UM.MainWindow
|
|||
anchors
|
||||
{
|
||||
// Align to the top of the stageMenu since the stageMenu may not exist
|
||||
top: parent.top
|
||||
top: stageMenu.source ? stageMenu.verticalCenter : parent.top
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
bottom: parent.bottom
|
||||
|
|
|
@ -49,6 +49,7 @@ Item
|
|||
anchors.centerIn: parent
|
||||
text: index + 1
|
||||
font: UM.Theme.getFont("very_small")
|
||||
color: UM.Theme.getColor("text")
|
||||
width: contentWidth
|
||||
height: contentHeight
|
||||
visible: extruderEnabled
|
||||
|
|
|
@ -15,10 +15,10 @@ Item
|
|||
{
|
||||
property alias source: icon.source
|
||||
property alias iconSize: icon.width
|
||||
property alias iconColor: icon.color
|
||||
property alias color: label.color
|
||||
property alias text: label.text
|
||||
property alias font: label.font
|
||||
|
||||
property real margin: UM.Theme.getSize("narrow_margin").width
|
||||
|
||||
// These properties can be used in combination with layouts.
|
||||
|
@ -37,9 +37,9 @@ Item
|
|||
{
|
||||
id: icon
|
||||
width: UM.Theme.getSize("section_icon").width
|
||||
height: UM.Theme.getSize("section_icon").height
|
||||
height: width
|
||||
|
||||
color: label.color
|
||||
color: UM.Theme.getColor("icon")
|
||||
|
||||
anchors
|
||||
{
|
||||
|
|
|
@ -54,7 +54,7 @@ Item
|
|||
{
|
||||
text: model.name.toUpperCase()
|
||||
checkable: true
|
||||
checked: UM.Controller.activeStage != null ? model.id == UM.Controller.activeStage.stageId : false
|
||||
checked: UM.Controller.activeStage !== null && model.id == UM.Controller.activeStage.stageId
|
||||
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
exclusiveGroup: mainWindowHeaderMenuGroup
|
||||
|
|
|
@ -16,8 +16,8 @@ Item
|
|||
{
|
||||
id: header
|
||||
text: catalog.i18nc("@header", "Configurations")
|
||||
font: UM.Theme.getFont("large")
|
||||
color: UM.Theme.getColor("text")
|
||||
font: UM.Theme.getFont("default")
|
||||
color: UM.Theme.getColor("small_button_text")
|
||||
height: contentHeight
|
||||
renderType: Text.NativeRendering
|
||||
|
||||
|
|
|
@ -14,122 +14,117 @@ Button
|
|||
property var configuration: null
|
||||
hoverEnabled: true
|
||||
|
||||
height: background.height
|
||||
|
||||
background: Rectangle
|
||||
{
|
||||
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
|
||||
border.color: parent.checked ? UM.Theme.getColor("primary") : UM.Theme.getColor("lining")
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
radius: UM.Theme.getSize("default_radius").width
|
||||
}
|
||||
|
||||
Column
|
||||
contentItem: Column
|
||||
{
|
||||
id: contentColumn
|
||||
width: parent.width
|
||||
padding: UM.Theme.getSize("default_margin").width
|
||||
spacing: UM.Theme.getSize("narrow_margin").height
|
||||
|
||||
Row
|
||||
{
|
||||
id: contentColumn
|
||||
width: parent.width
|
||||
padding: UM.Theme.getSize("wide_margin").width
|
||||
spacing: UM.Theme.getSize("narrow_margin").height
|
||||
id: extruderRow
|
||||
|
||||
Row
|
||||
anchors
|
||||
{
|
||||
id: extruderRow
|
||||
|
||||
anchors
|
||||
{
|
||||
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
|
||||
}
|
||||
}
|
||||
left: parent.left
|
||||
leftMargin: UM.Theme.getSize("wide_margin").width
|
||||
right: parent.right
|
||||
rightMargin: UM.Theme.getSize("wide_margin").width
|
||||
}
|
||||
|
||||
//Buildplate row separator
|
||||
Rectangle
|
||||
spacing: UM.Theme.getSize("default_margin").width
|
||||
|
||||
Repeater
|
||||
{
|
||||
id: separator
|
||||
|
||||
visible: buildplateInformation.visible
|
||||
anchors
|
||||
id: repeater
|
||||
model: configuration.extruderConfigurations
|
||||
delegate: PrintCoreConfiguration
|
||||
{
|
||||
left: parent.left
|
||||
leftMargin: parent.padding
|
||||
right: parent.right
|
||||
rightMargin: parent.padding
|
||||
}
|
||||
height: visible ? Math.round(UM.Theme.getSize("default_lining").height / 2) : 0
|
||||
color: UM.Theme.getColor("lining")
|
||||
}
|
||||
|
||||
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")
|
||||
width: Math.round(parent.width / 2)
|
||||
printCoreConfiguration: modelData
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Connections
|
||||
//Buildplate row separator
|
||||
Rectangle
|
||||
{
|
||||
target: Cura.MachineManager
|
||||
onCurrentConfigurationChanged:
|
||||
id: separator
|
||||
|
||||
visible: buildplateInformation.visible
|
||||
anchors
|
||||
{
|
||||
configurationItem.checked = Cura.MachineManager.matchesConfiguration(configuration)
|
||||
left: parent.left
|
||||
leftMargin: UM.Theme.getSize("wide_margin").width
|
||||
right: parent.right
|
||||
rightMargin: UM.Theme.getSize("wide_margin").width
|
||||
}
|
||||
height: visible ? Math.round(UM.Theme.getSize("default_lining").height / 2) : 0
|
||||
color: UM.Theme.getColor("lining")
|
||||
}
|
||||
|
||||
Component.onCompleted:
|
||||
Item
|
||||
{
|
||||
id: buildplateInformation
|
||||
|
||||
anchors
|
||||
{
|
||||
left: parent.left
|
||||
leftMargin: UM.Theme.getSize("wide_margin").width
|
||||
right: parent.right
|
||||
rightMargin: UM.Theme.getSize("wide_margin").width
|
||||
}
|
||||
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: UM.Theme.getSize("narrow_margin").height
|
||||
text: configuration.buildplateConfiguration
|
||||
renderType: Text.NativeRendering
|
||||
color: UM.Theme.getColor("text")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Connections
|
||||
{
|
||||
target: Cura.MachineManager
|
||||
onCurrentConfigurationChanged:
|
||||
{
|
||||
configurationItem.checked = Cura.MachineManager.matchesConfiguration(configuration)
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted:
|
||||
{
|
||||
configurationItem.checked = Cura.MachineManager.matchesConfiguration(configuration)
|
||||
}
|
||||
|
||||
onClicked:
|
||||
{
|
||||
Cura.MachineManager.applyRemoteConfiguration(configuration)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,16 +7,15 @@ import QtQuick.Controls 2.3
|
|||
import UM 1.2 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
Column
|
||||
Item
|
||||
{
|
||||
id: base
|
||||
property var outputDevice: null
|
||||
height: childrenRect.height + 2 * padding
|
||||
spacing: UM.Theme.getSize("narrow_margin").height
|
||||
height: childrenRect.height
|
||||
|
||||
function forceModelUpdate()
|
||||
{
|
||||
// FIXME For now the model should be removed and then created again, otherwise changes in the printer don't automatically update the UI
|
||||
// FIXME For now the model has to be removed and then created again, otherwise changes in the printer don't automatically update the UI
|
||||
configurationList.model = []
|
||||
if (outputDevice)
|
||||
{
|
||||
|
@ -24,6 +23,42 @@ Column
|
|||
}
|
||||
}
|
||||
|
||||
// This component will appear when there is no configurations (e.g. when losing connection)
|
||||
Item
|
||||
{
|
||||
width: parent.width
|
||||
visible: configurationList.model.length == 0
|
||||
height: label.height + UM.Theme.getSize("wide_margin").height
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
||||
|
||||
UM.RecolorImage
|
||||
{
|
||||
id: icon
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.verticalCenter: label.verticalCenter
|
||||
|
||||
source: UM.Theme.getIcon("warning")
|
||||
color: UM.Theme.getColor("warning")
|
||||
width: UM.Theme.getSize("section_icon").width
|
||||
height: width
|
||||
}
|
||||
|
||||
Label
|
||||
{
|
||||
id: label
|
||||
anchors.left: icon.right
|
||||
anchors.right: parent.right
|
||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||
text: catalog.i18nc("@label", "The configurations are not available because the printer is disconnected.")
|
||||
color: UM.Theme.getColor("text")
|
||||
font: UM.Theme.getFont("default")
|
||||
renderType: Text.NativeRendering
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
}
|
||||
|
||||
ScrollView
|
||||
{
|
||||
id: container
|
||||
|
@ -57,7 +92,6 @@ Column
|
|||
id: configurationList
|
||||
spacing: UM.Theme.getSize("narrow_margin").height
|
||||
width: container.width - ((height > container.maximumHeight) ? container.ScrollBar.vertical.background.width : 0) //Make room for scroll bar if there is any.
|
||||
contentHeight: childrenRect.height
|
||||
height: childrenRect.height
|
||||
|
||||
section.property: "modelData.printerType"
|
||||
|
@ -100,4 +134,4 @@ Column
|
|||
forceModelUpdate()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,10 +17,7 @@ Cura.ExpandablePopup
|
|||
{
|
||||
id: base
|
||||
|
||||
Cura.ExtrudersModel
|
||||
{
|
||||
id: extrudersModel
|
||||
}
|
||||
property var extrudersModel: CuraApplication.getExtrudersModel()
|
||||
|
||||
UM.I18nCatalog
|
||||
{
|
||||
|
@ -34,6 +31,7 @@ Cura.ExpandablePopup
|
|||
Custom
|
||||
}
|
||||
|
||||
contentPadding: UM.Theme.getSize("default_lining").width
|
||||
enabled: Cura.MachineManager.hasMaterials || Cura.MachineManager.hasVariants || Cura.MachineManager.hasVariantBuildplates; //Only let it drop down if there is any configuration that you could change.
|
||||
|
||||
headerItem: Item
|
||||
|
@ -127,34 +125,41 @@ Cura.ExpandablePopup
|
|||
contentItem: 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.
|
||||
width: UM.Theme.getSize("configuration_selector").width
|
||||
height: implicitHeight // Required because ExpandableComponent will try to use this to determine the size of the background of the pop-up.
|
||||
padding: UM.Theme.getSize("default_margin").height
|
||||
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.
|
||||
property bool is_connected: false // If current machine is connected to a printer. Only evaluated upon making popup visible.
|
||||
property int configuration_method: ConfigurationMenu.ConfigurationMethod.Custom // Type of configuration being used. Only evaluated upon making popup visible.
|
||||
property int manual_selected_method: -1 // It stores the configuration method selected by the user. By default the selected method is
|
||||
|
||||
onVisibleChanged:
|
||||
{
|
||||
is_connected = Cura.MachineManager.activeMachineHasRemoteConnection && 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.
|
||||
// If the printer is not connected, we switch always to the custom mode. If is connected instead, the auto mode
|
||||
// or the previous state is selected
|
||||
configuration_method = is_connected ? (manual_selected_method == -1 ? ConfigurationMenu.ConfigurationMethod.Auto : manual_selected_method) : ConfigurationMenu.ConfigurationMethod.Custom
|
||||
}
|
||||
|
||||
Item
|
||||
{
|
||||
width: parent.width
|
||||
width: parent.width - 2 * parent.padding
|
||||
height:
|
||||
{
|
||||
var height = 0;
|
||||
if(autoConfiguration.visible)
|
||||
var height = 0
|
||||
if (autoConfiguration.visible)
|
||||
{
|
||||
height += autoConfiguration.height;
|
||||
height += autoConfiguration.height
|
||||
}
|
||||
if(customConfiguration.visible)
|
||||
if (customConfiguration.visible)
|
||||
{
|
||||
height += customConfiguration.height;
|
||||
height += customConfiguration.height
|
||||
}
|
||||
return height;
|
||||
return height
|
||||
}
|
||||
|
||||
AutoConfiguration
|
||||
{
|
||||
id: autoConfiguration
|
||||
|
@ -172,9 +177,9 @@ Cura.ExpandablePopup
|
|||
{
|
||||
id: separator
|
||||
visible: buttonBar.visible
|
||||
x: -contentPadding
|
||||
x: -parent.padding
|
||||
|
||||
width: base.width
|
||||
width: parent.width
|
||||
height: UM.Theme.getSize("default_lining").height
|
||||
|
||||
color: UM.Theme.getColor("lining")
|
||||
|
@ -186,7 +191,7 @@ Cura.ExpandablePopup
|
|||
id: buttonBar
|
||||
visible: popupItem.is_connected //Switching only makes sense if the "auto" part is possible.
|
||||
|
||||
width: parent.width
|
||||
width: parent.width - 2 * parent.padding
|
||||
height: childrenRect.height
|
||||
|
||||
Cura.SecondaryButton
|
||||
|
@ -200,7 +205,11 @@ Cura.ExpandablePopup
|
|||
iconSource: UM.Theme.getIcon("arrow_right")
|
||||
isIconOnRightSide: true
|
||||
|
||||
onClicked: popupItem.configuration_method = ConfigurationMenu.ConfigurationMethod.Custom
|
||||
onClicked:
|
||||
{
|
||||
popupItem.configuration_method = ConfigurationMenu.ConfigurationMethod.Custom
|
||||
popupItem.manual_selected_method = popupItem.configuration_method
|
||||
}
|
||||
}
|
||||
|
||||
Cura.SecondaryButton
|
||||
|
@ -211,8 +220,18 @@ Cura.ExpandablePopup
|
|||
|
||||
iconSource: UM.Theme.getIcon("arrow_left")
|
||||
|
||||
onClicked: popupItem.configuration_method = ConfigurationMenu.ConfigurationMethod.Auto
|
||||
onClicked:
|
||||
{
|
||||
popupItem.configuration_method = ConfigurationMenu.ConfigurationMethod.Auto
|
||||
popupItem.manual_selected_method = popupItem.configuration_method
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Connections
|
||||
{
|
||||
target: Cura.MachineManager
|
||||
onGlobalContainerChanged: popupItem.manual_selected_method = -1 // When switching printers, reset the value of the manual selected method
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,8 +23,8 @@ Item
|
|||
{
|
||||
id: header
|
||||
text: catalog.i18nc("@header", "Custom")
|
||||
font: UM.Theme.getFont("large")
|
||||
color: UM.Theme.getColor("text")
|
||||
font: UM.Theme.getFont("default")
|
||||
color: UM.Theme.getColor("small_button_text")
|
||||
height: contentHeight
|
||||
renderType: Text.NativeRendering
|
||||
|
||||
|
@ -51,9 +51,7 @@ Item
|
|||
anchors
|
||||
{
|
||||
left: parent.left
|
||||
leftMargin: UM.Theme.getSize("default_margin").width
|
||||
right: parent.right
|
||||
rightMargin: UM.Theme.getSize("default_margin").width
|
||||
top: header.bottom
|
||||
topMargin: visible ? UM.Theme.getSize("default_margin").height : 0
|
||||
}
|
||||
|
@ -74,7 +72,7 @@ Item
|
|||
id: printerTypeSelector
|
||||
text: Cura.MachineManager.activeMachineDefinitionName
|
||||
tooltip: Cura.MachineManager.activeMachineDefinitionName
|
||||
height: UM.Theme.getSize("setting_control").height
|
||||
height: UM.Theme.getSize("print_setup_big_item").height
|
||||
width: Math.round(parent.width * 0.7) + UM.Theme.getSize("default_margin").width
|
||||
anchors.right: parent.right
|
||||
style: UM.Theme.styles.print_setup_header_button
|
||||
|
@ -224,7 +222,7 @@ Item
|
|||
|
||||
Row
|
||||
{
|
||||
height: UM.Theme.getSize("print_setup_item").height
|
||||
height: UM.Theme.getSize("print_setup_big_item").height
|
||||
visible: Cura.MachineManager.hasMaterials
|
||||
|
||||
Label
|
||||
|
@ -248,7 +246,7 @@ Item
|
|||
text: Cura.MachineManager.activeStack != null ? Cura.MachineManager.activeStack.material.name : ""
|
||||
tooltip: text
|
||||
|
||||
height: UM.Theme.getSize("setting_control").height
|
||||
height: UM.Theme.getSize("print_setup_big_item").height
|
||||
width: selectors.controlWidth
|
||||
|
||||
style: UM.Theme.styles.print_setup_header_button
|
||||
|
@ -262,7 +260,7 @@ Item
|
|||
|
||||
Row
|
||||
{
|
||||
height: UM.Theme.getSize("print_setup_item").height
|
||||
height: UM.Theme.getSize("print_setup_big_item").height
|
||||
visible: Cura.MachineManager.hasVariants
|
||||
|
||||
Label
|
||||
|
@ -282,7 +280,7 @@ Item
|
|||
text: Cura.MachineManager.activeVariantName
|
||||
tooltip: Cura.MachineManager.activeVariantName
|
||||
|
||||
height: UM.Theme.getSize("setting_control").height
|
||||
height: UM.Theme.getSize("print_setup_big_item").height
|
||||
width: selectors.controlWidth
|
||||
style: UM.Theme.styles.print_setup_header_button
|
||||
activeFocusOnPress: true;
|
||||
|
|
|
@ -27,7 +27,7 @@ Menu
|
|||
MenuItem { id: extruderHeader; text: catalog.i18ncp("@label", "Print Selected Model With:", "Print Selected Models With:", UM.Selection.selectionCount); enabled: false; visible: base.shouldShowExtruders }
|
||||
Instantiator
|
||||
{
|
||||
model: Cura.ExtrudersModel { id: extrudersModel }
|
||||
model: CuraApplication.getExtrudersModel()
|
||||
MenuItem {
|
||||
text: "%1: %2 - %3".arg(model.name).arg(model.material).arg(model.variant)
|
||||
visible: base.shouldShowExtruders
|
||||
|
|
|
@ -1,212 +0,0 @@
|
|||
// Copyright (c) 2018 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.10
|
||||
import QtQuick.Controls 2.0
|
||||
import QtQuick.Layouts 1.3
|
||||
|
||||
import UM 1.2 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
import "Menus"
|
||||
import "Menus/ConfigurationMenu"
|
||||
|
||||
|
||||
Rectangle
|
||||
{
|
||||
id: base
|
||||
|
||||
property int currentModeIndex
|
||||
property bool hideSettings: PrintInformation.preSliced
|
||||
property bool hideView: Cura.MachineManager.activeMachineName == ""
|
||||
|
||||
// Is there an output device for this printer?
|
||||
property bool isNetworkPrinter: Cura.MachineManager.activeMachineHasRemoteConnection
|
||||
property bool printerConnected: Cura.MachineManager.printerConnected
|
||||
property bool printerAcceptsCommands: printerConnected && Cura.MachineManager.printerOutputDevices[0].acceptsCommands
|
||||
property var connectedPrinter: Cura.MachineManager.printerOutputDevices.length >= 1 ? Cura.MachineManager.printerOutputDevices[0] : null
|
||||
|
||||
property variant printDuration: PrintInformation.currentPrintTime
|
||||
property variant printMaterialLengths: PrintInformation.materialLengths
|
||||
property variant printMaterialWeights: PrintInformation.materialWeights
|
||||
property variant printMaterialCosts: PrintInformation.materialCosts
|
||||
property variant printMaterialNames: PrintInformation.materialNames
|
||||
|
||||
color: UM.Theme.getColor("main_background")
|
||||
UM.I18nCatalog { id: catalog; name: "cura"}
|
||||
|
||||
Timer {
|
||||
id: tooltipDelayTimer
|
||||
interval: 500
|
||||
repeat: false
|
||||
property var item
|
||||
property string text
|
||||
|
||||
onTriggered:
|
||||
{
|
||||
base.showTooltip(base, {x: 0, y: item.y}, text);
|
||||
}
|
||||
}
|
||||
|
||||
function showTooltip(item, position, text)
|
||||
{
|
||||
tooltip.text = text;
|
||||
position = item.mapToItem(base, position.x - UM.Theme.getSize("default_arrow").width, position.y);
|
||||
tooltip.show(position);
|
||||
}
|
||||
|
||||
function hideTooltip()
|
||||
{
|
||||
tooltip.hide();
|
||||
}
|
||||
|
||||
function strPadLeft(string, pad, length) {
|
||||
return (new Array(length + 1).join(pad) + string).slice(-length);
|
||||
}
|
||||
|
||||
function getPrettyTime(time)
|
||||
{
|
||||
var hours = Math.floor(time / 3600)
|
||||
time -= hours * 3600
|
||||
var minutes = Math.floor(time / 60);
|
||||
time -= minutes * 60
|
||||
var seconds = Math.floor(time);
|
||||
|
||||
var finalTime = strPadLeft(hours, "0", 2) + ":" + strPadLeft(minutes, "0", 2) + ":" + strPadLeft(seconds, "0", 2);
|
||||
return finalTime;
|
||||
}
|
||||
|
||||
MouseArea
|
||||
{
|
||||
anchors.fill: parent
|
||||
acceptedButtons: Qt.AllButtons
|
||||
|
||||
onWheel:
|
||||
{
|
||||
wheel.accepted = true;
|
||||
}
|
||||
}
|
||||
|
||||
MachineSelector
|
||||
{
|
||||
id: machineSelection
|
||||
width: base.width - configSelection.width - separator.width
|
||||
height: UM.Theme.getSize("stage_menu").height
|
||||
anchors.top: base.top
|
||||
anchors.left: parent.left
|
||||
}
|
||||
|
||||
Rectangle
|
||||
{
|
||||
id: separator
|
||||
visible: configSelection.visible
|
||||
width: visible ? Math.round(UM.Theme.getSize("thick_lining").height / 2) : 0
|
||||
height: UM.Theme.getSize("stage_menu").height
|
||||
color: UM.Theme.getColor("thick_lining")
|
||||
anchors.left: machineSelection.right
|
||||
}
|
||||
|
||||
CustomConfigurationSelector
|
||||
{
|
||||
id: configSelection
|
||||
visible: isNetworkPrinter && printerConnected
|
||||
width: visible ? Math.round(base.width * 0.15) : 0
|
||||
height: UM.Theme.getSize("stage_menu").height
|
||||
anchors.top: base.top
|
||||
anchors.right: parent.right
|
||||
}
|
||||
|
||||
Loader
|
||||
{
|
||||
id: controlItem
|
||||
anchors.bottom: footerSeparator.top
|
||||
anchors.top: machineSelection.bottom
|
||||
anchors.left: base.left
|
||||
anchors.right: base.right
|
||||
sourceComponent:
|
||||
{
|
||||
if(connectedPrinter != null)
|
||||
{
|
||||
if(connectedPrinter.controlItem != null)
|
||||
{
|
||||
return connectedPrinter.controlItem
|
||||
}
|
||||
}
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
Loader
|
||||
{
|
||||
anchors.bottom: footerSeparator.top
|
||||
anchors.top: machineSelection.bottom
|
||||
anchors.left: base.left
|
||||
anchors.right: base.right
|
||||
source:
|
||||
{
|
||||
if(controlItem.sourceComponent == null)
|
||||
{
|
||||
return "PrintMonitor.qml"
|
||||
}
|
||||
else
|
||||
{
|
||||
return ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle
|
||||
{
|
||||
id: footerSeparator
|
||||
width: parent.width
|
||||
height: UM.Theme.getSize("wide_lining").height
|
||||
color: UM.Theme.getColor("wide_lining")
|
||||
anchors.bottom: monitorButton.top
|
||||
anchors.bottomMargin: UM.Theme.getSize("thick_margin").height
|
||||
}
|
||||
|
||||
// MonitorButton is actually the bottom footer panel.
|
||||
MonitorButton
|
||||
{
|
||||
id: monitorButton
|
||||
implicitWidth: base.width
|
||||
anchors.bottom: parent.bottom
|
||||
}
|
||||
|
||||
PrintSetupTooltip
|
||||
{
|
||||
id: tooltip
|
||||
}
|
||||
|
||||
UM.SettingPropertyProvider
|
||||
{
|
||||
id: machineExtruderCount
|
||||
|
||||
containerStack: Cura.MachineManager.activeMachine
|
||||
key: "machine_extruder_count"
|
||||
watchedProperties: [ "value" ]
|
||||
storeIndex: 0
|
||||
}
|
||||
|
||||
UM.SettingPropertyProvider
|
||||
{
|
||||
id: machineHeatedBed
|
||||
|
||||
containerStack: Cura.MachineManager.activeMachine
|
||||
key: "machine_heated_bed"
|
||||
watchedProperties: [ "value" ]
|
||||
storeIndex: 0
|
||||
}
|
||||
|
||||
// Make the ConfigurationSelector react when the global container changes, otherwise if Cura is not connected to the printer,
|
||||
// switching printers make no reaction
|
||||
Connections
|
||||
{
|
||||
target: Cura.MachineManager
|
||||
onGlobalContainerChanged:
|
||||
{
|
||||
base.isNetworkPrinter = Cura.MachineManager.activeMachineHasRemoteConnection
|
||||
base.printerConnected = Cura.MachineManager.printerOutputDevices.length != 0
|
||||
}
|
||||
}
|
||||
}
|
|
@ -16,7 +16,7 @@ Item
|
|||
|
||||
property QtObject qualityManager: CuraApplication.getQualityManager()
|
||||
property var resetEnabled: false // Keep PreferencesDialog happy
|
||||
property var extrudersModel: Cura.ExtrudersModel {}
|
||||
property var extrudersModel: CuraApplication.getExtrudersModel()
|
||||
|
||||
UM.I18nCatalog { id: catalog; name: "cura"; }
|
||||
|
||||
|
|
|
@ -60,11 +60,7 @@ Rectangle
|
|||
|
||||
anchors.fill: parent
|
||||
|
||||
Cura.ExtrudersModel
|
||||
{
|
||||
id: extrudersModel
|
||||
simpleNames: true
|
||||
}
|
||||
property var extrudersModel: CuraApplication.getExtrudersModel()
|
||||
|
||||
OutputDeviceHeader
|
||||
{
|
||||
|
|
|
@ -16,10 +16,7 @@ Item
|
|||
property real padding: UM.Theme.getSize("default_margin").width
|
||||
property bool multipleExtruders: extrudersModel.count > 1
|
||||
|
||||
Cura.ExtrudersModel
|
||||
{
|
||||
id: extrudersModel
|
||||
}
|
||||
property var extrudersModel: CuraApplication.getExtrudersModel()
|
||||
|
||||
// Profile selector row
|
||||
GlobalProfileSelector
|
||||
|
@ -113,9 +110,11 @@ Item
|
|||
}
|
||||
z: tabBar.z - 1
|
||||
// Don't show the border when only one extruder
|
||||
|
||||
border.color: tabBar.visible ? UM.Theme.getColor("lining") : "transparent"
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
|
||||
color: UM.Theme.getColor("main_background")
|
||||
Cura.SettingView
|
||||
{
|
||||
anchors
|
||||
|
|
|
@ -26,10 +26,7 @@ Cura.ExpandableComponent
|
|||
|
||||
headerItem: PrintSetupSelectorHeader {}
|
||||
|
||||
Cura.ExtrudersModel
|
||||
{
|
||||
id: extrudersModel
|
||||
}
|
||||
property var extrudersModel: CuraApplication.getExtrudersModel()
|
||||
|
||||
contentItem: PrintSetupSelectorContents {}
|
||||
}
|
|
@ -144,6 +144,7 @@ Item
|
|||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
y: UM.Theme.getSize("thin_margin").height
|
||||
renderType: Text.NativeRendering
|
||||
color: UM.Theme.getColor("quality_slider_available")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,7 +39,17 @@ Item
|
|||
{
|
||||
target: Cura.QualityProfilesDropDownMenuModel
|
||||
onItemsChanged: qualityModel.update()
|
||||
onDataChanged: qualityModel.update()
|
||||
onDataChanged:
|
||||
{
|
||||
// If a custom profile is selected and then a user decides to change any of setting the slider should show
|
||||
// the reset button. After clicking the reset button the QualityProfilesDropDownMenuModel(ListModel) is
|
||||
// updated before the property isProfileCustomized is called to update.
|
||||
if (Cura.SimpleModeSettingsManager.isProfileCustomized)
|
||||
{
|
||||
Cura.SimpleModeSettingsManager.updateIsProfileUserCreated()
|
||||
}
|
||||
qualityModel.update()
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
|
|
|
@ -156,9 +156,10 @@ Item
|
|||
}
|
||||
|
||||
//: Model used to populate the extrudelModel
|
||||
Cura.ExtrudersModel
|
||||
property var extruders: CuraApplication.getExtrudersModel()
|
||||
Connections
|
||||
{
|
||||
id: extruders
|
||||
target: extruders
|
||||
onModelChanged: populateExtruderModel()
|
||||
}
|
||||
|
||||
|
|
|
@ -326,7 +326,7 @@ Item
|
|||
return UM.Theme.getColor("action_button_text");
|
||||
}
|
||||
}
|
||||
font: UM.Theme.getFont("action_button")
|
||||
font: UM.Theme.getFont("medium")
|
||||
text:
|
||||
{
|
||||
if(extruderModel == null)
|
||||
|
|
|
@ -320,7 +320,7 @@ Item
|
|||
return UM.Theme.getColor("action_button_text");
|
||||
}
|
||||
}
|
||||
font: UM.Theme.getFont("action_button")
|
||||
font: UM.Theme.getFont("medium")
|
||||
text:
|
||||
{
|
||||
if(printerModel == null)
|
||||
|
|
|
@ -27,7 +27,7 @@ Item
|
|||
anchors.left: parent.left
|
||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||
text: label
|
||||
font: UM.Theme.getFont("setting_category")
|
||||
font: UM.Theme.getFont("default")
|
||||
color: UM.Theme.getColor("setting_category_text")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,49 +24,24 @@ Cura.ExpandablePopup
|
|||
name: "cura"
|
||||
}
|
||||
|
||||
headerItem: Item
|
||||
headerItem: Cura.IconWithText
|
||||
{
|
||||
implicitHeight: icon.height
|
||||
|
||||
UM.RecolorImage
|
||||
text: isNetworkPrinter ? Cura.MachineManager.activeMachineNetworkGroupName : Cura.MachineManager.activeMachineName
|
||||
source:
|
||||
{
|
||||
id: icon
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
source:
|
||||
if (isNetworkPrinter)
|
||||
{
|
||||
if (isNetworkPrinter)
|
||||
if (machineSelector.outputDevice != null && machineSelector.outputDevice.clusterSize > 1)
|
||||
{
|
||||
if (machineSelector.outputDevice != null && machineSelector.outputDevice.clusterSize > 1)
|
||||
{
|
||||
return UM.Theme.getIcon("printer_group")
|
||||
}
|
||||
return UM.Theme.getIcon("printer_single")
|
||||
return UM.Theme.getIcon("printer_group")
|
||||
}
|
||||
return ""
|
||||
return UM.Theme.getIcon("printer_single")
|
||||
}
|
||||
width: UM.Theme.getSize("machine_selector_icon").width
|
||||
height: width
|
||||
|
||||
color: UM.Theme.getColor("machine_selector_printer_icon")
|
||||
visible: source != ""
|
||||
}
|
||||
|
||||
Label
|
||||
{
|
||||
id: label
|
||||
anchors.left: icon.visible ? icon.right : parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.leftMargin: UM.Theme.getSize("thin_margin").width
|
||||
anchors.verticalCenter: icon.verticalCenter
|
||||
text: isNetworkPrinter ? Cura.MachineManager.activeMachineNetworkGroupName : Cura.MachineManager.activeMachineName
|
||||
elide: Text.ElideRight
|
||||
color: UM.Theme.getColor("text")
|
||||
font: UM.Theme.getFont("medium")
|
||||
renderType: Text.NativeRendering
|
||||
return ""
|
||||
}
|
||||
font: UM.Theme.getFont("medium")
|
||||
iconColor: UM.Theme.getColor("machine_selector_printer_icon")
|
||||
iconSize: source != "" ? UM.Theme.getSize("machine_selector_icon").width: 0
|
||||
|
||||
UM.RecolorImage
|
||||
{
|
||||
|
|
|
@ -42,7 +42,7 @@ Button
|
|||
}
|
||||
text: machineSelectorButton.text
|
||||
color: UM.Theme.getColor("text")
|
||||
font: UM.Theme.getFont("action_button")
|
||||
font: UM.Theme.getFont("medium")
|
||||
visible: text != ""
|
||||
renderType: Text.NativeRendering
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
|
|
|
@ -73,7 +73,7 @@ Button
|
|||
text: definition.label
|
||||
textFormat: Text.PlainText
|
||||
renderType: Text.NativeRendering
|
||||
font: UM.Theme.getFont("setting_category")
|
||||
font: UM.Theme.getFont("default")
|
||||
color:
|
||||
{
|
||||
if (!base.enabled)
|
||||
|
@ -106,26 +106,7 @@ Button
|
|||
width: UM.Theme.getSize("standard_arrow").width
|
||||
height: UM.Theme.getSize("standard_arrow").height
|
||||
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)
|
||||
{
|
||||
return UM.Theme.getColor("setting_category_active_hover_text")
|
||||
}
|
||||
else if (base.pressed || (base.checkable && base.checked))
|
||||
{
|
||||
return UM.Theme.getColor("setting_category_active_text")
|
||||
}
|
||||
else if (base.hovered || base.activeFocus)
|
||||
{
|
||||
return UM.Theme.getColor("setting_category_hover_text")
|
||||
}
|
||||
return UM.Theme.getColor("setting_category_text")
|
||||
}
|
||||
color: UM.Theme.getColor("setting_control_button")
|
||||
source: base.checked ? UM.Theme.getIcon("arrow_bottom") : UM.Theme.getIcon("arrow_left")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ SettingItem
|
|||
sourceSize.width: width + 5 * screenScaleFactor
|
||||
sourceSize.height: width + 5 * screenScaleFactor
|
||||
|
||||
color: UM.Theme.getColor("setting_control_text")
|
||||
color: UM.Theme.getColor("setting_control_button")
|
||||
}
|
||||
|
||||
contentItem: Label
|
||||
|
|
|
@ -17,11 +17,16 @@ SettingItem
|
|||
id: control
|
||||
anchors.fill: parent
|
||||
|
||||
model: Cura.ExtrudersModel
|
||||
property var extrudersModel: CuraApplication.getExtrudersModel()
|
||||
|
||||
model: extrudersModel
|
||||
|
||||
Connections
|
||||
{
|
||||
target: extrudersModel
|
||||
onModelChanged:
|
||||
{
|
||||
control.color = getItem(control.currentIndex).color
|
||||
control.color = extrudersModel.getItem(control.currentIndex).color
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -105,7 +110,7 @@ SettingItem
|
|||
sourceSize.width: width + 5 * screenScaleFactor
|
||||
sourceSize.height: width + 5 * screenScaleFactor
|
||||
|
||||
color: UM.Theme.getColor("setting_control_text");
|
||||
color: UM.Theme.getColor("setting_control_button");
|
||||
}
|
||||
|
||||
background: Rectangle
|
||||
|
|
|
@ -12,15 +12,24 @@ SettingItem
|
|||
id: base
|
||||
property var focusItem: control
|
||||
|
||||
// Somehow if we directory set control.model to CuraApplication.getExtrudersModelWithOptional()
|
||||
// and in the Connections.onModelChanged use control.model as a reference, it will complain about
|
||||
// non-existing properties such as "onModelChanged" and "getItem". I guess if we access the model
|
||||
// via "control.model", it gives back a generic/abstract model instance. To avoid this, we add
|
||||
// this extra property to keep the ExtrudersModel and use this in the rest of the code.
|
||||
property var extrudersWithOptionalModel: CuraApplication.getExtrudersModelWithOptional()
|
||||
|
||||
contents: ComboBox
|
||||
{
|
||||
id: control
|
||||
anchors.fill: parent
|
||||
|
||||
model: Cura.ExtrudersModel
|
||||
model: base.extrudersWithOptionalModel
|
||||
|
||||
Connections
|
||||
{
|
||||
onModelChanged: control.color = getItem(control.currentIndex).color
|
||||
addOptionalExtruder: true
|
||||
target: base.extrudersWithOptionalModel
|
||||
onModelChanged: control.color = base.extrudersWithOptionalModel.getItem(control.currentIndex).color
|
||||
}
|
||||
|
||||
textRole: "name"
|
||||
|
@ -102,7 +111,7 @@ SettingItem
|
|||
sourceSize.width: width + 5 * screenScaleFactor
|
||||
sourceSize.height: width + 5 * screenScaleFactor
|
||||
|
||||
color: UM.Theme.getColor("setting_control_text");
|
||||
color: UM.Theme.getColor("setting_control_button");
|
||||
}
|
||||
|
||||
background: Rectangle
|
||||
|
|
|
@ -67,7 +67,7 @@ Item
|
|||
toolItem: UM.RecolorImage
|
||||
{
|
||||
source: UM.Theme.getIcon(model.icon) != "" ? UM.Theme.getIcon(model.icon) : "file:///" + model.location + "/" + model.icon
|
||||
color: UM.Theme.getColor("toolbar_button_text")
|
||||
color: UM.Theme.getColor("icon")
|
||||
|
||||
sourceSize: UM.Theme.getSize("button_icon")
|
||||
}
|
||||
|
@ -144,10 +144,7 @@ Item
|
|||
}
|
||||
}
|
||||
|
||||
Cura.ExtrudersModel
|
||||
{
|
||||
id: extrudersModel
|
||||
}
|
||||
property var extrudersModel: CuraApplication.getExtrudersModel()
|
||||
|
||||
UM.PointingRectangle
|
||||
{
|
||||
|
|
|
@ -11,5 +11,5 @@ UM.SimpleButton
|
|||
height: UM.Theme.getSize("small_button").height
|
||||
hoverColor: UM.Theme.getColor("small_button_text_hover")
|
||||
color: UM.Theme.getColor("small_button_text")
|
||||
iconMargin: 0.5 * UM.Theme.getSize("wide_lining").width
|
||||
iconMargin: UM.Theme.getSize("thick_lining").width
|
||||
}
|
|
@ -78,8 +78,6 @@ Cura.ExpandablePopup
|
|||
{
|
||||
id: viewSelectorPopup
|
||||
width: viewSelector.width - 2 * viewSelector.contentPadding
|
||||
leftPadding: UM.Theme.getSize("default_lining").width
|
||||
rightPadding: UM.Theme.getSize("default_lining").width
|
||||
|
||||
// For some reason the height/width of the column gets set to 0 if this is not set...
|
||||
Component.onCompleted:
|
||||
|
@ -109,7 +107,7 @@ Cura.ExpandablePopup
|
|||
id: buttonText
|
||||
text: viewsSelectorButton.text
|
||||
color: UM.Theme.getColor("text")
|
||||
font: UM.Theme.getFont("action_button")
|
||||
font: UM.Theme.getFont("medium")
|
||||
renderType: Text.NativeRendering
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
elide: Text.ElideRight
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue