ResourceLoaderSection.qml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. // Copyright (C) 2023 The Qt Company Ltd.
  2. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
  3. import QtQuick 2.15
  4. import QtQuick.Layouts 1.15
  5. import HelperWidgets 2.0
  6. import StudioTheme 1.0 as StudioTheme
  7. Section {
  8. caption: qsTr("Resource Loader")
  9. width: parent.width
  10. SectionLayout {
  11. PropertyLabel {
  12. text: qsTr("Geometries")
  13. Layout.alignment: Qt.AlignTop
  14. Layout.topMargin: 5
  15. tooltip: qsTr("A list of custom geometries to be loaded and cached.")
  16. }
  17. SecondColumnLayout {
  18. EditableListView {
  19. backendValue: backendValues.geometries
  20. model: backendValues.geometries.expressionAsList
  21. Layout.fillWidth: true
  22. typeFilter: "QtQuick3D.Geometry"
  23. onAdd: function(value) { backendValues.geometries.idListAdd(value) }
  24. onRemove: function(idx) { backendValues.geometries.idListRemove(idx) }
  25. onReplace: function (idx, value) { backendValues.geometries.idListReplace(idx, value) }
  26. }
  27. ExpandingSpacer {}
  28. }
  29. PropertyLabel {
  30. text: qsTr("Mesh Sources")
  31. Layout.alignment: Qt.AlignTop
  32. Layout.topMargin: 5
  33. tooltip: qsTr("A list of mesh assets to be loaded and cached.")
  34. }
  35. SecondColumnLayout {
  36. ActionIndicator {
  37. icon.color: extFuncLogic.color
  38. icon.text: extFuncLogic.glyph
  39. onClicked: extFuncLogic.show()
  40. forceVisible: extFuncLogic.menuVisible
  41. ExtendedFunctionLogic {
  42. id: extFuncLogic
  43. backendValue: backendValues.meshSources
  44. }
  45. }
  46. // Placeholder until we can do list of value types: QDS-9090
  47. Label {
  48. text: qsTr("Currently only editable in QML.")
  49. Layout.fillWidth: true
  50. Layout.preferredWidth: StudioTheme.Values.singleControlColumnWidth
  51. Layout.minimumWidth: StudioTheme.Values.singleControlColumnWidth
  52. Layout.maximumWidth: StudioTheme.Values.singleControlColumnWidth
  53. }
  54. ExpandingSpacer {}
  55. }
  56. PropertyLabel {
  57. text: qsTr("Textures")
  58. Layout.alignment: Qt.AlignTop
  59. Layout.topMargin: 5
  60. tooltip: qsTr("A list of textures to be loaded and cached.")
  61. }
  62. SecondColumnLayout {
  63. EditableListView {
  64. backendValue: backendValues.textures
  65. model: backendValues.textures.expressionAsList
  66. Layout.fillWidth: true
  67. typeFilter: "QtQuick3D.Texture"
  68. onAdd: function(value) { backendValues.textures.idListAdd(value) }
  69. onRemove: function(idx) { backendValues.textures.idListRemove(idx) }
  70. onReplace: function (idx, value) { backendValues.textures.idListReplace(idx, value) }
  71. }
  72. ExpandingSpacer {}
  73. }
  74. }
  75. }