mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 15:07:28 -06:00
CURA-4400 optional_extruders cannot be set to disabled extruders anymore
This commit is contained in:
parent
c21b19a910
commit
05cd937df3
3 changed files with 24 additions and 4 deletions
|
@ -210,6 +210,7 @@ class ExtrudersModel(UM.Qt.ListModel.ListModel):
|
||||||
item = {
|
item = {
|
||||||
"id": "",
|
"id": "",
|
||||||
"name": catalog.i18nc("@menuitem", "Not overridden"),
|
"name": catalog.i18nc("@menuitem", "Not overridden"),
|
||||||
|
"enabled": True,
|
||||||
"color": "#ffffff",
|
"color": "#ffffff",
|
||||||
"index": -1,
|
"index": -1,
|
||||||
"definition": ""
|
"definition": ""
|
||||||
|
|
|
@ -215,7 +215,8 @@ SettingItem
|
||||||
{
|
{
|
||||||
text: model.name
|
text: model.name
|
||||||
renderType: Text.NativeRendering
|
renderType: Text.NativeRendering
|
||||||
color: {
|
color:
|
||||||
|
{
|
||||||
if (model.enabled) {
|
if (model.enabled) {
|
||||||
UM.Theme.getColor("setting_control_text")
|
UM.Theme.getColor("setting_control_text")
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -27,8 +27,19 @@ SettingItem
|
||||||
|
|
||||||
onActivated:
|
onActivated:
|
||||||
{
|
{
|
||||||
forceActiveFocus();
|
if (model.getItem(index).enabled)
|
||||||
propertyProvider.setPropertyValue("value", model.getItem(index).index);
|
{
|
||||||
|
forceActiveFocus();
|
||||||
|
propertyProvider.setPropertyValue("value", model.getItem(index).index);
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
if (propertyProvider.properties.value == -1)
|
||||||
|
{
|
||||||
|
control.currentIndex = model.rowCount() - 1; // we know the last item is "Not overriden"
|
||||||
|
} else {
|
||||||
|
control.currentIndex = propertyProvider.properties.value; // revert to the old value
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onActiveFocusChanged:
|
onActiveFocusChanged:
|
||||||
|
@ -192,7 +203,14 @@ SettingItem
|
||||||
{
|
{
|
||||||
text: model.name
|
text: model.name
|
||||||
renderType: Text.NativeRendering
|
renderType: Text.NativeRendering
|
||||||
color: UM.Theme.getColor("setting_control_text")
|
color:
|
||||||
|
{
|
||||||
|
if (model.enabled) {
|
||||||
|
UM.Theme.getColor("setting_control_text")
|
||||||
|
} else {
|
||||||
|
UM.Theme.getColor("action_button_disabled_text");
|
||||||
|
}
|
||||||
|
}
|
||||||
font: UM.Theme.getFont("default")
|
font: UM.Theme.getFont("default")
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue