SettingsSelectionGroup.qml 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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.visibleSettings
  65. visible: modelData.visibleSettings.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.visibleSettings.length === 0
  73. }
  74. }