SettingsSelectionGroup.qml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. // Copyright (c) 2024 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 QtQuick.Window 2.2
  7. import UM 1.5 as UM
  8. import Cura 1.1 as Cura
  9. import ThreeMFWriter 1.0 as ThreeMFWriter
  10. ColumnLayout
  11. {
  12. id: settingsGroup
  13. spacing: UM.Theme.getSize("narrow_margin").width
  14. RowLayout
  15. {
  16. id: settingsGroupTitleRow
  17. spacing: UM.Theme.getSize("default_margin").width
  18. Item
  19. {
  20. id: icon
  21. height: UM.Theme.getSize("medium_button_icon").height
  22. width: height
  23. UM.ColorImage
  24. {
  25. id: settingsMainImage
  26. anchors.fill: parent
  27. source:
  28. {
  29. switch(modelData.category)
  30. {
  31. case ThreeMFWriter.SettingsExportGroup.Global:
  32. return UM.Theme.getIcon("Sliders")
  33. case ThreeMFWriter.SettingsExportGroup.Model:
  34. return UM.Theme.getIcon("View3D")
  35. default:
  36. return ""
  37. }
  38. }
  39. color: UM.Theme.getColor("text")
  40. }
  41. Cura.ExtruderIcon
  42. {
  43. id: settingsExtruderIcon
  44. anchors.fill: parent
  45. visible: modelData.category === ThreeMFWriter.SettingsExportGroup.Extruder
  46. text: (modelData.extruder_index + 1).toString()
  47. font: UM.Theme.getFont("tiny_emphasis")
  48. materialColor: modelData.extruder_color
  49. }
  50. }
  51. UM.Label
  52. {
  53. id: settingsTitle
  54. text: modelData.name + (modelData.category_details ? ' (%1)'.arg(modelData.category_details) : '')
  55. font: UM.Theme.getFont("default_bold")
  56. }
  57. }
  58. ListView
  59. {
  60. id: settingsExportList
  61. Layout.fillWidth: true
  62. Layout.preferredHeight: contentHeight
  63. spacing: 0
  64. model: modelData.settings
  65. visible: modelData.settings.length > 0
  66. delegate: SettingSelection { }
  67. }
  68. UM.Label
  69. {
  70. UM.I18nCatalog { id: catalog; name: "cura" }
  71. text: catalog.i18nc("@label", "No specific value has been set")
  72. visible: modelData.settings.length === 0
  73. }
  74. }