Disable simple mode controls on global tab

CURA-1758
This commit is contained in:
fieldOfView 2016-07-18 14:58:48 +02:00
parent 7302baa7da
commit 3923d43567
2 changed files with 40 additions and 8 deletions

View File

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

View File

@ -56,7 +56,7 @@
"text_inactive": [174, 174, 174, 255], "text_inactive": [174, 174, 174, 255],
"text_hover": [70, 84, 113, 255], "text_hover": [70, 84, 113, 255],
"text_pressed": [12, 169, 227, 255], "text_pressed": [12, 169, 227, 255],
"text_white": [255, 255, 255, 255], "text_reversed": [255, 255, 255, 255],
"text_subtext": [70, 84, 113, 255], "text_subtext": [70, 84, 113, 255],
"error": [255, 140, 0, 255], "error": [255, 140, 0, 255],