WelcomeDialogItem.qml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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: UM.Theme.getSize("welcome_wizard_window").width
  18. height: UM.Theme.getSize("welcome_wizard_window").height
  19. property int shadowOffset: 1 * screenScaleFactor
  20. property alias progressBarVisible: wizardPanel.progressBarVisible
  21. property var model: CuraApplication.getWelcomePagesModel()
  22. onVisibleChanged:
  23. {
  24. if (visible)
  25. {
  26. model.resetState()
  27. }
  28. }
  29. WizardPanel
  30. {
  31. id: wizardPanel
  32. anchors.fill: parent
  33. model: dialog.model
  34. }
  35. // Drop shadow around the panel
  36. DropShadow
  37. {
  38. id: shadow
  39. radius: UM.Theme.getSize("first_run_shadow_radius").width
  40. anchors.fill: wizardPanel
  41. source: wizardPanel
  42. horizontalOffset: shadowOffset
  43. verticalOffset: shadowOffset
  44. color: UM.Theme.getColor("first_run_shadow")
  45. transparentBorder: true
  46. }
  47. // Close this dialog when there's no more page to show
  48. Connections
  49. {
  50. target: model
  51. function onAllFinished() { dialog.visible = false }
  52. }
  53. }