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,32 +61,34 @@ UM.Dialog
{ {
id: palette id: palette
} }
Column
{
anchors.fill: parent
spacing: 2 * screenScaleFactor
Label Label
{ {
id: titleLabel id: mainHeading
width: parent.width
text: catalog.i18nc("@action:title", "Summary - Cura Project") text: catalog.i18nc("@action:title", "Summary - Cura Project")
font.pointSize: 18 font.pointSize: 18
anchors.top: parent.top
} }
Rectangle ScrollView
{ {
id: separator id: scroll
color: palette.text
width: parent.width width: parent.width
height: 1 anchors
}
Item // Spacer
{ {
height: spacerHeight top: mainHeading.bottom
width: height topMargin: UM.Theme.getSize("default_margin").height
bottom: controls.top
bottomMargin: UM.Theme.getSize("default_margin").height
} }
style: UM.Theme.styles.scrollview
ColumnLayout
{
spacing: UM.Theme.getSize("default_margin").height
Column
{
Label Label
{ {
id: settingsHeading
text: catalog.i18nc("@action:label", "Printer settings") text: catalog.i18nc("@action:label", "Printer settings")
font.bold: true font.bold: true
} }
@ -97,12 +99,12 @@ UM.Dialog
Label Label
{ {
text: catalog.i18nc("@action:label", "Type") text: catalog.i18nc("@action:label", "Type")
width: (parent.width / 3) | 0 width: Math.floor(scroll.width / 3) | 0
} }
Label Label
{ {
text: (Cura.MachineManager.activeMachine == null) ? "" : Cura.MachineManager.activeMachine.definition.name text: (Cura.MachineManager.activeMachine == null) ? "" : Cura.MachineManager.activeMachine.definition.name
width: (parent.width / 3) | 0 width: Math.floor(scroll.width / 3) | 0
} }
} }
Row Row
@ -112,56 +114,45 @@ UM.Dialog
Label Label
{ {
text: catalog.i18nc("@action:label", Cura.MachineManager.activeMachineNetworkGroupName != "" ? "Printer Group" : "Name") text: catalog.i18nc("@action:label", Cura.MachineManager.activeMachineNetworkGroupName != "" ? "Printer Group" : "Name")
width: (parent.width / 3) | 0 width: Math.floor(scroll.width / 3) | 0
} }
Label Label
{ {
text: Cura.MachineManager.activeMachineNetworkGroupName != "" ? Cura.MachineManager.activeMachineNetworkGroupName : Cura.MachineManager.activeMachineName text: Cura.MachineManager.activeMachineNetworkGroupName != "" ? Cura.MachineManager.activeMachineNetworkGroupName : Cura.MachineManager.activeMachineName
width: (parent.width / 3) | 0 width: Math.floor(scroll.width / 3) | 0
} }
} }
Column
{
width: parent.width
visible: Cura.MachineManager.hasVariantBuildplates
Item // Spacer
{
height: spacerHeight
width: height
} }
Row Row
{ {
visible: Cura.MachineManager.hasVariantBuildplates
width: parent.width width: parent.width
height: childrenRect.height height: childrenRect.height
Label Label
{ {
text: catalog.i18nc("@action:label", "Build plate") text: catalog.i18nc("@action:label", "Build plate")
width: (parent.width / 3) | 0 width: Math.floor(scroll.width / 3) | 0
} }
Label Label
{ {
text: Cura.MachineManager.activeVariantBuildplateName text: Cura.MachineManager.activeVariantBuildplateName
width: (parent.width / 3) | 0 width: Math.floor(scroll.width / 3) | 0
} }
} }
}
Repeater Repeater
{ {
width: parent.width
height: childrenRect.height
model: Cura.MachineManager.currentExtruderPositions model: Cura.MachineManager.currentExtruderPositions
delegate: Column delegate: Column
{ {
Item // Spacer height: childrenRect.height
{ width: parent.width
height: spacerHeight
width: height
}
Label Label
{ {
text: catalog.i18nc("@action:label", "Extruder %1").arg(modelData) text: catalog.i18nc("@action:label", "Extruder %1").arg(modelData)
font.bold: true
} }
height: childrenRect.height
width: parent.width
Row Row
{ {
width: parent.width width: parent.width
@ -169,23 +160,20 @@ UM.Dialog
Label Label
{ {
text: catalog.i18nc("@action:label", "%1 & material").arg(Cura.MachineManager.activeDefinitionVariantsName) text: catalog.i18nc("@action:label", "%1 & material").arg(Cura.MachineManager.activeDefinitionVariantsName)
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.activeVariantNames[modelData] + ", " + Cura.MachineManager.getExtruder(modelData).material.name
width: (parent.width / 3) | 0 width: Math.floor(scroll.width / 3) | 0
} }
} }
} }
} }
Column
Item // Spacer
{ {
height: spacerHeight width: parent.width
width: height height: childrenRect.height
}
Label Label
{ {
text: catalog.i18nc("@action:label", "Profile settings") text: catalog.i18nc("@action:label", "Profile settings")
@ -197,12 +185,12 @@ UM.Dialog
Label Label
{ {
text: catalog.i18nc("@action:label", "Not in profile") text: catalog.i18nc("@action:label", "Not in profile")
width: (parent.width / 3) | 0 width: Math.floor(scroll.width / 3) | 0
} }
Label Label
{ {
text: catalog.i18ncp("@action:label", "%1 override", "%1 overrides", Cura.MachineManager.numUserSettings).arg(Cura.MachineManager.numUserSettings) text: catalog.i18ncp("@action:label", "%1 override", "%1 overrides", Cura.MachineManager.numUserSettings).arg(Cura.MachineManager.numUserSettings)
width: (parent.width / 3) | 0 width: Math.floor(scroll.width / 3) | 0
} }
visible: Cura.MachineManager.numUserSettings visible: Cura.MachineManager.numUserSettings
} }
@ -213,22 +201,20 @@ UM.Dialog
Label Label
{ {
text: catalog.i18nc("@action:label", "Name") text: catalog.i18nc("@action:label", "Name")
width: (parent.width / 3) | 0 width: Math.floor(scroll.width / 3) | 0
} }
Label Label
{ {
text: Cura.MachineManager.activeQualityOrQualityChangesName text: Cura.MachineManager.activeQualityOrQualityChangesName
width: (parent.width / 3) | 0 width: Math.floor(scroll.width / 3) | 0
} }
} }
}
Item // Spacer Column
{ {
height: spacerHeight width: parent.width
width: height height: childrenRect.height
}
Label Label
{ {
text: catalog.i18nc("@action:label", "Setting visibility") text: catalog.i18nc("@action:label", "Setting visibility")
@ -241,57 +227,54 @@ UM.Dialog
Label Label
{ {
text: catalog.i18nc("@action:label", "Visible settings:") text: catalog.i18nc("@action:label", "Visible settings:")
width: (parent.width / 3) | 0 width: Math.floor(scroll.width / 3) | 0
} }
Label Label
{ {
text: catalog.i18nc("@action:label", "%1 out of %2" ).arg(definitionsModel.visibleCount).arg(Cura.MachineManager.totalNumberOfSettings) text: catalog.i18nc("@action:label", "%1 out of %2" ).arg(definitionsModel.visibleCount).arg(Cura.MachineManager.totalNumberOfSettings)
width: (parent.width / 3) | 0 width: Math.floor(scroll.width / 3) | 0
} }
} }
}
Item // Spacer }
}
Item
{ {
height: spacerHeight id: controls
width: height width: parent.width
} height: childrenRect.height
} anchors.bottom: parent.bottom
CheckBox CheckBox
{ {
id: dontShowAgainCheckbox id: dontShowAgainCheckbox
anchors.bottom: cancel_button.top
anchors.bottomMargin: UM.Theme.getSize("default_margin").height
anchors.left: parent.left anchors.left: parent.left
text: catalog.i18nc("@action:label", "Don't show project summary on save again") text: catalog.i18nc("@action:label", "Don't show project summary on save again")
checked: dontShowAgain checked: dontShowAgain
} }
Button Button
{ {
id: cancel_button id: cancel_button
anchors.bottom: parent.bottom anchors
anchors.right: ok_button.left {
anchors.rightMargin: 2 right: ok_button.left
rightMargin: UM.Theme.getSize("default_margin").width
}
text: catalog.i18nc("@action:button","Cancel"); text: catalog.i18nc("@action:button","Cancel");
enabled: true enabled: true
onClicked: close() onClicked: close()
} }
Button Button
{ {
id: ok_button id: ok_button
anchors.bottom: parent.bottom
anchors.right: parent.right anchors.right: parent.right
text: catalog.i18nc("@action:button","Save"); text: catalog.i18nc("@action:button","Save");
enabled: true enabled: true
onClicked: { onClicked:
{
close() close()
yes() yes()
} }
} }
} }
} }
}