CURA-4400 make extruder combobox disabled items grey

This commit is contained in:
Jack Ha 2018-03-01 16:22:40 +01:00
parent ba7b18a88b
commit 2538c689f1
3 changed files with 25 additions and 5 deletions

View file

@ -17,14 +17,22 @@ SettingItem
id: control
anchors.fill: parent
model: Cura.ExtrudersModel { onModelChanged: control.color = getItem(control.currentIndex).color }
model: Cura.ExtrudersModel {
onModelChanged: {
control.color = getItem(control.currentIndex).color;
}
}
textRole: "name"
onActivated:
{
forceActiveFocus();
propertyProvider.setPropertyValue("value", model.getItem(index).index);
if (model.getItem(index).enabled) {
forceActiveFocus();
propertyProvider.setPropertyValue("value", model.getItem(index).index);
} else {
currentIndex = propertyProvider.properties.value; // keep the old value
}
}
onActiveFocusChanged:
@ -173,7 +181,13 @@ SettingItem
{
text: model.name
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")
elide: Text.ElideRight
verticalAlignment: Text.AlignVCenter