zui 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (325) hide show
  1. checksums.yaml +7 -0
  2. data/Components/Builtins/Accordion.qml +208 -0
  3. data/Components/Builtins/Action.qml +43 -0
  4. data/Components/Builtins/ActionButton.qml +19 -0
  5. data/Components/Builtins/ActionGroup.qml +81 -0
  6. data/Components/Builtins/AlertDialog.qml +398 -0
  7. data/Components/Builtins/AnchorAnimation.qml +3 -0
  8. data/Components/Builtins/AnchorChanges.qml +11 -0
  9. data/Components/Builtins/AnimatedImage.qml +39 -0
  10. data/Components/Builtins/Animation.qml +3 -0
  11. data/Components/Builtins/AnimationController.qml +11 -0
  12. data/Components/Builtins/ApplicationWindow.qml +103 -0
  13. data/Components/Builtins/AreaChart.qml +70 -0
  14. data/Components/Builtins/AspectRatio.qml +30 -0
  15. data/Components/Builtins/Audio.qml +85 -0
  16. data/Components/Builtins/AudioInput.qml +10 -0
  17. data/Components/Builtins/AudioOutput.qml +10 -0
  18. data/Components/Builtins/Avatar.qml +46 -0
  19. data/Components/Builtins/Badge.qml +38 -0
  20. data/Components/Builtins/Banner.qml +133 -0
  21. data/Components/Builtins/BarChart.qml +67 -0
  22. data/Components/Builtins/BarIconButton.qml +30 -0
  23. data/Components/Builtins/BarIndicator.qml +26 -0
  24. data/Components/Builtins/Behavior.qml +13 -0
  25. data/Components/Builtins/Blur.qml +14 -0
  26. data/Components/Builtins/BorderImage.qml +38 -0
  27. data/Components/Builtins/BorderOverlay.qml +25 -0
  28. data/Components/Builtins/BottomSheet.qml +211 -0
  29. data/Components/Builtins/Breadcrumb.qml +169 -0
  30. data/Components/Builtins/BubbleChart.qml +3 -0
  31. data/Components/Builtins/BusyIndicator.qml +24 -0
  32. data/Components/Builtins/Button.qml +55 -0
  33. data/Components/Builtins/ButtonGroup.qml +18 -0
  34. data/Components/Builtins/Calendar.qml +55 -0
  35. data/Components/Builtins/Camera.qml +18 -0
  36. data/Components/Builtins/CandlestickChart.qml +3 -0
  37. data/Components/Builtins/Canvas.qml +159 -0
  38. data/Components/Builtins/CaptureSession.qml +19 -0
  39. data/Components/Builtins/Card.qml +23 -0
  40. data/Components/Builtins/Carousel.qml +72 -0
  41. data/Components/Builtins/Center.qml +20 -0
  42. data/Components/Builtins/CheckDelegate.qml +132 -0
  43. data/Components/Builtins/Checkbox.qml +62 -0
  44. data/Components/Builtins/Chip.qml +65 -0
  45. data/Components/Builtins/Circle.qml +35 -0
  46. data/Components/Builtins/Clipboard.qml +29 -0
  47. data/Components/Builtins/ColorAnimation.qml +3 -0
  48. data/Components/Builtins/ColorPicker.qml +70 -0
  49. data/Components/Builtins/Colorize.qml +14 -0
  50. data/Components/Builtins/Column.qml +17 -0
  51. data/Components/Builtins/ColumnLayout.qml +13 -0
  52. data/Components/Builtins/ConfirmDialog.qml +20 -0
  53. data/Components/Builtins/ConstrainedBox.qml +28 -0
  54. data/Components/Builtins/Container.qml +30 -0
  55. data/Components/Builtins/ContextMenu.qml +140 -0
  56. data/Components/Builtins/CursorSurface.qml +18 -0
  57. data/Components/Builtins/DataTable.qml +69 -0
  58. data/Components/Builtins/DatePicker.qml +180 -0
  59. data/Components/Builtins/DayOfWeekRow.qml +11 -0
  60. data/Components/Builtins/DelayButton.qml +47 -0
  61. data/Components/Builtins/DelegateModel.qml +10 -0
  62. data/Components/Builtins/DelegateModelGroup.qml +10 -0
  63. data/Components/Builtins/Dial.qml +42 -0
  64. data/Components/Builtins/Dialog.qml +128 -0
  65. data/Components/Builtins/DialogButtonBox.qml +137 -0
  66. data/Components/Builtins/Divider.qml +26 -0
  67. data/Components/Builtins/DonutChart.qml +3 -0
  68. data/Components/Builtins/DoubleSpinBox.qml +58 -0
  69. data/Components/Builtins/DragArea.qml +43 -0
  70. data/Components/Builtins/Drawer.qml +107 -0
  71. data/Components/Builtins/DropArea.qml +19 -0
  72. data/Components/Builtins/DropShadow.qml +16 -0
  73. data/Components/Builtins/Dropdown.qml +19 -0
  74. data/Components/Builtins/ExpansionPanel.qml +157 -0
  75. data/Components/Builtins/FilePicker.qml +140 -0
  76. data/Components/Builtins/FittedBox.qml +40 -0
  77. data/Components/Builtins/Flickable.qml +40 -0
  78. data/Components/Builtins/Flipable.qml +45 -0
  79. data/Components/Builtins/Flow.qml +16 -0
  80. data/Components/Builtins/FocusScope.qml +29 -0
  81. data/Components/Builtins/FolderListModel.qml +9 -0
  82. data/Components/Builtins/FolderPicker.qml +93 -0
  83. data/Components/Builtins/FontLoader.qml +21 -0
  84. data/Components/Builtins/FontPicker.qml +91 -0
  85. data/Components/Builtins/Frame.qml +71 -0
  86. data/Components/Builtins/FrameAnimation.qml +13 -0
  87. data/Components/Builtins/Gauge.qml +3 -0
  88. data/Components/Builtins/Glow.qml +15 -0
  89. data/Components/Builtins/Gradient.qml +93 -0
  90. data/Components/Builtins/Grid.qml +16 -0
  91. data/Components/Builtins/GridLayout.qml +16 -0
  92. data/Components/Builtins/GridView.qml +226 -0
  93. data/Components/Builtins/GroupBox.qml +95 -0
  94. data/Components/Builtins/Heatmap.qml +3 -0
  95. data/Components/Builtins/Histogram.qml +3 -0
  96. data/Components/Builtins/HorizontalHeader.qml +23 -0
  97. data/Components/Builtins/HorizontalHeaderDelegate.qml +39 -0
  98. data/Components/Builtins/HoverArea.qml +19 -0
  99. data/Components/Builtins/Icon.qml +16 -0
  100. data/Components/Builtins/Image.qml +110 -0
  101. data/Components/Builtins/ImageCapture.qml +14 -0
  102. data/Components/Builtins/ItemDelegate.qml +152 -0
  103. data/Components/Builtins/KeyCatcher.qml +25 -0
  104. data/Components/Builtins/Label.qml +43 -0
  105. data/Components/Builtins/LayoutItemProxy.qml +51 -0
  106. data/Components/Builtins/Legend.qml +86 -0
  107. data/Components/Builtins/Line.qml +28 -0
  108. data/Components/Builtins/LineChart.qml +87 -0
  109. data/Components/Builtins/ListModel.qml +8 -0
  110. data/Components/Builtins/ListView.qml +65 -0
  111. data/Components/Builtins/Loader.qml +33 -0
  112. data/Components/Builtins/Markdown.qml +23 -0
  113. data/Components/Builtins/MediaDevices.qml +10 -0
  114. data/Components/Builtins/MediaPlayer.qml +27 -0
  115. data/Components/Builtins/MediaRecorder.qml +16 -0
  116. data/Components/Builtins/Menu.qml +119 -0
  117. data/Components/Builtins/MenuBar.qml +128 -0
  118. data/Components/Builtins/MenuItem.qml +77 -0
  119. data/Components/Builtins/MenuSeparator.qml +30 -0
  120. data/Components/Builtins/MessageDialog.qml +104 -0
  121. data/Components/Builtins/ModalSheet.qml +222 -0
  122. data/Components/Builtins/ModelView3d.qml +50 -0
  123. data/Components/Builtins/MonthGrid.qml +23 -0
  124. data/Components/Builtins/MultiEffect.qml +48 -0
  125. data/Components/Builtins/MultiSelect.qml +23 -0
  126. data/Components/Builtins/NavigationRail.qml +154 -0
  127. data/Components/Builtins/NumberAnimation.qml +3 -0
  128. data/Components/Builtins/NumberField.qml +18 -0
  129. data/Components/Builtins/OpacityAnimator.qml +3 -0
  130. data/Components/Builtins/OpacityMask.qml +21 -0
  131. data/Components/Builtins/OpticalGlyph.qml +16 -0
  132. data/Components/Builtins/Page.qml +111 -0
  133. data/Components/Builtins/PageIndicator.qml +63 -0
  134. data/Components/Builtins/Pagination.qml +158 -0
  135. data/Components/Builtins/Pane.qml +72 -0
  136. data/Components/Builtins/PanelHero.qml +15 -0
  137. data/Components/Builtins/ParallelAnimation.qml +3 -0
  138. data/Components/Builtins/ParentAnimation.qml +3 -0
  139. data/Components/Builtins/ParentChange.qml +10 -0
  140. data/Components/Builtins/ParticleSystem.qml +81 -0
  141. data/Components/Builtins/PasswordField.qml +58 -0
  142. data/Components/Builtins/Path.qml +35 -0
  143. data/Components/Builtins/PathAnimation.qml +3 -0
  144. data/Components/Builtins/PauseAnimation.qml +3 -0
  145. data/Components/Builtins/PieChart.qml +3 -0
  146. data/Components/Builtins/PinchArea.qml +23 -0
  147. data/Components/Builtins/Popup.qml +130 -0
  148. data/Components/Builtins/Progress.qml +15 -0
  149. data/Components/Builtins/ProgressRing.qml +120 -0
  150. data/Components/Builtins/PropertyAction.qml +11 -0
  151. data/Components/Builtins/PropertyAnimation.qml +3 -0
  152. data/Components/Builtins/PropertyChanges.qml +10 -0
  153. data/Components/Builtins/RadarChart.qml +3 -0
  154. data/Components/Builtins/RadialGauge.qml +3 -0
  155. data/Components/Builtins/RadioButton.qml +46 -0
  156. data/Components/Builtins/RadioDelegate.qml +115 -0
  157. data/Components/Builtins/RadioGroup.qml +58 -0
  158. data/Components/Builtins/RangeSlider.qml +39 -0
  159. data/Components/Builtins/Rectangle.qml +23 -0
  160. data/Components/Builtins/RectangularShadow.qml +23 -0
  161. data/Components/Builtins/ReorderableList.qml +204 -0
  162. data/Components/Builtins/RichText.qml +23 -0
  163. data/Components/Builtins/RotationAnimation.qml +3 -0
  164. data/Components/Builtins/RotationAnimator.qml +3 -0
  165. data/Components/Builtins/RoundButton.qml +42 -0
  166. data/Components/Builtins/Row.qml +17 -0
  167. data/Components/Builtins/RowLayout.qml +13 -0
  168. data/Components/Builtins/ScaleAnimator.qml +3 -0
  169. data/Components/Builtins/ScatterChart.qml +3 -0
  170. data/Components/Builtins/ScreenCapture.qml +78 -0
  171. data/Components/Builtins/ScriptAction.qml +15 -0
  172. data/Components/Builtins/Scroll.qml +18 -0
  173. data/Components/Builtins/ScrollBar.qml +18 -0
  174. data/Components/Builtins/ScrollIndicator.qml +15 -0
  175. data/Components/Builtins/SearchField.qml +178 -0
  176. data/Components/Builtins/SearchableDropdown.qml +21 -0
  177. data/Components/Builtins/SectionHeader.qml +14 -0
  178. data/Components/Builtins/SelectableText.qml +33 -0
  179. data/Components/Builtins/SelectionRectangle.qml +17 -0
  180. data/Components/Builtins/Separator.qml +13 -0
  181. data/Components/Builtins/SequentialAnimation.qml +3 -0
  182. data/Components/Builtins/Settings.qml +10 -0
  183. data/Components/Builtins/ShaderEffect.qml +115 -0
  184. data/Components/Builtins/ShaderEffectSource.qml +61 -0
  185. data/Components/Builtins/Shaders/grayscale.frag +14 -0
  186. data/Components/Builtins/Shaders/grayscale.frag.qsb +0 -0
  187. data/Components/Builtins/Shaders/passthrough.frag +11 -0
  188. data/Components/Builtins/Shaders/passthrough.frag.qsb +0 -0
  189. data/Components/Builtins/Shaders/pixelate.frag +16 -0
  190. data/Components/Builtins/Shaders/pixelate.frag.qsb +0 -0
  191. data/Components/Builtins/Shaders/vignette.frag +18 -0
  192. data/Components/Builtins/Shaders/vignette.frag.qsb +0 -0
  193. data/Components/Builtins/Shaders/wave.frag +18 -0
  194. data/Components/Builtins/Shaders/wave.frag.qsb +0 -0
  195. data/Components/Builtins/Shape.qml +53 -0
  196. data/Components/Builtins/Skeleton.qml +78 -0
  197. data/Components/Builtins/Slider.qml +21 -0
  198. data/Components/Builtins/SmoothedAnimation.qml +3 -0
  199. data/Components/Builtins/Snackbar.qml +181 -0
  200. data/Components/Builtins/SortFilterProxyModel.qml +16 -0
  201. data/Components/Builtins/SoundEffect.qml +10 -0
  202. data/Components/Builtins/Spacer.qml +13 -0
  203. data/Components/Builtins/Sparkline.qml +3 -0
  204. data/Components/Builtins/SpinBox.qml +44 -0
  205. data/Components/Builtins/SplitView.qml +31 -0
  206. data/Components/Builtins/SpringAnimation.qml +3 -0
  207. data/Components/Builtins/Stack.qml +14 -0
  208. data/Components/Builtins/StackLayout.qml +19 -0
  209. data/Components/Builtins/StackView.qml +122 -0
  210. data/Components/Builtins/StackedBarChart.qml +3 -0
  211. data/Components/Builtins/StandardPaths.qml +9 -0
  212. data/Components/Builtins/State.qml +13 -0
  213. data/Components/Builtins/StateGroup.qml +11 -0
  214. data/Components/Builtins/Support/AnimationDriver.qml +79 -0
  215. data/Components/Builtins/Support/AnimationGroupDriver.qml +32 -0
  216. data/Components/Builtins/Support/ChartCanvas.qml +629 -0
  217. data/Components/Builtins/Support/ModelView3dScene.qml +292 -0
  218. data/Components/Builtins/Support/OptionalModuleState.js +5 -0
  219. data/Components/Builtins/SwipeDelegate.qml +231 -0
  220. data/Components/Builtins/SwipeView.qml +69 -0
  221. data/Components/Builtins/SwitchDelegate.qml +140 -0
  222. data/Components/Builtins/TabBar.qml +117 -0
  223. data/Components/Builtins/TabButton.qml +105 -0
  224. data/Components/Builtins/TableView.qml +388 -0
  225. data/Components/Builtins/TableViewDelegate.qml +17 -0
  226. data/Components/Builtins/Tabs.qml +138 -0
  227. data/Components/Builtins/Text.qml +24 -0
  228. data/Components/Builtins/TextArea.qml +59 -0
  229. data/Components/Builtins/TextField.qml +21 -0
  230. data/Components/Builtins/TextMetrics.qml +39 -0
  231. data/Components/Builtins/TimePicker.qml +213 -0
  232. data/Components/Builtins/Timer.qml +13 -0
  233. data/Components/Builtins/Toast.qml +213 -0
  234. data/Components/Builtins/Toggle.qml +19 -0
  235. data/Components/Builtins/ToggleSwitch.qml +22 -0
  236. data/Components/Builtins/ToolBar.qml +61 -0
  237. data/Components/Builtins/ToolButton.qml +41 -0
  238. data/Components/Builtins/ToolSeparator.qml +36 -0
  239. data/Components/Builtins/Tooltip.qml +20 -0
  240. data/Components/Builtins/Transition.qml +3 -0
  241. data/Components/Builtins/TreeView.qml +423 -0
  242. data/Components/Builtins/TreeViewDelegate.qml +46 -0
  243. data/Components/Builtins/Tumbler.qml +18 -0
  244. data/Components/Builtins/UniformAnimator.qml +3 -0
  245. data/Components/Builtins/VectorAnimation.qml +3 -0
  246. data/Components/Builtins/VectorImage.qml +62 -0
  247. data/Components/Builtins/VerticalHeader.qml +21 -0
  248. data/Components/Builtins/VerticalHeaderDelegate.qml +35 -0
  249. data/Components/Builtins/Video.qml +54 -0
  250. data/Components/Builtins/VideoOutput.qml +54 -0
  251. data/Components/Builtins/WebView.qml +57 -0
  252. data/Components/Builtins/WeekNumberColumn.qml +13 -0
  253. data/Components/Builtins/WidgetButton.qml +26 -0
  254. data/Components/Builtins/Window.qml +90 -0
  255. data/Components/Builtins/WindowCapture.qml +11 -0
  256. data/Components/Builtins/Wrap.qml +18 -0
  257. data/Components/Builtins/XAnimator.qml +3 -0
  258. data/Components/Builtins/YAnimator.qml +3 -0
  259. data/Components/README.md +45 -0
  260. data/ControlNode.qml +1369 -0
  261. data/Controls/BarIconButton.qml +27 -0
  262. data/Controls/BarIndicator.qml +22 -0
  263. data/Controls/BorderOverlay.qml +10 -0
  264. data/Controls/BorderSurface.qml +10 -0
  265. data/Controls/Button.qml +78 -0
  266. data/Controls/ButtonGroup.qml +19 -0
  267. data/Controls/ConfirmDialog.qml +37 -0
  268. data/Controls/CursorSurface.qml +29 -0
  269. data/Controls/Dropdown.qml +59 -0
  270. data/Controls/MultiSelect.qml +32 -0
  271. data/Controls/NumberField.qml +24 -0
  272. data/Controls/OpticalGlyph.qml +14 -0
  273. data/Controls/PanelActionButton.qml +10 -0
  274. data/Controls/PanelHero.qml +18 -0
  275. data/Controls/PanelKeyCatcher.qml +25 -0
  276. data/Controls/PanelSectionHeader.qml +11 -0
  277. data/Controls/PanelSeparator.qml +10 -0
  278. data/Controls/PanelSlider.qml +36 -0
  279. data/Controls/PanelToolTip.qml +13 -0
  280. data/Controls/SearchableDropdown.qml +11 -0
  281. data/Controls/TextField.qml +25 -0
  282. data/Controls/Toggle.qml +22 -0
  283. data/Controls/ToggleSwitch.qml +26 -0
  284. data/Controls/WidgetButton.qml +35 -0
  285. data/Controls/qmldir +25 -0
  286. data/Desktop.qml +76 -0
  287. data/LICENSE +22 -0
  288. data/README.md +112 -0
  289. data/Service.qml +430 -0
  290. data/Theme/Border.qml +22 -0
  291. data/Theme/Color.qml +22 -0
  292. data/Theme/Style.qml +47 -0
  293. data/Theme/Util.qml +6 -0
  294. data/Theme/qmldir +5 -0
  295. data/bin/zui +7 -0
  296. data/lib/zui/animation.rb +24 -0
  297. data/lib/zui/application.rb +327 -0
  298. data/lib/zui/builder.rb +725 -0
  299. data/lib/zui/cli.rb +91 -0
  300. data/lib/zui/command.rb +101 -0
  301. data/lib/zui/component_registry.rb +91 -0
  302. data/lib/zui/components.rb +262 -0
  303. data/lib/zui/distribution.rb +200 -0
  304. data/lib/zui/generator.rb +84 -0
  305. data/lib/zui/host.rb +123 -0
  306. data/lib/zui/node.rb +30 -0
  307. data/lib/zui/platform.rb +40 -0
  308. data/lib/zui/protocol.rb +29 -0
  309. data/lib/zui/runner.rb +37 -0
  310. data/lib/zui/runtime.rb +23 -0
  311. data/lib/zui/scheduler.rb +136 -0
  312. data/lib/zui/source_bundle.rb +63 -0
  313. data/lib/zui/state_store.rb +100 -0
  314. data/lib/zui/value.rb +44 -0
  315. data/lib/zui.rb +33 -0
  316. data/native/CMakeLists.txt +45 -0
  317. data/native/ZuiClipboard.cpp +16 -0
  318. data/native/ZuiClipboard.h +16 -0
  319. data/native/ZuiProcess.cpp +84 -0
  320. data/native/ZuiProcess.h +34 -0
  321. data/native/main.cpp +64 -0
  322. data/vendor/host/linux-x86_64/PROVENANCE.md +15 -0
  323. data/vendor/host/linux-x86_64/zui-host +0 -0
  324. data/vendor/host/linux-x86_64/zui-host.sha256 +1 -0
  325. metadata +365 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 3ae2e4258c9dcaea2c3717920199c8cca6a5105b891f2fd3940b2b4843210999
4
+ data.tar.gz: b8185c66c6bef8b2a447819f6a474521bf7773246bdd50e7dcc2e5618efd8837
5
+ SHA512:
6
+ metadata.gz: c17ff8fbdd6c51cc13f924d123ec8a72f789a096dbf965e3cff6b30d7423c29f23090e962422009091e46e4f8889a358043cf3bbe4d07267d103b228d8a2baa7
7
+ data.tar.gz: c966b6a472b0b43e3e7eed8f607b17b271e3fda93cb7e23a619a5367a1c320b6e708b7a9f53e26b179e25c69e8e29f6091f41fa3c9e31f2079cd3cfffd51b41e
@@ -0,0 +1,208 @@
1
+ import QtQuick
2
+ import QtQuick.Controls as QQC
3
+ import "../../Theme"
4
+
5
+ QQC.Control {
6
+ id: accordionRoot
7
+
8
+ required property var renderer
9
+ readonly property int sectionCount: renderer.node && Array.isArray(renderer.node.children)
10
+ ? renderer.node.children.length : 0
11
+ readonly property string requestedSignature: JSON.stringify(renderer.prop("expanded_indices", []))
12
+ property var expandedIndices: []
13
+ property bool synchronizing: false
14
+
15
+ function titleAt(index) {
16
+ var titles = renderer.prop("titles", [])
17
+ if (Array.isArray(titles) && index < titles.length) return String(titles[index])
18
+ var child = renderer.node.children[index]
19
+ return child && child.props && child.props.title !== undefined
20
+ ? String(child.props.title) : "Section " + String(index + 1)
21
+ }
22
+
23
+ function subtitleAt(index) {
24
+ var subtitles = renderer.prop("subtitles", [])
25
+ return Array.isArray(subtitles) && index < subtitles.length ? String(subtitles[index]) : ""
26
+ }
27
+
28
+ function normalizedIndices(values) {
29
+ var source = Array.isArray(values) ? values : (values === null || values === undefined ? [] : [values])
30
+ var result = []
31
+ for (var index = 0; index < source.length; index++) {
32
+ var value = Math.floor(Number(source[index]))
33
+ if (value >= 0 && value < sectionCount && result.indexOf(value) < 0) result.push(value)
34
+ }
35
+ result.sort(function(left, right) { return left - right })
36
+ if (renderer.prop("multiple", false) !== true && result.length > 1) result = [result[0]]
37
+ return result
38
+ }
39
+
40
+ function syncExpanded() {
41
+ synchronizing = true
42
+ expandedIndices = normalizedIndices(renderer.prop("expanded_indices", []))
43
+ synchronizing = false
44
+ }
45
+
46
+ function isExpanded(index) {
47
+ return expandedIndices.indexOf(index) >= 0
48
+ }
49
+
50
+ function activate(index) {
51
+ if (!enabled) return
52
+ var opening = !isExpanded(index)
53
+ var next = expandedIndices.slice(0)
54
+ if (opening) {
55
+ if (renderer.prop("multiple", false) === true) next.push(index)
56
+ else next = [index]
57
+ } else {
58
+ next.splice(next.indexOf(index), 1)
59
+ }
60
+ next.sort(function(left, right) { return left - right })
61
+ expandedIndices = next
62
+ var payload = { index: index, expanded: opening, values: next }
63
+ if (renderer.subscribed("toggle"))
64
+ renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "toggle", payload)
65
+ if (renderer.subscribed("change"))
66
+ renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "change", payload)
67
+ var direction = opening ? "expand" : "collapse"
68
+ if (renderer.subscribed(direction))
69
+ renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, direction, payload)
70
+ }
71
+
72
+ implicitWidth: Number(renderer.prop("width", 600))
73
+ implicitHeight: renderer.prop("height", null) === null
74
+ ? sections.implicitHeight : Number(renderer.prop("height", sections.implicitHeight))
75
+ enabled: renderer.prop("enabled", true) !== false
76
+ visible: renderer.prop("visible", true) !== false
77
+
78
+ background: Rectangle {
79
+ color: renderer.prop("background", "transparent")
80
+ radius: Number(renderer.prop("radius", 0))
81
+ border.width: String(renderer.prop("border_color", "")).length > 0 ? Style.normalBorderWidth : 0
82
+ border.color: renderer.prop("border_color", "transparent")
83
+ }
84
+
85
+ contentItem: Column {
86
+ id: sections
87
+ spacing: Number(renderer.prop("spacing", Style.spacing.sm))
88
+
89
+ Repeater {
90
+ model: accordionRoot.sectionCount
91
+ Item {
92
+ id: sectionRoot
93
+ required property int index
94
+ readonly property bool expanded: accordionRoot.isExpanded(index)
95
+ readonly property real headerHeight: Number(renderer.prop("header_height", 60))
96
+ width: sections.width
97
+ height: headerHeight + (expanded
98
+ ? bodyLoader.implicitHeight + Number(renderer.prop("padding", Style.spacing.lg)) * 2 : 0)
99
+ clip: true
100
+
101
+ Behavior on height {
102
+ enabled: renderer.prop("animated", true) !== false
103
+ NumberAnimation {
104
+ duration: Number(renderer.prop("duration", 200))
105
+ easing.type: renderer.easingType(renderer.prop("easing", "in_out_quad"))
106
+ }
107
+ }
108
+
109
+ Rectangle {
110
+ anchors.fill: parent
111
+ color: sectionRoot.expanded
112
+ ? renderer.prop("expanded_background", renderer.prop("background", Color.background))
113
+ : renderer.prop("background", Color.background)
114
+ radius: Number(renderer.prop("radius", Style.cornerRadius))
115
+ border.width: String(renderer.prop("border_color", "")).length > 0 ? Style.normalBorderWidth : 0
116
+ border.color: renderer.prop("border_color", "transparent")
117
+ }
118
+
119
+ QQC.ToolButton {
120
+ id: sectionHeader
121
+ anchors.left: parent.left
122
+ anchors.right: parent.right
123
+ anchors.top: parent.top
124
+ height: sectionRoot.headerHeight
125
+ enabled: accordionRoot.enabled
126
+ onClicked: accordionRoot.activate(sectionRoot.index)
127
+
128
+ contentItem: Item {
129
+ Text {
130
+ id: sectionTitle
131
+ anchors.left: parent.left
132
+ anchors.right: sectionIndicator.left
133
+ anchors.top: accordionRoot.subtitleAt(sectionRoot.index).length > 0 ? parent.top : undefined
134
+ anchors.verticalCenter: accordionRoot.subtitleAt(sectionRoot.index).length === 0
135
+ ? parent.verticalCenter : undefined
136
+ text: accordionRoot.titleAt(sectionRoot.index)
137
+ color: renderer.prop("foreground", renderer.foreground)
138
+ font.family: String(renderer.prop("font_family", renderer.fontFamily))
139
+ font.pixelSize: Number(renderer.prop("title_size",
140
+ renderer.prop("font_size", Style.font.body)))
141
+ font.bold: true
142
+ elide: Text.ElideRight
143
+ }
144
+ Text {
145
+ anchors.left: parent.left
146
+ anchors.right: sectionIndicator.left
147
+ anchors.top: sectionTitle.bottom
148
+ text: accordionRoot.subtitleAt(sectionRoot.index)
149
+ visible: text.length > 0
150
+ color: renderer.prop("muted", Color.muted)
151
+ font.family: String(renderer.prop("font_family", renderer.fontFamily))
152
+ font.pixelSize: Number(renderer.prop("subtitle_size", Style.font.caption))
153
+ elide: Text.ElideRight
154
+ }
155
+ Text {
156
+ id: sectionIndicator
157
+ anchors.right: parent.right
158
+ anchors.verticalCenter: parent.verticalCenter
159
+ text: renderer.iconGlyph("chevron_down")
160
+ color: renderer.prop("accent", Color.accent)
161
+ font.family: renderer.fontFamily
162
+ font.pixelSize: Number(renderer.prop("indicator_size", Style.font.icon))
163
+ rotation: sectionRoot.expanded ? 180 : 0
164
+ Behavior on rotation {
165
+ enabled: renderer.prop("animated", true) !== false
166
+ NumberAnimation { duration: Number(renderer.prop("duration", 200)) }
167
+ }
168
+ }
169
+ }
170
+ background: Rectangle {
171
+ color: renderer.prop("header_background", "transparent")
172
+ radius: Number(renderer.prop("radius", Style.cornerRadius))
173
+ }
174
+ }
175
+
176
+ Loader {
177
+ id: bodyLoader
178
+ anchors.left: parent.left
179
+ anchors.right: parent.right
180
+ anchors.top: sectionHeader.bottom
181
+ anchors.margins: Number(renderer.prop("padding", Style.spacing.lg))
182
+ visible: sectionRoot.expanded
183
+ opacity: sectionRoot.expanded ? 1 : 0
184
+ source: Qt.resolvedUrl("../../ControlNode.qml")
185
+ onLoaded: {
186
+ item.bridge = renderer.bridge
187
+ item.surfaceName = renderer.surfaceName
188
+ item.controlId = String(renderer.node.children[sectionRoot.index].id)
189
+ item.foreground = renderer.foreground
190
+ item.fontFamily = renderer.fontFamily
191
+ }
192
+ Behavior on opacity {
193
+ enabled: renderer.prop("animated", true) !== false
194
+ NumberAnimation { duration: Number(renderer.prop("duration", 120)) }
195
+ }
196
+ }
197
+ }
198
+ }
199
+ }
200
+
201
+ onRequestedSignatureChanged: syncExpanded()
202
+ onSectionCountChanged: syncExpanded()
203
+ Component.onCompleted: syncExpanded()
204
+ onVisibleChanged: renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId,
205
+ visible ? "show" : "hide", {})
206
+ onActiveFocusChanged: renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId,
207
+ activeFocus ? "focus" : "blur", {})
208
+ }
@@ -0,0 +1,43 @@
1
+ import QtQuick
2
+ import QtQuick.Controls as QQC
3
+
4
+ Item {
5
+ id: actionRoot
6
+
7
+ required property var renderer
8
+ property alias nativeAction: nativeAction
9
+ readonly property string actionId: renderer.controlId
10
+
11
+ function payload() {
12
+ return {
13
+ value: nativeAction.checked,
14
+ checked: nativeAction.checked,
15
+ text: nativeAction.text
16
+ }
17
+ }
18
+
19
+ implicitWidth: 0
20
+ implicitHeight: 0
21
+ visible: renderer.prop("visible", true) !== false
22
+
23
+ QQC.Action {
24
+ id: nativeAction
25
+ text: String(renderer.prop("text", ""))
26
+ enabled: renderer.prop("enabled", true) !== false && actionRoot.visible
27
+ checkable: renderer.prop("checkable", false) === true
28
+ checked: renderer.prop("checked", false) === true
29
+ shortcut: renderer.prop("shortcut", "")
30
+ icon.name: String(renderer.prop("icon", ""))
31
+ icon.source: String(renderer.prop("icon_source", ""))
32
+ icon.color: renderer.prop("icon_color", "transparent")
33
+ icon.width: Number(renderer.prop("icon_width", 0))
34
+ icon.height: Number(renderer.prop("icon_height", 0))
35
+
36
+ onTriggered: renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId,
37
+ "trigger", actionRoot.payload())
38
+ onToggled: renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId,
39
+ "toggle", actionRoot.payload())
40
+ onCheckedChanged: renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId,
41
+ "change", actionRoot.payload())
42
+ }
43
+ }
@@ -0,0 +1,19 @@
1
+ import QtQuick
2
+ import QtQuick.Controls as QQC
3
+ import QtQuick.Layouts
4
+ import QtMultimedia
5
+ import QtQuick.VectorImage
6
+ import "../../Theme"
7
+ import "../../Controls" as ZuiControls
8
+
9
+ ZuiControls.PanelActionButton {
10
+ required property var renderer
11
+ iconText: renderer.iconGlyph(renderer.prop("icon", "")); tooltipText: renderer.escapeAutoText(renderer.prop("tooltip", ""))
12
+ bordered: renderer.prop("bordered", false) === true; focusable: renderer.prop("focusable", false) === true
13
+ hasCursor: renderer.prop("cursor", false) === true
14
+ size: Number(renderer.prop("size", 28)); foreground: renderer.prop("foreground", renderer.foreground)
15
+ hoverColor: renderer.prop("hover_color", foreground); fontFamily: String(renderer.prop("font_family", renderer.fontFamily))
16
+ fontSize: Number(renderer.prop("font_size", Style.font.icon))
17
+ onClicked: renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "click", {})
18
+ onHovered: function(value) { renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "hover", { value: value }) }
19
+ }
@@ -0,0 +1,81 @@
1
+ import QtQuick
2
+ import QtQuick.Controls as QQC
3
+
4
+ Item {
5
+ id: groupRoot
6
+
7
+ required property var renderer
8
+ property alias nativeActionGroup: nativeGroup
9
+ property var requestedIds: renderer.prop("action_ids", [])
10
+ property var attached: []
11
+
12
+ function attachedIds() {
13
+ var result = []
14
+ for (var index = 0; index < attached.length; index++) result.push(attached[index].id)
15
+ return result
16
+ }
17
+
18
+ function actionPayload(action) {
19
+ if (!action) return { value: "", action: "", checked: false }
20
+ for (var index = 0; index < attached.length; index++) {
21
+ if (attached[index].action === action) {
22
+ return { value: attached[index].id, action: attached[index].id, checked: action.checked }
23
+ }
24
+ }
25
+ return { value: "", action: "", checked: action.checked }
26
+ }
27
+
28
+ function syncActions() {
29
+ for (var index = 0; index < attached.length; index++) nativeGroup.removeAction(attached[index].action)
30
+
31
+ var next = []
32
+ var values = Array.isArray(requestedIds) ? requestedIds : []
33
+ for (index = 0; index < values.length; index++) {
34
+ var actionId = String(values[index])
35
+ var rendered = renderer.findRenderedItem(actionId)
36
+ if (rendered && rendered.nativeAction) {
37
+ nativeGroup.addAction(rendered.nativeAction)
38
+ next.push({ id: actionId, action: rendered.nativeAction })
39
+ }
40
+ }
41
+ attached = next
42
+ syncCheckedAction()
43
+ renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId,
44
+ "actions_change", { values: attachedIds() })
45
+ }
46
+
47
+ function syncCheckedAction() {
48
+ var requested = String(renderer.prop("checked_action", "") || "")
49
+ if (!requested.length) return
50
+ for (var index = 0; index < attached.length; index++) {
51
+ if (attached[index].id === requested) {
52
+ nativeGroup.checkedAction = attached[index].action
53
+ return
54
+ }
55
+ }
56
+ }
57
+
58
+ implicitWidth: 0
59
+ implicitHeight: 0
60
+ visible: renderer.prop("visible", true) !== false
61
+ onRequestedIdsChanged: Qt.callLater(syncActions)
62
+ Component.onCompleted: Qt.callLater(syncActions)
63
+ Component.onDestruction: {
64
+ for (var index = 0; index < attached.length; index++) nativeGroup.removeAction(attached[index].action)
65
+ }
66
+
67
+ QQC.ActionGroup {
68
+ id: nativeGroup
69
+ exclusive: renderer.prop("exclusive", true) !== false
70
+ enabled: renderer.prop("enabled", true) !== false && groupRoot.visible
71
+
72
+ onTriggered: function(action) {
73
+ renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId,
74
+ "trigger", groupRoot.actionPayload(action))
75
+ }
76
+ onCheckedActionChanged: {
77
+ renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId,
78
+ "change", groupRoot.actionPayload(checkedAction))
79
+ }
80
+ }
81
+ }