Просмотр исходного кода

Rearrange items in WelcomeContent.qml

Lipu Fei 6 лет назад
Родитель
Сommit
a9431b270f

+ 16 - 22
resources/qml/WelcomePages/UserAgreementContent.qml

@@ -27,8 +27,7 @@ Item
         renderType: Text.NativeRendering
     }
 
-
-    Item
+    Item  // Area for pictures and texts
     {
         anchors.top: titleLabel.bottom
         anchors.bottom: agreeButton.top
@@ -36,28 +35,23 @@ Item
         anchors.right: parent.right
         anchors.margins: UM.Theme.getSize("welcome_pages_default_margin").width
 
-    Label
-    {
-        id: disclaimerLineLabel
-        /*
-        anchors.top: titleLabel.bottom
-        anchors.bottom: agreeButton.top
-        anchors.horizontalCenter: parent.horizontalCenter
-        */
-        anchors.centerIn: parent
-        anchors.margins: UM.Theme.getSize("welcome_pages_default_margin").width
+        Label
+        {
+            id: disclaimerLineLabel
+            anchors.centerIn: parent
+            anchors.margins: UM.Theme.getSize("welcome_pages_default_margin").width
 
-        width: (parent.width * 2 / 3) | 0
+            width: (parent.width * 2 / 3) | 0
 
-        text: "<p><b>Disclaimer by Ultimaker</b></p>"
-            + "<p>Please read this disclaimer carefully.</p>"
-            + "<p>Except when otherwise stated in writing, Ultimaker provides any Ultimaker software or third party software \"As is\" without warranty of any kind. The entire risk as to the quality and perfoemance of Ultimaker software is with you.</p>"
-            + "<p>Unless required by applicable law or agreed to in writing, in no event will Ultimaker be liable to you for damages, including any general, special, incidental, or consequential damages arising out of the use or inability to use any Ultimaker software or third party software.</p>"
-        textFormat: Text.RichText
-        wrapMode: Text.WordWrap
-        font: UM.Theme.getFont("default")
-        renderType: Text.NativeRendering
-    }
+            text: "<p><b>Disclaimer by Ultimaker</b></p>"
+                + "<p>Please read this disclaimer carefully.</p>"
+                + "<p>Except when otherwise stated in writing, Ultimaker provides any Ultimaker software or third party software \"As is\" without warranty of any kind. The entire risk as to the quality and perfoemance of Ultimaker software is with you.</p>"
+                + "<p>Unless required by applicable law or agreed to in writing, in no event will Ultimaker be liable to you for damages, including any general, special, incidental, or consequential damages arising out of the use or inability to use any Ultimaker software or third party software.</p>"
+            textFormat: Text.RichText
+            wrapMode: Text.WordWrap
+            font: UM.Theme.getFont("default")
+            renderType: Text.NativeRendering
+        }
     }
 
     Cura.PrimaryButton

+ 27 - 27
resources/qml/WelcomePages/WelcomeContent.qml

@@ -11,30 +11,28 @@ import Cura 1.1 as Cura
 //
 // This component contains the content for the "Welcome" page of the welcome on-boarding process.
 //
-Column
+Item
 {
     UM.I18nCatalog { id: catalog; name: "cura" }
 
-    spacing: 60
+    anchors.margins: UM.Theme.getSize("welcome_pages_default_margin").width
 
-    // Placeholder
-    Label { text: " " }
-
-    Label
+    Column  // Arrange the items vertically and put everything in the center
     {
-        id: titleLabel
-        anchors.horizontalCenter: parent.horizontalCenter
-        horizontalAlignment: Text.AlignHCenter
-        text: catalog.i18nc("@label", "Welcome to Ultimaker Cura")
-        color: UM.Theme.getColor("primary_button")
-        font: UM.Theme.getFont("large_bold")
-        renderType: Text.NativeRendering
-    }
+        anchors.centerIn: parent
+        width: parent.width
+        spacing: UM.Theme.getSize("welcome_pages_default_margin").height
 
-    Column
-    {
-        anchors.horizontalCenter: parent.horizontalCenter
-        spacing: 40
+        Label
+        {
+            id: titleLabel
+            anchors.horizontalCenter: parent.horizontalCenter
+            horizontalAlignment: Text.AlignHCenter
+            text: catalog.i18nc("@label", "Welcome to Ultimaker Cura")
+            color: UM.Theme.getColor("primary_button")
+            font: UM.Theme.getFont("large_bold")
+            renderType: Text.NativeRendering
+        }
 
         Image
         {
@@ -52,15 +50,17 @@ Column
             font: UM.Theme.getFont("medium")
             renderType: Text.NativeRendering
         }
-    }
 
-    Cura.PrimaryButton
-    {
-        id: getStartedButton
-        anchors.horizontalCenter: parent.horizontalCenter
-        text: catalog.i18nc("@button", "Get started")
-        width: 140
-        fixedWidthMode: true
-        onClicked: base.showNextPage()
+        Cura.PrimaryButton
+        {
+            id: getStartedButton
+            anchors.top: contentArea.bottom
+            anchors.horizontalCenter: parent.horizontalCenter
+            anchors.margins: UM.Theme.getSize("welcome_pages_default_margin").width
+            text: catalog.i18nc("@button", "Get started")
+            width: 140
+            fixedWidthMode: true
+            onClicked: base.showNextPage()
+        }
     }
 }