CloudContent.qml 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. // Copyright (c) 2019 Ultimaker B.V.
  2. // Cura is released under the terms of the LGPLv3 or higher.
  3. import QtQuick 2.10
  4. import QtQuick.Controls 2.3
  5. import UM 1.3 as UM
  6. import Cura 1.1 as Cura
  7. //
  8. // This component contains the content for the "Ultimaker Cloud" page of the welcome on-boarding process.
  9. //
  10. Item
  11. {
  12. UM.I18nCatalog { id: catalog; name: "cura" }
  13. Label
  14. {
  15. id: titleLabel
  16. anchors.top: parent.top
  17. anchors.topMargin: UM.Theme.getSize("welcome_pages_default_margin").height
  18. anchors.horizontalCenter: parent.horizontalCenter
  19. horizontalAlignment: Text.AlignHCenter
  20. text: catalog.i18nc("@label", "Ultimaker Cloud")
  21. color: UM.Theme.getColor("primary_button")
  22. font: UM.Theme.getFont("large_bold")
  23. renderType: Text.NativeRendering
  24. }
  25. // Area where the cloud contents can be put. Pictures, texts and such.
  26. Item
  27. {
  28. id: cloudContentsArea
  29. anchors.top: titleLabel.bottom
  30. anchors.bottom: finishButton.top
  31. anchors.left: parent.left
  32. anchors.right: parent.right
  33. anchors.margins: UM.Theme.getSize("default_margin").width
  34. // Pictures and texts are arranged using Columns with spacing. The whole picture and text area is centered in
  35. // the cloud contents area.
  36. Column
  37. {
  38. anchors.centerIn: parent
  39. width: childrenRect.width
  40. height: childrenRect.height
  41. spacing: 20 * screenScaleFactor
  42. Image // Cloud image
  43. {
  44. id: cloudImage
  45. anchors.horizontalCenter: parent.horizontalCenter
  46. source: UM.Theme.getImage("first_run_ultimaker_cloud")
  47. }
  48. Label // A title-ish text
  49. {
  50. id: highlightTextLabel
  51. anchors.horizontalCenter: parent.horizontalCenter
  52. horizontalAlignment: Text.AlignHCenter
  53. text: catalog.i18nc("@text", "The next generation 3D printing workflow")
  54. textFormat: Text.RichText
  55. color: UM.Theme.getColor("primary")
  56. font: UM.Theme.getFont("medium")
  57. renderType: Text.NativeRendering
  58. }
  59. Label // A number of text items
  60. {
  61. id: textLabel
  62. anchors.horizontalCenter: parent.horizontalCenter
  63. text:
  64. {
  65. // There are 3 text items, each of which is translated separately as a single piece of text.
  66. var full_text = ""
  67. var t = ""
  68. t = catalog.i18nc("@text", "- Send print jobs to Ultimaker printers outside your local network")
  69. full_text += "<p>" + t + "</p>"
  70. t = catalog.i18nc("@text", "- Store your Ultimaker Cura settings in the cloud for use anywhere")
  71. full_text += "<p>" + t + "</p>"
  72. t = catalog.i18nc("@text", "- Get exclusive access to material profiles from leading brands")
  73. full_text += "<p>" + t + "</p>"
  74. return full_text
  75. }
  76. textFormat: Text.RichText
  77. font: UM.Theme.getFont("medium")
  78. renderType: Text.NativeRendering
  79. }
  80. }
  81. }
  82. // Bottom buttons go here
  83. Cura.PrimaryButton
  84. {
  85. id: finishButton
  86. anchors.right: parent.right
  87. anchors.bottom: parent.bottom
  88. anchors.margins: UM.Theme.getSize("welcome_pages_default_margin").width
  89. text: catalog.i18nc("@button", "Finish")
  90. width: UM.Theme.getSize("welcome_pages_button").width
  91. fixedWidthMode: true
  92. onClicked: base.showNextPage()
  93. }
  94. Cura.SecondaryButton
  95. {
  96. id: createAccountButton
  97. anchors.left: parent.left
  98. anchors.verticalCenter: finishButton.verticalCenter
  99. anchors.margins: UM.Theme.getSize("welcome_pages_default_margin").width
  100. text: catalog.i18nc("@button", "Create an account")
  101. width: UM.Theme.getSize("welcome_pages_button").width
  102. fixedWidthMode: true
  103. onClicked: Qt.openUrlExternally(CuraApplication.ultimakerCloudAccountRootUrl + "/app/create")
  104. }
  105. Label
  106. {
  107. id: signInButton
  108. anchors.left: createAccountButton.right
  109. anchors.verticalCenter: finishButton.verticalCenter
  110. anchors.margins: UM.Theme.getSize("welcome_pages_default_margin").width
  111. text: catalog.i18nc("@button", "Sign in")
  112. color: UM.Theme.getColor("secondary_button_text")
  113. font: UM.Theme.getFont("medium")
  114. renderType: Text.NativeRendering
  115. MouseArea
  116. {
  117. anchors.fill: parent
  118. hoverEnabled: true
  119. onClicked: Cura.API.account.login()
  120. onEntered: parent.font.underline = true
  121. onExited: parent.font.underline = false
  122. }
  123. }
  124. }