Cleaned up the QML

This moves all the "default" margins of the welcome pages into a single point (the WizardPanel)
in order to prevent having to re-define it every time.
I've also fixed some incorrect margins that we had

CURA-6057
This commit is contained in:
Jaime van Kessel 2019-04-01 13:44:27 +02:00
parent 1d6d3d729d
commit 74903fe3e5
8 changed files with 46 additions and 57 deletions

View File

@ -19,7 +19,6 @@ Item
{ {
id: titleLabel id: titleLabel
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: UM.Theme.getSize("wide_margin").height
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
text: catalog.i18nc("@label", "Add a printer") text: catalog.i18nc("@label", "Add a printer")
@ -110,7 +109,6 @@ Item
id: nextButton id: nextButton
anchors.right: parent.right anchors.right: parent.right
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.margins: UM.Theme.getSize("wide_margin").width
enabled: enabled:
{ {
// If the network printer dropdown is expanded, make sure that there is a selected item // If the network printer dropdown is expanded, make sure that there is a selected item

View File

@ -31,7 +31,6 @@ Item
{ {
id: titleLabel id: titleLabel
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: UM.Theme.getSize("wide_margin").height
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
text: catalog.i18nc("@label", "Ultimaker Cloud") text: catalog.i18nc("@label", "Ultimaker Cloud")
@ -44,11 +43,15 @@ Item
Item Item
{ {
id: cloudContentsArea id: cloudContentsArea
anchors.top: titleLabel.bottom anchors
anchors.bottom: finishButton.top {
anchors.left: parent.left top: titleLabel.bottom
anchors.right: parent.right bottom: finishButton.top
anchors.margins: UM.Theme.getSize("default_margin").width left: parent.left
right: parent.right
topMargin: UM.Theme.getSize("default_margin").height
}
// Pictures and texts are arranged using Columns with spacing. The whole picture and text area is centered in // Pictures and texts are arranged using Columns with spacing. The whole picture and text area is centered in
// the cloud contents area. // the cloud contents area.
@ -113,7 +116,6 @@ Item
id: finishButton id: finishButton
anchors.right: parent.right anchors.right: parent.right
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.margins: UM.Theme.getSize("wide_margin").width
text: catalog.i18nc("@button", "Finish") text: catalog.i18nc("@button", "Finish")
onClicked: base.showNextPage() onClicked: base.showNextPage()
} }
@ -123,7 +125,6 @@ Item
id: createAccountButton id: createAccountButton
anchors.left: parent.left anchors.left: parent.left
anchors.verticalCenter: finishButton.verticalCenter anchors.verticalCenter: finishButton.verticalCenter
anchors.margins: UM.Theme.getSize("wide_margin").width
text: catalog.i18nc("@button", "Create an account") text: catalog.i18nc("@button", "Create an account")
onClicked: Qt.openUrlExternally(CuraApplication.ultimakerCloudAccountRootUrl + "/app/create") onClicked: Qt.openUrlExternally(CuraApplication.ultimakerCloudAccountRootUrl + "/app/create")
} }
@ -133,7 +134,7 @@ Item
id: signInButton id: signInButton
anchors.left: createAccountButton.right anchors.left: createAccountButton.right
anchors.verticalCenter: finishButton.verticalCenter anchors.verticalCenter: finishButton.verticalCenter
anchors.margins: UM.Theme.getSize("wide_margin").width anchors.leftMargin: UM.Theme.getSize("default_margin").width
text: catalog.i18nc("@button", "Sign in") text: catalog.i18nc("@button", "Sign in")
color: UM.Theme.getColor("secondary_button_text") color: UM.Theme.getColor("secondary_button_text")
font: UM.Theme.getFont("medium") font: UM.Theme.getFont("medium")

View File

@ -19,7 +19,6 @@ Item
{ {
id: titleLabel id: titleLabel
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: UM.Theme.getSize("wide_margin").height
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
text: catalog.i18nc("@label", "Help us to improve Ultimaker Cura") text: catalog.i18nc("@label", "Help us to improve Ultimaker Cura")
@ -32,11 +31,15 @@ Item
Item Item
{ {
id: contentsArea id: contentsArea
anchors.top: titleLabel.bottom
anchors.bottom: getStartedButton.top anchors
anchors.left: parent.left {
anchors.right: parent.right top: titleLabel.bottom
anchors.margins: UM.Theme.getSize("wide_margin").width bottom: getStartedButton.top
left: parent.left
right: parent.right
topMargin: UM.Theme.getSize("default_margin").width
}
Column Column
{ {
@ -87,7 +90,6 @@ Item
id: getStartedButton id: getStartedButton
anchors.right: parent.right anchors.right: parent.right
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.margins: UM.Theme.getSize("wide_margin").width
text: catalog.i18nc("@button", "Next") text: catalog.i18nc("@button", "Next")
onClicked: base.showNextPage() onClicked: base.showNextPage()
} }

View File

@ -40,7 +40,6 @@ Item
{ {
id: titleLabel id: titleLabel
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: UM.Theme.getSize("wide_margin").height
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
text: machineActionsModel.currentItem.title == undefined ? "" : machineActionsModel.currentItem.title text: machineActionsModel.currentItem.title == undefined ? "" : machineActionsModel.currentItem.title
@ -51,11 +50,13 @@ Item
Item Item
{ {
anchors.top: titleLabel.bottom anchors
anchors.bottom: nextButton.top {
anchors.margins: UM.Theme.getSize("default_margin").width top: titleLabel.bottom
anchors.left: parent.left bottom: nextButton.top
anchors.right: parent.right left: parent.left
right: parent.right
}
data: machineActionsModel.currentItem.content == undefined ? emptyItem : machineActionsModel.currentItem.content data: machineActionsModel.currentItem.content == undefined ? emptyItem : machineActionsModel.currentItem.content
} }
@ -71,7 +72,6 @@ Item
id: nextButton id: nextButton
anchors.right: parent.right anchors.right: parent.right
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.margins: UM.Theme.getSize("wide_margin").width
text: catalog.i18nc("@button", "Next") text: catalog.i18nc("@button", "Next")
onClicked: machineActionsModel.goToNextAction() onClicked: machineActionsModel.goToNextAction()
} }

View File

@ -18,7 +18,6 @@ Item
{ {
id: titleLabel id: titleLabel
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: UM.Theme.getSize("wide_margin").height
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
text: catalog.i18nc("@label", "User Agreement") text: catalog.i18nc("@label", "User Agreement")
@ -27,21 +26,16 @@ Item
renderType: Text.NativeRendering renderType: Text.NativeRendering
} }
Item // Area for pictures and texts
{
anchors.top: titleLabel.bottom
anchors.bottom: agreeButton.top
anchors.left: parent.left
anchors.right: parent.right
anchors.margins: UM.Theme.getSize("wide_margin").width
Label Label
{ {
id: disclaimerLineLabel id: disclaimerLineLabel
anchors.centerIn: parent anchors
anchors.margins: UM.Theme.getSize("wide_margin").width {
top: titleLabel.bottom
width: (parent.width * 2 / 3) | 0 topMargin: UM.Theme.getSize("wide_margin").height
left: parent.left
right: parent.right
}
text: "<p><b>Disclaimer by Ultimaker</b></p>" text: "<p><b>Disclaimer by Ultimaker</b></p>"
+ "<p>Please read this disclaimer carefully.</p>" + "<p>Please read this disclaimer carefully.</p>"
@ -52,14 +46,12 @@ Item
font: UM.Theme.getFont("default") font: UM.Theme.getFont("default")
renderType: Text.NativeRendering renderType: Text.NativeRendering
} }
}
Cura.PrimaryButton Cura.PrimaryButton
{ {
id: agreeButton id: agreeButton
anchors.right: parent.right anchors.right: parent.right
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.margins: UM.Theme.getSize("wide_margin").width
text: catalog.i18nc("@button", "Agree") text: catalog.i18nc("@button", "Agree")
onClicked: onClicked:
{ {
@ -74,7 +66,6 @@ Item
id: declineButton id: declineButton
anchors.left: parent.left anchors.left: parent.left
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.margins: UM.Theme.getSize("wide_margin").width
text: catalog.i18nc("@button", "Decline and close") text: catalog.i18nc("@button", "Decline and close")
onClicked: onClicked:
{ {

View File

@ -15,8 +15,6 @@ Item
{ {
UM.I18nCatalog { id: catalog; name: "cura" } UM.I18nCatalog { id: catalog; name: "cura" }
anchors.margins: UM.Theme.getSize("wide_margin").width
Column // Arrange the items vertically and put everything in the center Column // Arrange the items vertically and put everything in the center
{ {
anchors.centerIn: parent anchors.centerIn: parent

View File

@ -19,7 +19,6 @@ Item
{ {
id: titleLabel id: titleLabel
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: UM.Theme.getSize("wide_margin").height
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
text: catalog.i18nc("@label", "What's new in Ultimaker Cura") text: catalog.i18nc("@label", "What's new in Ultimaker Cura")
@ -34,8 +33,8 @@ Item
anchors.bottom: getStartedButton.top anchors.bottom: getStartedButton.top
anchors.topMargin: UM.Theme.getSize("wide_margin").height anchors.topMargin: UM.Theme.getSize("wide_margin").height
anchors.bottomMargin: UM.Theme.getSize("wide_margin").height anchors.bottomMargin: UM.Theme.getSize("wide_margin").height
anchors.horizontalCenter: parent.horizontalCenter anchors.left: parent.left
width: (parent.width * 3 / 4) | 0 anchors.right: parent.right
border.color: "#dfdfdf" border.color: "#dfdfdf"
border.width: UM.Theme.getSize("default_lining").width border.width: UM.Theme.getSize("default_lining").width
@ -65,7 +64,6 @@ Item
id: getStartedButton id: getStartedButton
anchors.right: parent.right anchors.right: parent.right
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.margins: UM.Theme.getSize("wide_margin").width
text: catalog.i18nc("@button", "Next") text: catalog.i18nc("@button", "Next")
onClicked: base.showNextPage() onClicked: base.showNextPage()
} }

View File

@ -61,7 +61,8 @@ Item
id: contentLoader id: contentLoader
anchors anchors
{ {
margins: UM.Theme.getSize("default_margin").width margins: UM.Theme.getSize("wide_margin").width
bottomMargin: UM.Theme.getSize("default_margin").width
top: progressBar.bottom top: progressBar.bottom
bottom: parent.bottom bottom: parent.bottom
left: parent.left left: parent.left