This commit is contained in:
Jaime van Kessel 2016-05-26 15:35:51 +02:00
commit c2a25b131e
16 changed files with 228 additions and 158 deletions

View file

@ -89,7 +89,7 @@ Item {
{
id: revertButton;
visible: propertyProvider.properties.state == "InstanceState.User"
visible: propertyProvider.stackLevel == 0
height: parent.height;
width: height;
@ -102,8 +102,8 @@ Item {
iconSource: UM.Theme.getIcon("reset")
onClicked: {
base.resetRequested()
controlContainer.notifyReset();
revertButton.focus = true
propertyProvider.removeFromContainer(0)
}
onEntered: base.showTooltip(catalog.i18nc("@label", "This setting has a value that is different from the profile.\n\nClick to restore the value of the profile."))
@ -116,14 +116,14 @@ Item {
id: inheritButton;
//visible: has_profile_value && base.has_inherit_function && base.is_enabled
visible: propertyProvider.properties.state == "InstanceState.User"
visible: propertyProvider.properties.state == "InstanceState.User" && propertyProvider.stackLevel > 0
height: parent.height;
width: height;
onClicked: {
base.resetToDefaultRequested();
controlContainer.notifyReset();
focus = true;
propertyProvider.removeFromContainer(propertyProvider.stackLevel)
}
backgroundColor: UM.Theme.getColor("setting_control");

View file

@ -38,18 +38,20 @@ ScrollView
id: delegate
width: UM.Theme.getSize("sidebar").width;
height: provider.properties.enabled ? UM.Theme.getSize("section").height : 0
height: provider.properties.enabled == "True" ? UM.Theme.getSize("section").height : 0
Behavior on height { NumberAnimation { duration: 100 } }
opacity: provider.properties.enabled ? 1 : 0
opacity: provider.properties.enabled == "True" ? 1 : 0
Behavior on opacity { NumberAnimation { duration: 100 } }
enabled: provider.properties.enabled
enabled: provider.properties.enabled == "True"
property var definition: model
property var settingDefinitionsModel: definitionsModel
property var propertyProvider: provider
//Qt5.4.2 and earlier has a bug where this causes a crash: https://bugreports.qt.io/browse/QTBUG-35989
asynchronous: QT_VERSION_STR.split(".")[1] >= 5
//In addition, while it works for 5.5 and higher, the ordering of the actual combo box drop down changes,
//causing nasty issues when selecting differnt options. So disable asynchronous loading of enum type completely.
asynchronous: model.type != "enum"
source:
{