WasdControllerSection.qml 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  1. // Copyright (C) 2022 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. Column {
  8. width: parent.width
  9. Section {
  10. width: parent.width
  11. caption: qsTr("WASD Controller")
  12. SectionLayout {
  13. PropertyLabel {
  14. text: qsTr("Controlled Node")
  15. tooltip: qsTr("Sets the 3D node controlled by this controller.")
  16. }
  17. SecondColumnLayout {
  18. ItemFilterComboBox {
  19. typeFilter: "QtQuick3D.Node"
  20. backendValue: backendValues.controlledObject
  21. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  22. + StudioTheme.Values.actionIndicatorWidth
  23. }
  24. ExpandingSpacer {}
  25. }
  26. PropertyLabel {
  27. text: qsTr("Invert X")
  28. tooltip: qsTr("Enables inverting X-axis controls.")
  29. }
  30. SecondColumnLayout {
  31. CheckBox {
  32. text: qsTr("Enabled")
  33. backendValue: backendValues.xInvert
  34. implicitWidth: StudioTheme.Values.twoControlColumnWidth
  35. + StudioTheme.Values.actionIndicatorWidth
  36. }
  37. ExpandingSpacer {}
  38. }
  39. PropertyLabel {
  40. text: qsTr("Invert Y")
  41. tooltip: qsTr("Enables inverting Y-axis controls.")
  42. }
  43. SecondColumnLayout {
  44. CheckBox {
  45. text: qsTr("Enabled")
  46. backendValue: backendValues.yInvert
  47. implicitWidth: StudioTheme.Values.twoControlColumnWidth
  48. + StudioTheme.Values.actionIndicatorWidth
  49. }
  50. ExpandingSpacer {}
  51. }
  52. PropertyLabel {
  53. text: qsTr("Mouse Control")
  54. tooltip: qsTr("Enables using mouse to control the target node.")
  55. }
  56. SecondColumnLayout {
  57. CheckBox {
  58. text: qsTr("Enabled")
  59. backendValue: backendValues.mouseEnabled
  60. implicitWidth: StudioTheme.Values.twoControlColumnWidth
  61. + StudioTheme.Values.actionIndicatorWidth
  62. }
  63. ExpandingSpacer {}
  64. }
  65. PropertyLabel {
  66. text: qsTr("Keyboard Control")
  67. tooltip: qsTr("Enables using keyboard to control the target node.")
  68. }
  69. SecondColumnLayout {
  70. CheckBox {
  71. text: qsTr("Enabled")
  72. backendValue: backendValues.keysEnabled
  73. implicitWidth: StudioTheme.Values.twoControlColumnWidth
  74. + StudioTheme.Values.actionIndicatorWidth
  75. }
  76. ExpandingSpacer {}
  77. }
  78. // TODO: acceptedButtons has no control as there is currently no support for a flags
  79. // type of property control in QDS.
  80. }
  81. }
  82. Section {
  83. width: parent.width
  84. caption: qsTr("Speeds")
  85. SectionLayout {
  86. PropertyLabel {
  87. text: qsTr("Speed")
  88. tooltip: qsTr("Sets the general navigation speed multiplier.")
  89. }
  90. SecondColumnLayout {
  91. SpinBox {
  92. minimumValue: 0
  93. maximumValue: 999999
  94. decimals: 2
  95. stepSize: 0.1
  96. backendValue: backendValues.speed
  97. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  98. + StudioTheme.Values.actionIndicatorWidth
  99. }
  100. ExpandingSpacer {}
  101. }
  102. PropertyLabel {
  103. text: qsTr("Shift Speed")
  104. tooltip: qsTr("Sets the navigation speed multiplier when the Shift key is pressed.")
  105. }
  106. SecondColumnLayout {
  107. SpinBox {
  108. minimumValue: 0
  109. maximumValue: 999999
  110. decimals: 2
  111. stepSize: 0.1
  112. backendValue: backendValues.shiftSpeed
  113. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  114. + StudioTheme.Values.actionIndicatorWidth
  115. }
  116. ExpandingSpacer {}
  117. }
  118. PropertyLabel {
  119. text: qsTr("Forward Speed")
  120. tooltip: qsTr("Sets the navigation speed when forward key is pressed.")
  121. }
  122. SecondColumnLayout {
  123. SpinBox {
  124. minimumValue: 0
  125. maximumValue: 999999
  126. decimals: 2
  127. stepSize: 0.1
  128. backendValue: backendValues.forwardSpeed
  129. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  130. + StudioTheme.Values.actionIndicatorWidth
  131. }
  132. ExpandingSpacer {}
  133. }
  134. PropertyLabel {
  135. text: qsTr("Back Speed")
  136. tooltip: qsTr("Sets the navigation speed when back key is pressed.")
  137. }
  138. SecondColumnLayout {
  139. SpinBox {
  140. minimumValue: 0
  141. maximumValue: 999999
  142. decimals: 2
  143. stepSize: 0.1
  144. backendValue: backendValues.backSpeed
  145. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  146. + StudioTheme.Values.actionIndicatorWidth
  147. }
  148. ExpandingSpacer {}
  149. }
  150. PropertyLabel {
  151. text: qsTr("Right Speed")
  152. tooltip: qsTr("Sets the navigation speed when right key is pressed.")
  153. }
  154. SecondColumnLayout {
  155. SpinBox {
  156. minimumValue: 0
  157. maximumValue: 999999
  158. decimals: 2
  159. stepSize: 0.1
  160. backendValue: backendValues.rightSpeed
  161. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  162. + StudioTheme.Values.actionIndicatorWidth
  163. }
  164. ExpandingSpacer {}
  165. }
  166. PropertyLabel {
  167. text: qsTr("Left Speed")
  168. tooltip: qsTr("Sets the navigation speed when left key is pressed.")
  169. }
  170. SecondColumnLayout {
  171. SpinBox {
  172. minimumValue: 0
  173. maximumValue: 999999
  174. decimals: 2
  175. stepSize: 0.1
  176. backendValue: backendValues.leftSpeed
  177. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  178. + StudioTheme.Values.actionIndicatorWidth
  179. }
  180. ExpandingSpacer {}
  181. }
  182. PropertyLabel {
  183. text: qsTr("Up Speed")
  184. tooltip: qsTr("Sets the navigation speed when up key is pressed.")
  185. }
  186. SecondColumnLayout {
  187. SpinBox {
  188. minimumValue: 0
  189. maximumValue: 999999
  190. decimals: 2
  191. stepSize: 0.1
  192. backendValue: backendValues.upSpeed
  193. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  194. + StudioTheme.Values.actionIndicatorWidth
  195. }
  196. ExpandingSpacer {}
  197. }
  198. PropertyLabel {
  199. text: qsTr("Down Speed")
  200. tooltip: qsTr("Sets the navigation speed when down key is pressed.")
  201. }
  202. SecondColumnLayout {
  203. SpinBox {
  204. minimumValue: 0
  205. maximumValue: 999999
  206. decimals: 2
  207. stepSize: 0.1
  208. backendValue: backendValues.downSpeed
  209. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  210. + StudioTheme.Values.actionIndicatorWidth
  211. }
  212. ExpandingSpacer {}
  213. }
  214. PropertyLabel {
  215. text: qsTr("X Speed")
  216. tooltip: qsTr("Sets the navigation speed when mouse is moved along X-axis.")
  217. }
  218. SecondColumnLayout {
  219. SpinBox {
  220. minimumValue: 0
  221. maximumValue: 999999
  222. decimals: 2
  223. stepSize: 0.1
  224. backendValue: backendValues.xSpeed
  225. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  226. + StudioTheme.Values.actionIndicatorWidth
  227. }
  228. ExpandingSpacer {}
  229. }
  230. PropertyLabel {
  231. text: qsTr("Y Speed")
  232. tooltip: qsTr("Sets the navigation speed when mouse is moved along Y-axis.")
  233. }
  234. SecondColumnLayout {
  235. SpinBox {
  236. minimumValue: 0
  237. maximumValue: 999999
  238. decimals: 2
  239. stepSize: 0.1
  240. backendValue: backendValues.ySpeed
  241. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  242. + StudioTheme.Values.actionIndicatorWidth
  243. }
  244. ExpandingSpacer {}
  245. }
  246. }
  247. }
  248. }