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 UM 1.3 as UM
  7. import Cura 1.1 as Cura
  8. //
  9. // This is an Item that tries to mimic a dialog for showing the welcome process.
  10. //
  11. Item
  12. {
  13. UM.I18nCatalog { id: catalog; name: "cura" }
  14. id: dialog
  15. anchors.centerIn: parent
  16. width: UM.Theme.getSize("welcome_wizard_window").width
  17. height: UM.Theme.getSize("welcome_wizard_window").height
  18. property int shadowOffset: 1 * screenScaleFactor
  19. property alias progressBarVisible: wizardPanel.progressBarVisible
  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. // TODO: Maybe re-implement this some other way.
  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. }