This commit is contained in:
fieldOfView 2016-07-25 11:30:47 +02:00
commit ac0de58ecb
21 changed files with 417 additions and 10447 deletions

View file

@ -21,11 +21,13 @@ Item {
property var showRevertButton: true
property var showInheritButton: true
property var showLinkedSettingIcon: true
property var doDepthIndentation: true
property var doQualityUserSettingEmphasis: true
// Create properties to put property provider stuff in (bindings break in qt 5.5.1 otherwise)
property var state: propertyProvider.properties.state
property var settablePerExtruder: propertyProvider.properties.settable_per_extruder
property var stackLevels: propertyProvider.stackLevels
property var stackLevel: stackLevels[0]
@ -132,6 +134,26 @@ Item {
verticalCenter: parent.verticalCenter
}
UM.SimpleButton
{
id: linkedSettingIcon;
visible: base.settablePerExtruder != "True" && base.showLinkedSettingIcon
height: parent.height;
width: height;
backgroundColor: UM.Theme.getColor("setting_control");
hoverBackgroundColor: UM.Theme.getColor("setting_control")
color: UM.Theme.getColor("setting_control_button")
hoverColor: UM.Theme.getColor("setting_control_button")
iconSource: UM.Theme.getIcon("link")
onEntered: { hoverTimer.stop(); base.showTooltip(catalog.i18nc("@label", "This setting is always shared between all extruders. Changing it here will change the value for all extruders")) }
onExited: base.showTooltip(base.tooltipText);
}
UM.SimpleButton
{
id: revertButton;
@ -232,7 +254,6 @@ Item {
onEntered: { hoverTimer.stop(); base.showTooltip(catalog.i18nc("@label", "This setting is normally calculated, but it currently has an absolute value set.\n\nClick to restore the calculated value.")) }
onExited: base.showTooltip(base.tooltipText);
}
}
Item

View file

@ -34,14 +34,7 @@ ScrollView
expanded: Printer.expandedCategories
onExpandedChanged: Printer.setExpandedCategories(expanded)
filter:
{
if(ExtruderManager.activeExtruderStackId)
{
return { "settable_per_extruder": true }
}
return { }
}
filter: {}
}
delegate: Loader
@ -53,7 +46,15 @@ ScrollView
Behavior on height { NumberAnimation { duration: 100 } }
opacity: provider.properties.enabled == "True" ? 1 : 0
Behavior on opacity { NumberAnimation { duration: 100 } }
enabled: provider.properties.enabled == "True"
enabled:
{
if(!ExtruderManager.activeExtruderStackId && ExtruderManager.extruderCount > 0)
{
// disable all controls on the global tab, except categories
return model.type == "category"
}
return provider.properties.enabled == "True"
}
property var definition: model
property var settingDefinitionsModel: definitionsModel
@ -88,20 +89,59 @@ ScrollView
}
}
// Binding to ensure that the right containerstack ID is set for the provider.
// This ensures that if a setting has a global_inherits_stack id (for instance; Support speed points to the
// extruder that actually prints the support, as that is the setting we need to use to calculate the value)
Binding
{
target: provider
property: "containerStackId"
value:
{
if(inheritStackProvider.properties.global_inherits_stack == -1 || inheritStackProvider.properties.global_inherits_stack == null)
{
if( ExtruderManager.activeExtruderStackId)
{
return ExtruderManager.activeExtruderStackId
}
else
{
return Cura.MachineManager.activeMachineId
}
}
return ExtruderManager.extruderIds[String(inheritStackProvider.properties.global_inherits_stack)]
}
}
// Specialty provider that only watches global_inherits (we cant filter on what property changed we get events
// so we bypass that to make a dedicated provider.
UM.SettingPropertyProvider
{
id: inheritStackProvider
containerStackId: Cura.MachineManager.activeMachineId
key: model.key
watchedProperties: [ "global_inherits_stack"]
}
UM.SettingPropertyProvider
{
id: provider
containerStackId: ExtruderManager.activeExtruderStackId ? ExtruderManager.activeExtruderStackId : Cura.MachineManager.activeMachineId
containerStackId: delegate.stackId
key: model.key ? model.key : ""
watchedProperties: [ "value", "enabled", "state", "validationState" ]
watchedProperties: [ "value", "enabled", "state", "validationState", "settable_per_extruder" ]
storeIndex: 0
}
Connections
{
target: item
onContextMenuRequested: { contextMenu.key = model.key; contextMenu.popup() }
onContextMenuRequested:
{
contextMenu.key = model.key;
contextMenu.provider = provider
contextMenu.popup();
}
onShowTooltip: base.showTooltip(delegate, { x: 0, y: delegate.height / 2 }, text)
onHideTooltip: base.hideTooltip()
}
@ -133,9 +173,24 @@ ScrollView
Menu
{
id: contextMenu;
id: contextMenu
property string key;
property string key
property var provider
MenuItem
{
//: Settings context menu action
text: catalog.i18nc("@action:menu", "Copy value to all extruders")
visible: machineExtruderCount.properties.value > 1
enabled: contextMenu.provider.properties.settable_per_extruder != "False"
onTriggered: Cura.MachineManager.copyValueToExtruders(contextMenu.key)
}
MenuSeparator
{
visible: machineExtruderCount.properties.value > 1
}
MenuItem
{
@ -151,5 +206,15 @@ ScrollView
onTriggered: Cura.Actions.configureSettingVisibility.trigger(contextMenu);
}
}
UM.SettingPropertyProvider
{
id: machineExtruderCount
containerStackId: Cura.MachineManager.activeMachineId
key: "machine_extruder_count"
watchedProperties: [ "value" ]
storeIndex: 0
}
}
}

View file

@ -84,15 +84,15 @@ Column
orientation: ListView.Horizontal
model: Cura.ExtrudersModel { id: extrudersModel; addGlobal: true }
model: Cura.ExtrudersModel { id: extrudersModel; addGlobal: false }
Connections
{
target: Cura.MachineManager
onGlobalContainerChanged:
{
base.currentExtruderIndex = -1;
forceActiveFocus()
forceActiveFocus() // Changing focus applies the currently-being-typed values so it can change the displayed setting values.
base.currentExtruderIndex = (machineExtruderCount.properties.value == 1) ? -1 : 0;
ExtruderManager.setActiveExtruderIndex(base.currentExtruderIndex);
}
}
@ -110,7 +110,7 @@ Column
onClicked:
{
forceActiveFocus() //Changing focus applies the currently-being-typed values so it can change the displayed setting values.
forceActiveFocus() // Changing focus applies the currently-being-typed values so it can change the displayed setting values.
base.currentExtruderIndex = index;
ExtruderManager.setActiveExtruderIndex(index);
}
@ -258,6 +258,8 @@ Column
{
id: globalProfileSelection
text: Cura.MachineManager.activeQualityName
enabled: !extrudersList.visible || base.currentExtruderIndex > -1
width: parent.width * 0.55 + UM.Theme.getSize("default_margin").width
height: UM.Theme.getSize("setting_control").height
tooltip: Cura.MachineManager.activeQualityName

View file

@ -19,6 +19,7 @@ Item
property Action configureSettings;
property variant minimumPrintTime: PrintInformation.minimumPrintTime;
property variant maximumPrintTime: PrintInformation.maximumPrintTime;
property bool settingsEnabled: ExtruderManager.activeExtruderStackId || ExtruderManager.extruderCount == 0
Component.onCompleted: PrintInformation.enabled = true
Component.onDestruction: PrintInformation.enabled = false
@ -81,7 +82,11 @@ Item
height: width
border.color: {
if(infillListView.activeIndex == index)
if(!base.settingsEnabled)
{
return UM.Theme.getColor("setting_control_disabled_border")
}
else if(infillListView.activeIndex == index)
{
return UM.Theme.getColor("setting_control_selected")
}
@ -92,7 +97,17 @@ Item
return UM.Theme.getColor("setting_control_border")
}
border.width: UM.Theme.getSize("default_lining").width
color: infillListView.activeIndex == index ? UM.Theme.getColor("setting_control_selected") : "transparent"
color: {
if(infillListView.activeIndex == index)
{
if(!base.settingsEnabled)
{
return UM.Theme.getColor("setting_control_disabled_text")
}
return UM.Theme.getColor("setting_control_selected")
}
return "transparent"
}
UM.RecolorImage {
id: infillIcon
@ -102,13 +117,24 @@ Item
sourceSize.width: width
sourceSize.height: width
source: UM.Theme.getIcon(model.icon);
color: (infillListView.activeIndex == index) ? UM.Theme.getColor("text_white") : UM.Theme.getColor("text")
color: {
if(infillListView.activeIndex == index)
{
return UM.Theme.getColor("text_reversed")
}
if(!base.settingsEnabled)
{
return UM.Theme.getColor("setting_control_disabled_text")
}
return UM.Theme.getColor("text")
}
}
MouseArea {
id: infillMouseArea
anchors.fill: parent
hoverEnabled: true
enabled: base.settingsEnabled
onClicked: {
if (infillListView.activeIndex != index)
{
@ -206,6 +232,7 @@ Item
//: Setting enable skirt adhesion checkbox
text: catalog.i18nc("@option:check", "Print Brim");
style: UM.Theme.styles.checkbox;
enabled: base.settingsEnabled
checked: platformAdhesionType.properties.value == "brim"
@ -213,6 +240,7 @@ Item
id: brimMouseArea
anchors.fill: parent
hoverEnabled: true
enabled: base.settingsEnabled
onClicked:
{
platformAdhesionType.setPropertyValue("value", !parent.checked ? "brim" : "skirt")
@ -254,12 +282,14 @@ Item
//: Setting enable support checkbox
text: catalog.i18nc("@option:check", "Print Support Structure");
style: UM.Theme.styles.checkbox;
enabled: base.settingsEnabled
checked: supportEnabled.properties.value == "True"
MouseArea {
id: supportMouseArea
anchors.fill: parent
hoverEnabled: true
enabled: base.settingsEnabled
onClicked:
{
supportEnabled.setPropertyValue("value", !parent.checked)
@ -288,6 +318,7 @@ Item
width: parent.width / 100 * 45
style: UM.Theme.styles.combobox
enabled: base.settingsEnabled
property alias _hovered: supportExtruderMouseArea.containsMouse
currentIndex: supportEnabled.properties.value == "True" ? parseFloat(supportExtruderNr.properties.value) + 1 : 0
@ -303,6 +334,7 @@ Item
id: supportExtruderMouseArea
anchors.fill: parent
hoverEnabled: true
enabled: base.settingsEnabled
acceptedButtons: Qt.NoButton
onEntered:
{
@ -382,7 +414,7 @@ Item
{
id: platformAdhesionType
containerStackId: Cura.MachineManager.activeMachineId
containerStackId: Cura.MachineManager.activeStackId
key: "adhesion_type"
watchedProperties: [ "value" ]
storeIndex: 0
@ -392,7 +424,7 @@ Item
{
id: supportEnabled
containerStackId: Cura.MachineManager.activeMachineId
containerStackId: Cura.MachineManager.activeStackId
key: "support_enable"
watchedProperties: [ "value" ]
storeIndex: 0
@ -412,7 +444,7 @@ Item
{
id: supportExtruderNr
containerStackId: Cura.MachineManager.activeMachineId
containerStackId: Cura.MachineManager.activeStackId
key: "support_extruder_nr"
watchedProperties: [ "value" ]
storeIndex: 0