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.
- checksums.yaml +7 -0
- data/Components/Builtins/Accordion.qml +208 -0
- data/Components/Builtins/Action.qml +43 -0
- data/Components/Builtins/ActionButton.qml +19 -0
- data/Components/Builtins/ActionGroup.qml +81 -0
- data/Components/Builtins/AlertDialog.qml +398 -0
- data/Components/Builtins/AnchorAnimation.qml +3 -0
- data/Components/Builtins/AnchorChanges.qml +11 -0
- data/Components/Builtins/AnimatedImage.qml +39 -0
- data/Components/Builtins/Animation.qml +3 -0
- data/Components/Builtins/AnimationController.qml +11 -0
- data/Components/Builtins/ApplicationWindow.qml +103 -0
- data/Components/Builtins/AreaChart.qml +70 -0
- data/Components/Builtins/AspectRatio.qml +30 -0
- data/Components/Builtins/Audio.qml +85 -0
- data/Components/Builtins/AudioInput.qml +10 -0
- data/Components/Builtins/AudioOutput.qml +10 -0
- data/Components/Builtins/Avatar.qml +46 -0
- data/Components/Builtins/Badge.qml +38 -0
- data/Components/Builtins/Banner.qml +133 -0
- data/Components/Builtins/BarChart.qml +67 -0
- data/Components/Builtins/BarIconButton.qml +30 -0
- data/Components/Builtins/BarIndicator.qml +26 -0
- data/Components/Builtins/Behavior.qml +13 -0
- data/Components/Builtins/Blur.qml +14 -0
- data/Components/Builtins/BorderImage.qml +38 -0
- data/Components/Builtins/BorderOverlay.qml +25 -0
- data/Components/Builtins/BottomSheet.qml +211 -0
- data/Components/Builtins/Breadcrumb.qml +169 -0
- data/Components/Builtins/BubbleChart.qml +3 -0
- data/Components/Builtins/BusyIndicator.qml +24 -0
- data/Components/Builtins/Button.qml +55 -0
- data/Components/Builtins/ButtonGroup.qml +18 -0
- data/Components/Builtins/Calendar.qml +55 -0
- data/Components/Builtins/Camera.qml +18 -0
- data/Components/Builtins/CandlestickChart.qml +3 -0
- data/Components/Builtins/Canvas.qml +159 -0
- data/Components/Builtins/CaptureSession.qml +19 -0
- data/Components/Builtins/Card.qml +23 -0
- data/Components/Builtins/Carousel.qml +72 -0
- data/Components/Builtins/Center.qml +20 -0
- data/Components/Builtins/CheckDelegate.qml +132 -0
- data/Components/Builtins/Checkbox.qml +62 -0
- data/Components/Builtins/Chip.qml +65 -0
- data/Components/Builtins/Circle.qml +35 -0
- data/Components/Builtins/Clipboard.qml +29 -0
- data/Components/Builtins/ColorAnimation.qml +3 -0
- data/Components/Builtins/ColorPicker.qml +70 -0
- data/Components/Builtins/Colorize.qml +14 -0
- data/Components/Builtins/Column.qml +17 -0
- data/Components/Builtins/ColumnLayout.qml +13 -0
- data/Components/Builtins/ConfirmDialog.qml +20 -0
- data/Components/Builtins/ConstrainedBox.qml +28 -0
- data/Components/Builtins/Container.qml +30 -0
- data/Components/Builtins/ContextMenu.qml +140 -0
- data/Components/Builtins/CursorSurface.qml +18 -0
- data/Components/Builtins/DataTable.qml +69 -0
- data/Components/Builtins/DatePicker.qml +180 -0
- data/Components/Builtins/DayOfWeekRow.qml +11 -0
- data/Components/Builtins/DelayButton.qml +47 -0
- data/Components/Builtins/DelegateModel.qml +10 -0
- data/Components/Builtins/DelegateModelGroup.qml +10 -0
- data/Components/Builtins/Dial.qml +42 -0
- data/Components/Builtins/Dialog.qml +128 -0
- data/Components/Builtins/DialogButtonBox.qml +137 -0
- data/Components/Builtins/Divider.qml +26 -0
- data/Components/Builtins/DonutChart.qml +3 -0
- data/Components/Builtins/DoubleSpinBox.qml +58 -0
- data/Components/Builtins/DragArea.qml +43 -0
- data/Components/Builtins/Drawer.qml +107 -0
- data/Components/Builtins/DropArea.qml +19 -0
- data/Components/Builtins/DropShadow.qml +16 -0
- data/Components/Builtins/Dropdown.qml +19 -0
- data/Components/Builtins/ExpansionPanel.qml +157 -0
- data/Components/Builtins/FilePicker.qml +140 -0
- data/Components/Builtins/FittedBox.qml +40 -0
- data/Components/Builtins/Flickable.qml +40 -0
- data/Components/Builtins/Flipable.qml +45 -0
- data/Components/Builtins/Flow.qml +16 -0
- data/Components/Builtins/FocusScope.qml +29 -0
- data/Components/Builtins/FolderListModel.qml +9 -0
- data/Components/Builtins/FolderPicker.qml +93 -0
- data/Components/Builtins/FontLoader.qml +21 -0
- data/Components/Builtins/FontPicker.qml +91 -0
- data/Components/Builtins/Frame.qml +71 -0
- data/Components/Builtins/FrameAnimation.qml +13 -0
- data/Components/Builtins/Gauge.qml +3 -0
- data/Components/Builtins/Glow.qml +15 -0
- data/Components/Builtins/Gradient.qml +93 -0
- data/Components/Builtins/Grid.qml +16 -0
- data/Components/Builtins/GridLayout.qml +16 -0
- data/Components/Builtins/GridView.qml +226 -0
- data/Components/Builtins/GroupBox.qml +95 -0
- data/Components/Builtins/Heatmap.qml +3 -0
- data/Components/Builtins/Histogram.qml +3 -0
- data/Components/Builtins/HorizontalHeader.qml +23 -0
- data/Components/Builtins/HorizontalHeaderDelegate.qml +39 -0
- data/Components/Builtins/HoverArea.qml +19 -0
- data/Components/Builtins/Icon.qml +16 -0
- data/Components/Builtins/Image.qml +110 -0
- data/Components/Builtins/ImageCapture.qml +14 -0
- data/Components/Builtins/ItemDelegate.qml +152 -0
- data/Components/Builtins/KeyCatcher.qml +25 -0
- data/Components/Builtins/Label.qml +43 -0
- data/Components/Builtins/LayoutItemProxy.qml +51 -0
- data/Components/Builtins/Legend.qml +86 -0
- data/Components/Builtins/Line.qml +28 -0
- data/Components/Builtins/LineChart.qml +87 -0
- data/Components/Builtins/ListModel.qml +8 -0
- data/Components/Builtins/ListView.qml +65 -0
- data/Components/Builtins/Loader.qml +33 -0
- data/Components/Builtins/Markdown.qml +23 -0
- data/Components/Builtins/MediaDevices.qml +10 -0
- data/Components/Builtins/MediaPlayer.qml +27 -0
- data/Components/Builtins/MediaRecorder.qml +16 -0
- data/Components/Builtins/Menu.qml +119 -0
- data/Components/Builtins/MenuBar.qml +128 -0
- data/Components/Builtins/MenuItem.qml +77 -0
- data/Components/Builtins/MenuSeparator.qml +30 -0
- data/Components/Builtins/MessageDialog.qml +104 -0
- data/Components/Builtins/ModalSheet.qml +222 -0
- data/Components/Builtins/ModelView3d.qml +50 -0
- data/Components/Builtins/MonthGrid.qml +23 -0
- data/Components/Builtins/MultiEffect.qml +48 -0
- data/Components/Builtins/MultiSelect.qml +23 -0
- data/Components/Builtins/NavigationRail.qml +154 -0
- data/Components/Builtins/NumberAnimation.qml +3 -0
- data/Components/Builtins/NumberField.qml +18 -0
- data/Components/Builtins/OpacityAnimator.qml +3 -0
- data/Components/Builtins/OpacityMask.qml +21 -0
- data/Components/Builtins/OpticalGlyph.qml +16 -0
- data/Components/Builtins/Page.qml +111 -0
- data/Components/Builtins/PageIndicator.qml +63 -0
- data/Components/Builtins/Pagination.qml +158 -0
- data/Components/Builtins/Pane.qml +72 -0
- data/Components/Builtins/PanelHero.qml +15 -0
- data/Components/Builtins/ParallelAnimation.qml +3 -0
- data/Components/Builtins/ParentAnimation.qml +3 -0
- data/Components/Builtins/ParentChange.qml +10 -0
- data/Components/Builtins/ParticleSystem.qml +81 -0
- data/Components/Builtins/PasswordField.qml +58 -0
- data/Components/Builtins/Path.qml +35 -0
- data/Components/Builtins/PathAnimation.qml +3 -0
- data/Components/Builtins/PauseAnimation.qml +3 -0
- data/Components/Builtins/PieChart.qml +3 -0
- data/Components/Builtins/PinchArea.qml +23 -0
- data/Components/Builtins/Popup.qml +130 -0
- data/Components/Builtins/Progress.qml +15 -0
- data/Components/Builtins/ProgressRing.qml +120 -0
- data/Components/Builtins/PropertyAction.qml +11 -0
- data/Components/Builtins/PropertyAnimation.qml +3 -0
- data/Components/Builtins/PropertyChanges.qml +10 -0
- data/Components/Builtins/RadarChart.qml +3 -0
- data/Components/Builtins/RadialGauge.qml +3 -0
- data/Components/Builtins/RadioButton.qml +46 -0
- data/Components/Builtins/RadioDelegate.qml +115 -0
- data/Components/Builtins/RadioGroup.qml +58 -0
- data/Components/Builtins/RangeSlider.qml +39 -0
- data/Components/Builtins/Rectangle.qml +23 -0
- data/Components/Builtins/RectangularShadow.qml +23 -0
- data/Components/Builtins/ReorderableList.qml +204 -0
- data/Components/Builtins/RichText.qml +23 -0
- data/Components/Builtins/RotationAnimation.qml +3 -0
- data/Components/Builtins/RotationAnimator.qml +3 -0
- data/Components/Builtins/RoundButton.qml +42 -0
- data/Components/Builtins/Row.qml +17 -0
- data/Components/Builtins/RowLayout.qml +13 -0
- data/Components/Builtins/ScaleAnimator.qml +3 -0
- data/Components/Builtins/ScatterChart.qml +3 -0
- data/Components/Builtins/ScreenCapture.qml +78 -0
- data/Components/Builtins/ScriptAction.qml +15 -0
- data/Components/Builtins/Scroll.qml +18 -0
- data/Components/Builtins/ScrollBar.qml +18 -0
- data/Components/Builtins/ScrollIndicator.qml +15 -0
- data/Components/Builtins/SearchField.qml +178 -0
- data/Components/Builtins/SearchableDropdown.qml +21 -0
- data/Components/Builtins/SectionHeader.qml +14 -0
- data/Components/Builtins/SelectableText.qml +33 -0
- data/Components/Builtins/SelectionRectangle.qml +17 -0
- data/Components/Builtins/Separator.qml +13 -0
- data/Components/Builtins/SequentialAnimation.qml +3 -0
- data/Components/Builtins/Settings.qml +10 -0
- data/Components/Builtins/ShaderEffect.qml +115 -0
- data/Components/Builtins/ShaderEffectSource.qml +61 -0
- data/Components/Builtins/Shaders/grayscale.frag +14 -0
- data/Components/Builtins/Shaders/grayscale.frag.qsb +0 -0
- data/Components/Builtins/Shaders/passthrough.frag +11 -0
- data/Components/Builtins/Shaders/passthrough.frag.qsb +0 -0
- data/Components/Builtins/Shaders/pixelate.frag +16 -0
- data/Components/Builtins/Shaders/pixelate.frag.qsb +0 -0
- data/Components/Builtins/Shaders/vignette.frag +18 -0
- data/Components/Builtins/Shaders/vignette.frag.qsb +0 -0
- data/Components/Builtins/Shaders/wave.frag +18 -0
- data/Components/Builtins/Shaders/wave.frag.qsb +0 -0
- data/Components/Builtins/Shape.qml +53 -0
- data/Components/Builtins/Skeleton.qml +78 -0
- data/Components/Builtins/Slider.qml +21 -0
- data/Components/Builtins/SmoothedAnimation.qml +3 -0
- data/Components/Builtins/Snackbar.qml +181 -0
- data/Components/Builtins/SortFilterProxyModel.qml +16 -0
- data/Components/Builtins/SoundEffect.qml +10 -0
- data/Components/Builtins/Spacer.qml +13 -0
- data/Components/Builtins/Sparkline.qml +3 -0
- data/Components/Builtins/SpinBox.qml +44 -0
- data/Components/Builtins/SplitView.qml +31 -0
- data/Components/Builtins/SpringAnimation.qml +3 -0
- data/Components/Builtins/Stack.qml +14 -0
- data/Components/Builtins/StackLayout.qml +19 -0
- data/Components/Builtins/StackView.qml +122 -0
- data/Components/Builtins/StackedBarChart.qml +3 -0
- data/Components/Builtins/StandardPaths.qml +9 -0
- data/Components/Builtins/State.qml +13 -0
- data/Components/Builtins/StateGroup.qml +11 -0
- data/Components/Builtins/Support/AnimationDriver.qml +79 -0
- data/Components/Builtins/Support/AnimationGroupDriver.qml +32 -0
- data/Components/Builtins/Support/ChartCanvas.qml +629 -0
- data/Components/Builtins/Support/ModelView3dScene.qml +292 -0
- data/Components/Builtins/Support/OptionalModuleState.js +5 -0
- data/Components/Builtins/SwipeDelegate.qml +231 -0
- data/Components/Builtins/SwipeView.qml +69 -0
- data/Components/Builtins/SwitchDelegate.qml +140 -0
- data/Components/Builtins/TabBar.qml +117 -0
- data/Components/Builtins/TabButton.qml +105 -0
- data/Components/Builtins/TableView.qml +388 -0
- data/Components/Builtins/TableViewDelegate.qml +17 -0
- data/Components/Builtins/Tabs.qml +138 -0
- data/Components/Builtins/Text.qml +24 -0
- data/Components/Builtins/TextArea.qml +59 -0
- data/Components/Builtins/TextField.qml +21 -0
- data/Components/Builtins/TextMetrics.qml +39 -0
- data/Components/Builtins/TimePicker.qml +213 -0
- data/Components/Builtins/Timer.qml +13 -0
- data/Components/Builtins/Toast.qml +213 -0
- data/Components/Builtins/Toggle.qml +19 -0
- data/Components/Builtins/ToggleSwitch.qml +22 -0
- data/Components/Builtins/ToolBar.qml +61 -0
- data/Components/Builtins/ToolButton.qml +41 -0
- data/Components/Builtins/ToolSeparator.qml +36 -0
- data/Components/Builtins/Tooltip.qml +20 -0
- data/Components/Builtins/Transition.qml +3 -0
- data/Components/Builtins/TreeView.qml +423 -0
- data/Components/Builtins/TreeViewDelegate.qml +46 -0
- data/Components/Builtins/Tumbler.qml +18 -0
- data/Components/Builtins/UniformAnimator.qml +3 -0
- data/Components/Builtins/VectorAnimation.qml +3 -0
- data/Components/Builtins/VectorImage.qml +62 -0
- data/Components/Builtins/VerticalHeader.qml +21 -0
- data/Components/Builtins/VerticalHeaderDelegate.qml +35 -0
- data/Components/Builtins/Video.qml +54 -0
- data/Components/Builtins/VideoOutput.qml +54 -0
- data/Components/Builtins/WebView.qml +57 -0
- data/Components/Builtins/WeekNumberColumn.qml +13 -0
- data/Components/Builtins/WidgetButton.qml +26 -0
- data/Components/Builtins/Window.qml +90 -0
- data/Components/Builtins/WindowCapture.qml +11 -0
- data/Components/Builtins/Wrap.qml +18 -0
- data/Components/Builtins/XAnimator.qml +3 -0
- data/Components/Builtins/YAnimator.qml +3 -0
- data/Components/README.md +45 -0
- data/ControlNode.qml +1369 -0
- data/Controls/BarIconButton.qml +27 -0
- data/Controls/BarIndicator.qml +22 -0
- data/Controls/BorderOverlay.qml +10 -0
- data/Controls/BorderSurface.qml +10 -0
- data/Controls/Button.qml +78 -0
- data/Controls/ButtonGroup.qml +19 -0
- data/Controls/ConfirmDialog.qml +37 -0
- data/Controls/CursorSurface.qml +29 -0
- data/Controls/Dropdown.qml +59 -0
- data/Controls/MultiSelect.qml +32 -0
- data/Controls/NumberField.qml +24 -0
- data/Controls/OpticalGlyph.qml +14 -0
- data/Controls/PanelActionButton.qml +10 -0
- data/Controls/PanelHero.qml +18 -0
- data/Controls/PanelKeyCatcher.qml +25 -0
- data/Controls/PanelSectionHeader.qml +11 -0
- data/Controls/PanelSeparator.qml +10 -0
- data/Controls/PanelSlider.qml +36 -0
- data/Controls/PanelToolTip.qml +13 -0
- data/Controls/SearchableDropdown.qml +11 -0
- data/Controls/TextField.qml +25 -0
- data/Controls/Toggle.qml +22 -0
- data/Controls/ToggleSwitch.qml +26 -0
- data/Controls/WidgetButton.qml +35 -0
- data/Controls/qmldir +25 -0
- data/Desktop.qml +76 -0
- data/LICENSE +22 -0
- data/README.md +112 -0
- data/Service.qml +430 -0
- data/Theme/Border.qml +22 -0
- data/Theme/Color.qml +22 -0
- data/Theme/Style.qml +47 -0
- data/Theme/Util.qml +6 -0
- data/Theme/qmldir +5 -0
- data/bin/zui +7 -0
- data/lib/zui/animation.rb +24 -0
- data/lib/zui/application.rb +327 -0
- data/lib/zui/builder.rb +725 -0
- data/lib/zui/cli.rb +91 -0
- data/lib/zui/command.rb +101 -0
- data/lib/zui/component_registry.rb +91 -0
- data/lib/zui/components.rb +262 -0
- data/lib/zui/distribution.rb +200 -0
- data/lib/zui/generator.rb +84 -0
- data/lib/zui/host.rb +123 -0
- data/lib/zui/node.rb +30 -0
- data/lib/zui/platform.rb +40 -0
- data/lib/zui/protocol.rb +29 -0
- data/lib/zui/runner.rb +37 -0
- data/lib/zui/runtime.rb +23 -0
- data/lib/zui/scheduler.rb +136 -0
- data/lib/zui/source_bundle.rb +63 -0
- data/lib/zui/state_store.rb +100 -0
- data/lib/zui/value.rb +44 -0
- data/lib/zui.rb +33 -0
- data/native/CMakeLists.txt +45 -0
- data/native/ZuiClipboard.cpp +16 -0
- data/native/ZuiClipboard.h +16 -0
- data/native/ZuiProcess.cpp +84 -0
- data/native/ZuiProcess.h +34 -0
- data/native/main.cpp +64 -0
- data/vendor/host/linux-x86_64/PROVENANCE.md +15 -0
- data/vendor/host/linux-x86_64/zui-host +0 -0
- data/vendor/host/linux-x86_64/zui-host.sha256 +1 -0
- 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
|
+
}
|