WelcomeDialog.qml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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 QtQuick.Window 2.2
  6. import QtGraphicalEffects 1.0 // For the DropShadow
  7. import UM 1.3 as UM
  8. import Cura 1.1 as Cura
  9. //
  10. // This is a no-frame dialog that shows the welcome process.
  11. //
  12. Window
  13. {
  14. UM.I18nCatalog { id: catalog; name: "cura" }
  15. id: dialog
  16. title: catalog.i18nc("@title", "Welcome to Ultimaker Cura")
  17. modality: Qt.ApplicationModal
  18. flags: Qt.Dialog | Qt.FramelessWindowHint
  19. width: 580 * screenScaleFactor
  20. height: 600 * screenScaleFactor
  21. color: "transparent"
  22. property int shadowOffset: 1 * screenScaleFactor
  23. property var model: CuraApplication.getWelcomePagesModel()
  24. onVisibleChanged:
  25. {
  26. if (visible)
  27. {
  28. model.resetState()
  29. }
  30. }
  31. WizardPanel
  32. {
  33. id: stepPanel
  34. anchors.fill: parent
  35. model: dialog.model
  36. }
  37. // Drop shadow around the panel
  38. DropShadow
  39. {
  40. id: shadow
  41. radius: UM.Theme.getSize("monitor_shadow_radius").width
  42. anchors.fill: stepPanel
  43. source: stepPanel
  44. horizontalOffset: shadowOffset
  45. verticalOffset: shadowOffset
  46. color: UM.Theme.getColor("monitor_shadow")
  47. transparentBorder: true
  48. }
  49. // Close this dialog when there's no more page to show
  50. Connections
  51. {
  52. target: model
  53. onAllFinished: close()
  54. }
  55. }