Show settings in profile as a sorted list with section headers

CURA-1585
This commit is contained in:
fieldOfView 2016-06-07 11:18:09 +02:00
parent bbc33f5d70
commit ce388c4b23

View File

@ -91,20 +91,14 @@ UM.ManagementPage
elide: Text.ElideRight elide: Text.ElideRight
} }
ScrollView { Row {
id: currentSettingsActions
visible: base.currentItem.id == -1 || currentItem.id == Cura.MachineManager.activeQualityId
anchors.left: parent.left anchors.left: parent.left
anchors.top: profileName.bottom anchors.top: profileName.bottom
anchors.topMargin: UM.Theme.getSize("default_margin").height anchors.topMargin: UM.Theme.getSize("default_margin").height
anchors.right: parent.right
anchors.bottom: parent.bottom
Column
{
spacing: UM.Theme.getSize("default_margin").height
Row
{
visible: base.currentItem.id == -1 || currentItem.id == Cura.MachineManager.activeQualityId
Button Button
{ {
text: { text: {
@ -124,37 +118,36 @@ UM.ManagementPage
} }
} }
Grid ScrollView {
{ id: scrollView
id: containerGrid
columns: 2 anchors.left: parent.left
anchors.top: currentSettingsActions.visible ? currentSettingsActions.bottom : profileName.bottom
anchors.topMargin: UM.Theme.getSize("default_margin").height
anchors.right: parent.right
anchors.bottom: parent.bottom
ListView {
model: base.currentItem ? base.currentItem.settings: null
delegate: Row {
spacing: UM.Theme.getSize("default_margin").width spacing: UM.Theme.getSize("default_margin").width
Label { Label {
text: base.currentItem == null ? "" : text: model.label
base.currentItem.id == -1 ? catalog.i18nc("@label", "Based on") : catalog.i18nc("@label", "Profile type") elide: Text.ElideMiddle
width: scrollView.width / 100 * 40
} }
Label { Label {
text: base.currentItem == null ? "" : text: model.value.toString()
base.currentItem.id == -1 ? Cura.MachineManager.activeQualityName:
base.currentItem.metadata.read_only ? catalog.i18nc("@label", "Protected profile") : catalog.i18nc("@label", "Custom profile")
} }
Column {
Repeater {
model: base.currentItem ? base.currentItem.settings : null
Label { Label {
text: modelData.label text: model.unit
elide: Text.ElideMiddle;
}
}
}
Column {
Repeater {
model: base.currentItem ? base.currentItem.settings : null
Label { text: modelData.value.toString(); }
} }
} }
section.property: "category"
section.criteria: ViewSection.FullString
section.delegate: Label {
text: section
font.bold: true
} }
} }
} }