CURA-5385 Project summary should use scroll view

This commit is contained in:
Ian Paschal 2018-05-22 16:29:04 +02:00
parent 7861840886
commit 0a395a7305

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016 Ultimaker B.V. // Copyright (c) 2018 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.1 import QtQuick 2.1
@ -61,237 +61,220 @@ UM.Dialog
{ {
id: palette id: palette
} }
Label
Column
{ {
anchors.fill: parent id: mainHeading
spacing: 2 * screenScaleFactor width: parent.width
Label text: catalog.i18nc("@action:title", "Summary - Cura Project")
font.pointSize: 18
anchors.top: parent.top
}
ScrollView
{
id: scroll
width: parent.width
anchors
{ {
id: titleLabel top: mainHeading.bottom
text: catalog.i18nc("@action:title", "Summary - Cura Project") topMargin: UM.Theme.getSize("default_margin").height
font.pointSize: 18 bottom: controls.top
bottomMargin: UM.Theme.getSize("default_margin").height
} }
Rectangle style: UM.Theme.styles.scrollview
ColumnLayout
{ {
id: separator spacing: UM.Theme.getSize("default_margin").height
color: palette.text Column
width: parent.width
height: 1
}
Item // Spacer
{
height: spacerHeight
width: height
}
Label
{
text: catalog.i18nc("@action:label", "Printer settings")
font.bold: true
}
Row
{
width: parent.width
height: childrenRect.height
Label
{ {
text: catalog.i18nc("@action:label", "Type")
width: (parent.width / 3) | 0
}
Label
{
text: (Cura.MachineManager.activeMachine == null) ? "" : Cura.MachineManager.activeMachine.definition.name
width: (parent.width / 3) | 0
}
}
Row
{
width: parent.width
height: childrenRect.height
Label
{
text: catalog.i18nc("@action:label", Cura.MachineManager.activeMachineNetworkGroupName != "" ? "Printer Group" : "Name")
width: (parent.width / 3) | 0
}
Label
{
text: Cura.MachineManager.activeMachineNetworkGroupName != "" ? Cura.MachineManager.activeMachineNetworkGroupName : Cura.MachineManager.activeMachineName
width: (parent.width / 3) | 0
}
}
Column
{
width: parent.width
visible: Cura.MachineManager.hasVariantBuildplates
Item // Spacer
{
height: spacerHeight
width: height
}
Row
{
width: parent.width
height: childrenRect.height
Label Label
{ {
text: catalog.i18nc("@action:label", "Build plate") id: settingsHeading
width: (parent.width / 3) | 0 text: catalog.i18nc("@action:label", "Printer settings")
font.bold: true
} }
Label
{
text: Cura.MachineManager.activeVariantBuildplateName
width: (parent.width / 3) | 0
}
}
}
Repeater
{
model: Cura.MachineManager.currentExtruderPositions
delegate: Column
{
Item // Spacer
{
height: spacerHeight
width: height
}
Label
{
text: catalog.i18nc("@action:label", "Extruder %1").arg(modelData)
}
height: childrenRect.height
width: parent.width
Row Row
{ {
width: parent.width width: parent.width
height: childrenRect.height height: childrenRect.height
Label Label
{ {
text: catalog.i18nc("@action:label", "%1 & material").arg(Cura.MachineManager.activeDefinitionVariantsName) text: catalog.i18nc("@action:label", "Type")
width: (parent.width / 3) | 0 width: Math.floor(scroll.width / 3) | 0
} }
Label Label
{ {
text: Cura.MachineManager.activeVariantNames[modelData] + ", " + Cura.MachineManager.getExtruder(modelData).material.name text: (Cura.MachineManager.activeMachine == null) ? "" : Cura.MachineManager.activeMachine.definition.name
width: (parent.width / 3) | 0 width: Math.floor(scroll.width / 3) | 0
}
}
Row
{
width: parent.width
height: childrenRect.height
Label
{
text: catalog.i18nc("@action:label", Cura.MachineManager.activeMachineNetworkGroupName != "" ? "Printer Group" : "Name")
width: Math.floor(scroll.width / 3) | 0
}
Label
{
text: Cura.MachineManager.activeMachineNetworkGroupName != "" ? Cura.MachineManager.activeMachineNetworkGroupName : Cura.MachineManager.activeMachineName
width: Math.floor(scroll.width / 3) | 0
}
}
}
Row
{
visible: Cura.MachineManager.hasVariantBuildplates
width: parent.width
height: childrenRect.height
Label
{
text: catalog.i18nc("@action:label", "Build plate")
width: Math.floor(scroll.width / 3) | 0
}
Label
{
text: Cura.MachineManager.activeVariantBuildplateName
width: Math.floor(scroll.width / 3) | 0
}
}
Repeater
{
width: parent.width
height: childrenRect.height
model: Cura.MachineManager.currentExtruderPositions
delegate: Column
{
height: childrenRect.height
width: parent.width
Label
{
text: catalog.i18nc("@action:label", "Extruder %1").arg(modelData)
font.bold: true
}
Row
{
width: parent.width
height: childrenRect.height
Label
{
text: catalog.i18nc("@action:label", "%1 & material").arg(Cura.MachineManager.activeDefinitionVariantsName)
width: Math.floor(scroll.width / 3) | 0
}
Label
{
text: Cura.MachineManager.activeVariantNames[modelData] + ", " + Cura.MachineManager.getExtruder(modelData).material.name
width: Math.floor(scroll.width / 3) | 0
}
}
}
}
Column
{
width: parent.width
height: childrenRect.height
Label
{
text: catalog.i18nc("@action:label", "Profile settings")
font.bold: true
}
Row
{
width: parent.width
Label
{
text: catalog.i18nc("@action:label", "Not in profile")
width: Math.floor(scroll.width / 3) | 0
}
Label
{
text: catalog.i18ncp("@action:label", "%1 override", "%1 overrides", Cura.MachineManager.numUserSettings).arg(Cura.MachineManager.numUserSettings)
width: Math.floor(scroll.width / 3) | 0
}
visible: Cura.MachineManager.numUserSettings
}
Row
{
width: parent.width
height: childrenRect.height
Label
{
text: catalog.i18nc("@action:label", "Name")
width: Math.floor(scroll.width / 3) | 0
}
Label
{
text: Cura.MachineManager.activeQualityOrQualityChangesName
width: Math.floor(scroll.width / 3) | 0
}
}
}
Column
{
width: parent.width
height: childrenRect.height
Label
{
text: catalog.i18nc("@action:label", "Setting visibility")
font.bold: true
}
Row
{
width: parent.width
height: childrenRect.height
Label
{
text: catalog.i18nc("@action:label", "Visible settings:")
width: Math.floor(scroll.width / 3) | 0
}
Label
{
text: catalog.i18nc("@action:label", "%1 out of %2" ).arg(definitionsModel.visibleCount).arg(Cura.MachineManager.totalNumberOfSettings)
width: Math.floor(scroll.width / 3) | 0
} }
} }
} }
} }
Item // Spacer
{
height: spacerHeight
width: height
}
Label
{
text: catalog.i18nc("@action:label", "Profile settings")
font.bold: true
}
Row
{
width: parent.width
Label
{
text: catalog.i18nc("@action:label", "Not in profile")
width: (parent.width / 3) | 0
}
Label
{
text: catalog.i18ncp("@action:label", "%1 override", "%1 overrides", Cura.MachineManager.numUserSettings).arg(Cura.MachineManager.numUserSettings)
width: (parent.width / 3) | 0
}
visible: Cura.MachineManager.numUserSettings
}
Row
{
width: parent.width
height: childrenRect.height
Label
{
text: catalog.i18nc("@action:label", "Name")
width: (parent.width / 3) | 0
}
Label
{
text: Cura.MachineManager.activeQualityOrQualityChangesName
width: (parent.width / 3) | 0
}
}
Item // Spacer
{
height: spacerHeight
width: height
}
Label
{
text: catalog.i18nc("@action:label", "Setting visibility")
font.bold: true
}
Row
{
width: parent.width
height: childrenRect.height
Label
{
text: catalog.i18nc("@action:label", "Visible settings:")
width: (parent.width / 3) | 0
}
Label
{
text: catalog.i18nc("@action:label", "%1 out of %2" ).arg(definitionsModel.visibleCount).arg(Cura.MachineManager.totalNumberOfSettings)
width: (parent.width / 3) | 0
}
}
Item // Spacer
{
height: spacerHeight
width: height
}
} }
Item
CheckBox
{ {
id: dontShowAgainCheckbox id: controls
anchors.bottom: cancel_button.top width: parent.width
anchors.bottomMargin: UM.Theme.getSize("default_margin").height height: childrenRect.height
anchors.left: parent.left
text: catalog.i18nc("@action:label", "Don't show project summary on save again")
checked: dontShowAgain
}
Button
{
id: cancel_button
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.right: ok_button.left CheckBox
anchors.rightMargin: 2 {
id: dontShowAgainCheckbox
text: catalog.i18nc("@action:button","Cancel"); anchors.left: parent.left
enabled: true text: catalog.i18nc("@action:label", "Don't show project summary on save again")
onClicked: close() checked: dontShowAgain
} }
Button
Button {
{ id: cancel_button
id: ok_button anchors
anchors.bottom: parent.bottom {
anchors.right: parent.right right: ok_button.left
rightMargin: UM.Theme.getSize("default_margin").width
text: catalog.i18nc("@action:button","Save"); }
enabled: true text: catalog.i18nc("@action:button","Cancel");
onClicked: { enabled: true
close() onClicked: close()
yes() }
Button
{
id: ok_button
anchors.right: parent.right
text: catalog.i18nc("@action:button","Save");
enabled: true
onClicked:
{
close()
yes()
}
} }
} }
} }
} }