ToolboxCompatibilityChart.qml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. // Copyright (c) 2018 Ultimaker B.V.
  2. // Toolbox is released under the terms of the LGPLv3 or higher.
  3. import QtQuick 2.2
  4. import QtQuick.Controls 1.4
  5. import QtQuick.Controls.Styles 1.4
  6. import UM 1.1 as UM
  7. Item
  8. {
  9. property var packageData
  10. anchors.topMargin: UM.Theme.getSize("default_margin").height
  11. height: visible ? childrenRect.height : 0
  12. visible: packageData.type == "material" && packageData.has_configs
  13. Label
  14. {
  15. id: heading
  16. anchors.topMargin: UM.Theme.getSize("default_margin").height
  17. width: parent.width
  18. text: catalog.i18nc("@label", "Compatibility")
  19. wrapMode: Text.WordWrap
  20. color: UM.Theme.getColor("text_medium")
  21. font: UM.Theme.getFont("medium")
  22. }
  23. TableView
  24. {
  25. id: table
  26. anchors.top: heading.bottom
  27. anchors.topMargin: UM.Theme.getSize("default_margin").height
  28. width: parent.width
  29. frameVisible: false
  30. selectionMode: 0
  31. model: packageData.supported_configs
  32. headerDelegate: Rectangle
  33. {
  34. color: UM.Theme.getColor("sidebar")
  35. height: UM.Theme.getSize("toolbox_chart_row").height
  36. Label
  37. {
  38. anchors.verticalCenter: parent.verticalCenter
  39. elide: Text.ElideRight
  40. text: styleData.value || ""
  41. color: UM.Theme.getColor("text")
  42. font: UM.Theme.getFont("default_bold")
  43. }
  44. Rectangle
  45. {
  46. anchors.bottom: parent.bottom
  47. height: UM.Theme.getSize("default_lining").height
  48. width: parent.width
  49. color: "black"
  50. }
  51. }
  52. rowDelegate: Item
  53. {
  54. height: UM.Theme.getSize("toolbox_chart_row").height
  55. Label
  56. {
  57. anchors.verticalCenter: parent.verticalCenter
  58. elide: Text.ElideRight
  59. text: styleData.value || ""
  60. color: UM.Theme.getColor("text_medium")
  61. font: UM.Theme.getFont("default")
  62. }
  63. }
  64. itemDelegate: Item
  65. {
  66. height: UM.Theme.getSize("toolbox_chart_row").height
  67. Label
  68. {
  69. anchors.verticalCenter: parent.verticalCenter
  70. elide: Text.ElideRight
  71. text: styleData.value || ""
  72. color: UM.Theme.getColor("text_medium")
  73. font: UM.Theme.getFont("default")
  74. }
  75. }
  76. TableViewColumn
  77. {
  78. role: "machine"
  79. title: "Machine"
  80. width: Math.floor(table.width * 0.25)
  81. }
  82. TableViewColumn
  83. {
  84. role: "print_core"
  85. title: "Print Core"
  86. width: Math.floor(table.width * 0.2)
  87. }
  88. TableViewColumn
  89. {
  90. role: "build_plate"
  91. title: "Build Plate"
  92. width: Math.floor(table.width * 0.225)
  93. }
  94. TableViewColumn
  95. {
  96. role: "support_material"
  97. title: "Support"
  98. width: Math.floor(table.width * 0.225)
  99. }
  100. TableViewColumn
  101. {
  102. role: "quality"
  103. title: "Quality"
  104. width: Math.floor(table.width * 0.1)
  105. }
  106. }
  107. }