ToolboxInstalledPage.qml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. // Copyright (c) 2018 Ultimaker B.V.
  2. // Toolbox is released under the terms of the LGPLv3 or higher.
  3. import QtQuick 2.7
  4. import QtQuick.Dialogs 1.1
  5. import QtQuick.Window 2.2
  6. import QtQuick.Controls 1.4
  7. import QtQuick.Controls.Styles 1.4
  8. import UM 1.1 as UM
  9. ScrollView
  10. {
  11. id: page
  12. frameVisible: false
  13. width: parent.width
  14. height: parent.height
  15. style: UM.Theme.styles.scrollview
  16. Column
  17. {
  18. spacing: UM.Theme.getSize("default_margin").height
  19. anchors
  20. {
  21. right: parent.right
  22. left: parent.left
  23. leftMargin: UM.Theme.getSize("wide_margin").width
  24. topMargin: UM.Theme.getSize("wide_margin").height
  25. bottomMargin: UM.Theme.getSize("wide_margin").height
  26. top: parent.top
  27. }
  28. height: childrenRect.height + 4 * UM.Theme.getSize("default_margin").height
  29. Label
  30. {
  31. visible: toolbox.pluginsInstalledModel.items.length > 0
  32. width: parent.width
  33. text: catalog.i18nc("@title:tab", "Plugins")
  34. color: UM.Theme.getColor("text_medium")
  35. font: UM.Theme.getFont("medium")
  36. }
  37. Rectangle
  38. {
  39. visible: toolbox.pluginsInstalledModel.items.length > 0
  40. color: "transparent"
  41. width: parent.width
  42. height: childrenRect.height + 1 * UM.Theme.getSize("default_lining").width
  43. border.color: UM.Theme.getColor("lining")
  44. border.width: UM.Theme.getSize("default_lining").width
  45. Column
  46. {
  47. height: childrenRect.height
  48. anchors
  49. {
  50. top: parent.top
  51. right: parent.right
  52. left: parent.left
  53. leftMargin: UM.Theme.getSize("default_margin").width
  54. rightMargin: UM.Theme.getSize("default_margin").width
  55. topMargin: UM.Theme.getSize("default_lining").width
  56. bottomMargin: UM.Theme.getSize("default_lining").width
  57. }
  58. Repeater
  59. {
  60. id: materialList
  61. model: toolbox.pluginsInstalledModel
  62. delegate: ToolboxInstalledTile {}
  63. }
  64. }
  65. }
  66. Label
  67. {
  68. visible: toolbox.materialsInstalledModel.items.length > 0
  69. width: page.width
  70. text: catalog.i18nc("@title:tab", "Materials")
  71. color: UM.Theme.getColor("text_medium")
  72. font: UM.Theme.getFont("medium")
  73. }
  74. Rectangle
  75. {
  76. visible: toolbox.materialsInstalledModel.items.length > 0
  77. color: "transparent"
  78. width: parent.width
  79. height: childrenRect.height + 1 * UM.Theme.getSize("default_lining").width
  80. border.color: UM.Theme.getColor("lining")
  81. border.width: UM.Theme.getSize("default_lining").width
  82. Column
  83. {
  84. height: Math.max( UM.Theme.getSize("wide_margin").height, childrenRect.height)
  85. anchors
  86. {
  87. top: parent.top
  88. right: parent.right
  89. left: parent.left
  90. leftMargin: UM.Theme.getSize("default_margin").width
  91. rightMargin: UM.Theme.getSize("default_margin").width
  92. topMargin: UM.Theme.getSize("default_lining").width
  93. bottomMargin: UM.Theme.getSize("default_lining").width
  94. }
  95. Repeater
  96. {
  97. id: pluginList
  98. model: toolbox.materialsInstalledModel
  99. delegate: ToolboxInstalledTile {}
  100. }
  101. }
  102. }
  103. }
  104. }