WelcomeDialogItem.qml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 an Item that tries to mimic a dialog for showing the welcome process.
  11. //
  12. Item
  13. {
  14. UM.I18nCatalog { id: catalog; name: "cura" }
  15. id: dialog
  16. anchors.centerIn: parent
  17. width: 580 * screenScaleFactor
  18. height: 600 * screenScaleFactor
  19. property int shadowOffset: 1 * screenScaleFactor
  20. property var model: CuraApplication.getWelcomePagesModel()
  21. onVisibleChanged:
  22. {
  23. if (visible)
  24. {
  25. model.resetState()
  26. }
  27. }
  28. WizardPanel
  29. {
  30. id: wizardPanel
  31. anchors.fill: parent
  32. model: dialog.model
  33. }
  34. // Drop shadow around the panel
  35. DropShadow
  36. {
  37. id: shadow
  38. radius: UM.Theme.getSize("first_run_shadow_radius").width
  39. anchors.fill: wizardPanel
  40. source: wizardPanel
  41. horizontalOffset: shadowOffset
  42. verticalOffset: shadowOffset
  43. color: UM.Theme.getColor("first_run_shadow")
  44. transparentBorder: true
  45. }
  46. // Close this dialog when there's no more page to show
  47. Connections
  48. {
  49. target: model
  50. onAllFinished: dialog.visible = false
  51. }
  52. }