TestContent.qml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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.Layouts 1.3
  6. import UM 1.3 as UM
  7. import Cura 1.1 as Cura
  8. import "../MachineSettings"
  9. import "../Widgets"
  10. //
  11. // This component contains the content for the "Welcome" page of the welcome on-boarding process.
  12. //
  13. Item
  14. {
  15. id: base
  16. UM.I18nCatalog { id: catalog; name: "cura" }
  17. anchors.fill: parent
  18. anchors.margins: UM.Theme.getSize("default_margin").width
  19. property var extrudersModel: Cura.ExtrudersModel {}
  20. onVisibleChanged:
  21. {
  22. if (visible)
  23. {
  24. tabBar.currentIndex = 0
  25. }
  26. }
  27. Rectangle
  28. {
  29. anchors.fill: parent
  30. border.color: tabBar.visible ? UM.Theme.getColor("lining") : "transparent"
  31. border.width: UM.Theme.getSize("default_lining").width
  32. radius: UM.Theme.getSize("default_radius").width
  33. UM.TabRow
  34. {
  35. id: tabBar
  36. width: parent.width
  37. CuraTabButton
  38. {
  39. text: catalog.i18nc("@title:tab", "Printer")
  40. }
  41. Repeater
  42. {
  43. model: extrudersModel
  44. delegate: CuraTabButton
  45. {
  46. text: model.name
  47. }
  48. }
  49. }
  50. StackLayout
  51. {
  52. id: tabStack
  53. anchors.top: tabBar.bottom
  54. anchors.left: parent.left
  55. anchors.right: parent.right
  56. anchors.bottom: parent.bottom
  57. width: parent.width
  58. currentIndex: tabBar.currentIndex
  59. MachineSettingsPrinterTab
  60. {
  61. id: printerTab
  62. }
  63. Repeater
  64. {
  65. model: extrudersModel
  66. delegate: MachineSettingsExtruderTab
  67. {
  68. id: discoverTab
  69. extruderStackId: model.id
  70. }
  71. }
  72. }
  73. }
  74. }