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
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import QtQuick
|
|
2
|
+
import QtQuick.Dialogs as Dialogs
|
|
3
|
+
|
|
4
|
+
Dialogs.MessageDialog {
|
|
5
|
+
id: messageDialogRoot
|
|
6
|
+
|
|
7
|
+
required property var renderer
|
|
8
|
+
readonly property bool requestedOpen: renderer.prop("opened", false) === true
|
|
9
|
+
&& renderer.prop("visible", true) !== false
|
|
10
|
+
|
|
11
|
+
function buttonsValue(value) {
|
|
12
|
+
var names = Array.isArray(value) ? value : (value === null || value === undefined ? [] : [value])
|
|
13
|
+
var result = Dialogs.MessageDialog.NoButton
|
|
14
|
+
for (var index = 0; index < names.length; index++) {
|
|
15
|
+
var name = String(names[index])
|
|
16
|
+
if (name === "ok") result |= Dialogs.MessageDialog.Ok
|
|
17
|
+
else if (name === "save") result |= Dialogs.MessageDialog.Save
|
|
18
|
+
else if (name === "save_all") result |= Dialogs.MessageDialog.SaveAll
|
|
19
|
+
else if (name === "open") result |= Dialogs.MessageDialog.Open
|
|
20
|
+
else if (name === "yes") result |= Dialogs.MessageDialog.Yes
|
|
21
|
+
else if (name === "yes_to_all") result |= Dialogs.MessageDialog.YesToAll
|
|
22
|
+
else if (name === "no") result |= Dialogs.MessageDialog.No
|
|
23
|
+
else if (name === "no_to_all") result |= Dialogs.MessageDialog.NoToAll
|
|
24
|
+
else if (name === "abort") result |= Dialogs.MessageDialog.Abort
|
|
25
|
+
else if (name === "retry") result |= Dialogs.MessageDialog.Retry
|
|
26
|
+
else if (name === "ignore") result |= Dialogs.MessageDialog.Ignore
|
|
27
|
+
else if (name === "close") result |= Dialogs.MessageDialog.Close
|
|
28
|
+
else if (name === "cancel") result |= Dialogs.MessageDialog.Cancel
|
|
29
|
+
else if (name === "discard") result |= Dialogs.MessageDialog.Discard
|
|
30
|
+
else if (name === "help") result |= Dialogs.MessageDialog.Help
|
|
31
|
+
else if (name === "apply") result |= Dialogs.MessageDialog.Apply
|
|
32
|
+
else if (name === "reset") result |= Dialogs.MessageDialog.Reset
|
|
33
|
+
else if (name === "restore_defaults") result |= Dialogs.MessageDialog.RestoreDefaults
|
|
34
|
+
}
|
|
35
|
+
return result
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function buttonName(button) {
|
|
39
|
+
if (button === Dialogs.MessageDialog.Ok) return "ok"
|
|
40
|
+
if (button === Dialogs.MessageDialog.Save) return "save"
|
|
41
|
+
if (button === Dialogs.MessageDialog.SaveAll) return "save_all"
|
|
42
|
+
if (button === Dialogs.MessageDialog.Open) return "open"
|
|
43
|
+
if (button === Dialogs.MessageDialog.Yes) return "yes"
|
|
44
|
+
if (button === Dialogs.MessageDialog.YesToAll) return "yes_to_all"
|
|
45
|
+
if (button === Dialogs.MessageDialog.No) return "no"
|
|
46
|
+
if (button === Dialogs.MessageDialog.NoToAll) return "no_to_all"
|
|
47
|
+
if (button === Dialogs.MessageDialog.Abort) return "abort"
|
|
48
|
+
if (button === Dialogs.MessageDialog.Retry) return "retry"
|
|
49
|
+
if (button === Dialogs.MessageDialog.Ignore) return "ignore"
|
|
50
|
+
if (button === Dialogs.MessageDialog.Close) return "close"
|
|
51
|
+
if (button === Dialogs.MessageDialog.Cancel) return "cancel"
|
|
52
|
+
if (button === Dialogs.MessageDialog.Discard) return "discard"
|
|
53
|
+
if (button === Dialogs.MessageDialog.Help) return "help"
|
|
54
|
+
if (button === Dialogs.MessageDialog.Apply) return "apply"
|
|
55
|
+
if (button === Dialogs.MessageDialog.Reset) return "reset"
|
|
56
|
+
if (button === Dialogs.MessageDialog.RestoreDefaults) return "restore_defaults"
|
|
57
|
+
return "unknown"
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function roleName(role) {
|
|
61
|
+
if (role === Dialogs.MessageDialog.AcceptRole) return "accept"
|
|
62
|
+
if (role === Dialogs.MessageDialog.RejectRole) return "reject"
|
|
63
|
+
if (role === Dialogs.MessageDialog.DestructiveRole) return "destructive"
|
|
64
|
+
if (role === Dialogs.MessageDialog.ActionRole) return "action"
|
|
65
|
+
if (role === Dialogs.MessageDialog.HelpRole) return "help"
|
|
66
|
+
if (role === Dialogs.MessageDialog.YesRole) return "yes"
|
|
67
|
+
if (role === Dialogs.MessageDialog.NoRole) return "no"
|
|
68
|
+
if (role === Dialogs.MessageDialog.ApplyRole) return "apply"
|
|
69
|
+
if (role === Dialogs.MessageDialog.ResetRole) return "reset"
|
|
70
|
+
return "invalid"
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function modalityValue(value) {
|
|
74
|
+
var name = String(value || "application")
|
|
75
|
+
if (name === "none" || name === "non_modal") return Qt.NonModal
|
|
76
|
+
if (name === "window" || name === "window_modal") return Qt.WindowModal
|
|
77
|
+
return Qt.ApplicationModal
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function syncOpenState() {
|
|
81
|
+
if (requestedOpen === visible) return
|
|
82
|
+
if (requestedOpen) open()
|
|
83
|
+
else close()
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
title: String(renderer.prop("title", ""))
|
|
87
|
+
text: String(renderer.prop("message", ""))
|
|
88
|
+
informativeText: String(renderer.prop("informative_text", ""))
|
|
89
|
+
detailedText: String(renderer.prop("detailed_text", ""))
|
|
90
|
+
buttons: buttonsValue(renderer.prop("buttons", ["ok"]))
|
|
91
|
+
modality: modalityValue(renderer.prop("modality", "application"))
|
|
92
|
+
|
|
93
|
+
Component.onCompleted: syncOpenState()
|
|
94
|
+
onRequestedOpenChanged: syncOpenState()
|
|
95
|
+
onButtonClicked: function(button, role) {
|
|
96
|
+
renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "button", {
|
|
97
|
+
button: buttonName(button), role: roleName(role)
|
|
98
|
+
})
|
|
99
|
+
}
|
|
100
|
+
onAccepted: renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "accept", {})
|
|
101
|
+
onRejected: renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "reject", {})
|
|
102
|
+
onVisibleChanged: renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId,
|
|
103
|
+
visible ? "open" : "close", {})
|
|
104
|
+
}
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import QtQuick
|
|
2
|
+
import QtQuick.Controls as QQC
|
|
3
|
+
import "../../Theme"
|
|
4
|
+
|
|
5
|
+
QQC.Popup {
|
|
6
|
+
id: modalSheetRoot
|
|
7
|
+
|
|
8
|
+
required property var renderer
|
|
9
|
+
readonly property bool requestedOpen: renderer.prop("opened", false) === true
|
|
10
|
+
&& renderer.prop("visible", true) !== false
|
|
11
|
+
readonly property string sheetEdge: String(renderer.prop("edge", "right"))
|
|
12
|
+
readonly property string contentLayout: String(renderer.prop("layout", "column"))
|
|
13
|
+
readonly property real sheetMargin: Number(renderer.prop("margin", Style.spacing.md))
|
|
14
|
+
readonly property real maximumWidth: Number(renderer.prop("max_width", 720))
|
|
15
|
+
readonly property real maximumHeight: Number(renderer.prop("max_height", 900))
|
|
16
|
+
readonly property bool horizontalEdge: sheetEdge === "top" || sheetEdge === "bottom"
|
|
17
|
+
property bool dismissalReported: false
|
|
18
|
+
|
|
19
|
+
function closePolicyValue(value) {
|
|
20
|
+
if (renderer.prop("dismissible", true) === false) return QQC.Popup.NoAutoClose
|
|
21
|
+
var names = Array.isArray(value) ? value : [value || "escape_and_outside"]
|
|
22
|
+
var result = 0
|
|
23
|
+
for (var index = 0; index < names.length; index++) {
|
|
24
|
+
var name = String(names[index])
|
|
25
|
+
if (name === "none") continue
|
|
26
|
+
if (name === "escape" || name === "escape_and_outside") result |= QQC.Popup.CloseOnEscape
|
|
27
|
+
if (name === "outside" || name === "escape_and_outside") result |= QQC.Popup.CloseOnPressOutside
|
|
28
|
+
if (name === "outside_parent") result |= QQC.Popup.CloseOnPressOutsideParent
|
|
29
|
+
if (name === "release_outside") result |= QQC.Popup.CloseOnReleaseOutside
|
|
30
|
+
if (name === "release_outside_parent") result |= QQC.Popup.CloseOnReleaseOutsideParent
|
|
31
|
+
}
|
|
32
|
+
return result
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function syncOpenState() {
|
|
36
|
+
if (requestedOpen === opened) return
|
|
37
|
+
if (requestedOpen) open()
|
|
38
|
+
else close()
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function reportDismiss(reason) {
|
|
42
|
+
if (dismissalReported) return
|
|
43
|
+
dismissalReported = true
|
|
44
|
+
renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "dismiss", { reason: reason })
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function dismiss(reason) {
|
|
48
|
+
if (renderer.prop("dismissible", true) === false) return
|
|
49
|
+
reportDismiss(reason)
|
|
50
|
+
close()
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function hiddenX() {
|
|
54
|
+
if (!parent) return x
|
|
55
|
+
if (sheetEdge === "left") return -width
|
|
56
|
+
if (sheetEdge === "right") return parent.width
|
|
57
|
+
return x
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function hiddenY() {
|
|
61
|
+
if (!parent) return y
|
|
62
|
+
if (sheetEdge === "top") return -height
|
|
63
|
+
if (sheetEdge === "bottom") return parent.height
|
|
64
|
+
return y
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
x: {
|
|
68
|
+
if (!parent) return sheetMargin
|
|
69
|
+
if (sheetEdge === "left") return sheetMargin
|
|
70
|
+
if (sheetEdge === "right") return parent.width - width - sheetMargin
|
|
71
|
+
return Math.max(sheetMargin, (parent.width - width) / 2)
|
|
72
|
+
}
|
|
73
|
+
y: {
|
|
74
|
+
if (!parent) return sheetMargin
|
|
75
|
+
if (sheetEdge === "top") return sheetMargin
|
|
76
|
+
if (sheetEdge === "bottom") return parent.height - height - sheetMargin
|
|
77
|
+
return Math.max(sheetMargin, (parent.height - height) / 2)
|
|
78
|
+
}
|
|
79
|
+
width: {
|
|
80
|
+
var available = parent ? Math.max(0, parent.width - sheetMargin * 2) : maximumWidth
|
|
81
|
+
var defaultWidth = horizontalEdge ? available : Math.min(520, available)
|
|
82
|
+
return Math.min(Number(renderer.prop("width", defaultWidth)), available, maximumWidth)
|
|
83
|
+
}
|
|
84
|
+
height: {
|
|
85
|
+
var available = parent ? Math.max(0, parent.height - sheetMargin * 2) : maximumHeight
|
|
86
|
+
var defaultHeight = horizontalEdge ? Math.min(420, available) : available
|
|
87
|
+
return Math.min(Number(renderer.prop("height", defaultHeight)), available, maximumHeight)
|
|
88
|
+
}
|
|
89
|
+
modal: renderer.prop("modal", true) !== false
|
|
90
|
+
dim: renderer.prop("dim", modal) !== false
|
|
91
|
+
focus: true
|
|
92
|
+
closePolicy: closePolicyValue(renderer.prop("close_policy", "escape_and_outside"))
|
|
93
|
+
enabled: renderer.prop("enabled", true) !== false
|
|
94
|
+
padding: Number(renderer.prop("padding", Style.spacing.lg))
|
|
95
|
+
|
|
96
|
+
background: Rectangle {
|
|
97
|
+
color: renderer.prop("background", Color.background)
|
|
98
|
+
radius: Number(renderer.prop("radius", Style.cornerRadius))
|
|
99
|
+
border.width: String(renderer.prop("border_color", "")).length > 0 ? Style.normalBorderWidth : 0
|
|
100
|
+
border.color: renderer.prop("border_color", "transparent")
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
contentItem: Column {
|
|
104
|
+
spacing: Number(renderer.prop("spacing", Style.spacing.md))
|
|
105
|
+
|
|
106
|
+
Rectangle {
|
|
107
|
+
width: parent.width
|
|
108
|
+
height: renderer.prop("show_header", true) !== false
|
|
109
|
+
? Number(renderer.prop("header_height", 48)) : 0
|
|
110
|
+
visible: height > 0
|
|
111
|
+
color: renderer.prop("header_background", "transparent")
|
|
112
|
+
|
|
113
|
+
Text {
|
|
114
|
+
anchors.left: parent.left
|
|
115
|
+
anchors.right: closeButton.visible ? closeButton.left : parent.right
|
|
116
|
+
anchors.verticalCenter: parent.verticalCenter
|
|
117
|
+
anchors.rightMargin: Style.spacing.sm
|
|
118
|
+
text: String(renderer.prop("title", ""))
|
|
119
|
+
color: renderer.prop("foreground", renderer.foreground)
|
|
120
|
+
font.family: String(renderer.prop("font_family", renderer.fontFamily))
|
|
121
|
+
font.pixelSize: Number(renderer.prop("title_size", Style.font.heading))
|
|
122
|
+
font.bold: true
|
|
123
|
+
elide: Text.ElideRight
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
QQC.ToolButton {
|
|
127
|
+
id: closeButton
|
|
128
|
+
anchors.right: parent.right
|
|
129
|
+
anchors.verticalCenter: parent.verticalCenter
|
|
130
|
+
visible: renderer.prop("show_close", true) !== false
|
|
131
|
+
&& renderer.prop("dismissible", true) !== false
|
|
132
|
+
text: renderer.iconGlyph("xmark")
|
|
133
|
+
font.family: renderer.fontFamily
|
|
134
|
+
font.pixelSize: Number(renderer.prop("font_size", Style.font.body))
|
|
135
|
+
onClicked: modalSheetRoot.dismiss("close_button")
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
Loader {
|
|
140
|
+
width: parent.width
|
|
141
|
+
height: Math.max(0, parent.height - y)
|
|
142
|
+
sourceComponent: modalSheetRoot.contentLayout === "row" ? rowContent
|
|
143
|
+
: (modalSheetRoot.contentLayout === "stack" ? stackContent : columnContent)
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
Component {
|
|
148
|
+
id: columnContent
|
|
149
|
+
Column {
|
|
150
|
+
spacing: Number(renderer.prop("spacing", Style.spacing.md))
|
|
151
|
+
Repeater { model: renderer.node.children || []; delegate: renderer.childDelegateComponent }
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
Component {
|
|
156
|
+
id: rowContent
|
|
157
|
+
Row {
|
|
158
|
+
spacing: Number(renderer.prop("spacing", Style.spacing.md))
|
|
159
|
+
Repeater { model: renderer.node.children || []; delegate: renderer.childDelegateComponent }
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
Component {
|
|
164
|
+
id: stackContent
|
|
165
|
+
Item {
|
|
166
|
+
Repeater { model: renderer.node.children || []; delegate: renderer.childDelegateComponent }
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
enter: Transition {
|
|
171
|
+
ParallelAnimation {
|
|
172
|
+
NumberAnimation {
|
|
173
|
+
property: "opacity"; from: 0; to: 1
|
|
174
|
+
duration: renderer.prop("animated", true) !== false
|
|
175
|
+
? Number(renderer.prop("duration", 220)) : 0
|
|
176
|
+
easing.type: renderer.easingType(renderer.prop("easing", "out_cubic"))
|
|
177
|
+
}
|
|
178
|
+
NumberAnimation {
|
|
179
|
+
property: modalSheetRoot.horizontalEdge ? "y" : "x"
|
|
180
|
+
from: modalSheetRoot.horizontalEdge ? modalSheetRoot.hiddenY() : modalSheetRoot.hiddenX()
|
|
181
|
+
duration: renderer.prop("animated", true) !== false
|
|
182
|
+
? Number(renderer.prop("duration", 220)) : 0
|
|
183
|
+
easing.type: renderer.easingType(renderer.prop("easing", "out_cubic"))
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
exit: Transition {
|
|
189
|
+
ParallelAnimation {
|
|
190
|
+
NumberAnimation {
|
|
191
|
+
property: "opacity"; from: 1; to: 0
|
|
192
|
+
duration: renderer.prop("animated", true) !== false
|
|
193
|
+
? Number(renderer.prop("duration", 180)) : 0
|
|
194
|
+
easing.type: renderer.easingType("in_cubic")
|
|
195
|
+
}
|
|
196
|
+
NumberAnimation {
|
|
197
|
+
property: modalSheetRoot.horizontalEdge ? "y" : "x"
|
|
198
|
+
to: modalSheetRoot.horizontalEdge ? modalSheetRoot.hiddenY() : modalSheetRoot.hiddenX()
|
|
199
|
+
duration: renderer.prop("animated", true) !== false
|
|
200
|
+
? Number(renderer.prop("duration", 180)) : 0
|
|
201
|
+
easing.type: renderer.easingType("in_cubic")
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
Component.onCompleted: syncOpenState()
|
|
207
|
+
onRequestedOpenChanged: syncOpenState()
|
|
208
|
+
onOpened: {
|
|
209
|
+
dismissalReported = false
|
|
210
|
+
renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "open", {})
|
|
211
|
+
}
|
|
212
|
+
onClosed: {
|
|
213
|
+
if (requestedOpen && !dismissalReported) reportDismiss("close_policy")
|
|
214
|
+
renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "close", {})
|
|
215
|
+
}
|
|
216
|
+
onAboutToShow: renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "about_to_show", {})
|
|
217
|
+
onAboutToHide: renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "about_to_hide", {})
|
|
218
|
+
onVisibleChanged: renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId,
|
|
219
|
+
visible ? "show" : "hide", {})
|
|
220
|
+
onActiveFocusChanged: renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId,
|
|
221
|
+
activeFocus ? "focus" : "blur", {})
|
|
222
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import QtQuick
|
|
2
|
+
import "Support/OptionalModuleState.js" as OptionalModuleState
|
|
3
|
+
|
|
4
|
+
Item {
|
|
5
|
+
id: modelHost
|
|
6
|
+
|
|
7
|
+
required property var renderer
|
|
8
|
+
property bool failureReported: false
|
|
9
|
+
|
|
10
|
+
function reportUnavailable() {
|
|
11
|
+
if (failureReported)
|
|
12
|
+
return ;
|
|
13
|
+
|
|
14
|
+
failureReported = true;
|
|
15
|
+
renderer.componentError("qtquick3d_unavailable", "Qt Quick 3D is not installed. Install qt6-quick3d and assimp.", {
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
implicitWidth: Number(renderer.prop("width", 420))
|
|
20
|
+
implicitHeight: Number(renderer.prop("height", 420))
|
|
21
|
+
clip: true
|
|
22
|
+
Component.onCompleted: {
|
|
23
|
+
if (OptionalModuleState.quick3dUnavailable) {
|
|
24
|
+
reportUnavailable();
|
|
25
|
+
return ;
|
|
26
|
+
}
|
|
27
|
+
sceneLoader.setSource(Qt.resolvedUrl("Support/ModelView3dScene.qml"), {
|
|
28
|
+
"renderer": renderer
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
Rectangle {
|
|
33
|
+
anchors.fill: parent
|
|
34
|
+
color: renderer.prop("background", "transparent")
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
Loader {
|
|
38
|
+
id: sceneLoader
|
|
39
|
+
|
|
40
|
+
anchors.fill: parent
|
|
41
|
+
asynchronous: true
|
|
42
|
+
onStatusChanged: {
|
|
43
|
+
if (status === Loader.Error) {
|
|
44
|
+
OptionalModuleState.quick3dUnavailable = true;
|
|
45
|
+
modelHost.reportUnavailable();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import QtQuick
|
|
2
|
+
import QtQuick.Controls as QQC
|
|
3
|
+
import "../../Theme"
|
|
4
|
+
|
|
5
|
+
QQC.MonthGrid {
|
|
6
|
+
id: monthRoot
|
|
7
|
+
property var renderer: null
|
|
8
|
+
implicitWidth: Number(renderer ? renderer.prop("width", 320) : 320); implicitHeight: Number(renderer ? renderer.prop("height", 280) : 280)
|
|
9
|
+
month: Number(renderer ? renderer.prop("month", new Date().getMonth() + 1) : new Date().getMonth() + 1) - 1
|
|
10
|
+
year: Number(renderer ? renderer.prop("year", new Date().getFullYear()) : new Date().getFullYear())
|
|
11
|
+
locale: Qt.locale(String(renderer ? renderer.prop("locale", Qt.locale().name) : Qt.locale().name))
|
|
12
|
+
function allowed(value){var text=Qt.formatDate(value,"yyyy-MM-dd");var minimum=String(renderer?renderer.prop("minimum",""):"");var maximum=String(renderer?renderer.prop("maximum",""):"");return(minimum===""||text>=minimum)&&(maximum===""||text<=maximum)}
|
|
13
|
+
delegate: Text {
|
|
14
|
+
required property var model
|
|
15
|
+
text: model.day; opacity: monthRoot.allowed(model.date) ? 1 : 0.35; horizontalAlignment: Text.AlignHCenter; verticalAlignment: Text.AlignVCenter
|
|
16
|
+
color: model.month === monthRoot.month ? renderer.prop("foreground", renderer.foreground) : renderer.prop("muted", Color.muted)
|
|
17
|
+
font.family: renderer.prop("font_family", renderer.fontFamily); font.pixelSize: Number(renderer.prop("font_size", Style.font.body))
|
|
18
|
+
Rectangle { anchors.fill: parent; z: -1; radius: width / 2; color: Qt.formatDate(model.date, "yyyy-MM-dd") === String(renderer.prop("selected_date", "")) ? renderer.prop("selected_background", renderer.prop("accent", Color.accent)) : (Qt.formatDate(model.date,"yyyy-MM-dd")===Qt.formatDate(new Date(),"yyyy-MM-dd")?renderer.prop("today_background",Color.popups.background):renderer.prop("background","transparent")) }
|
|
19
|
+
}
|
|
20
|
+
onClicked: function(date) { if(!allowed(date))return;var payload = { value: Qt.formatDate(date, "yyyy-MM-dd") }; renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "click", payload); renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "change", payload) }
|
|
21
|
+
onPressed: function(date) { renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "press", { value: Qt.formatDate(date, "yyyy-MM-dd") }) }
|
|
22
|
+
onReleased: function(date) { renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "release", { value: Qt.formatDate(date, "yyyy-MM-dd") }) }
|
|
23
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import QtQuick
|
|
2
|
+
import QtQuick.Effects
|
|
3
|
+
|
|
4
|
+
Item {
|
|
5
|
+
id: effectRoot
|
|
6
|
+
required property var renderer
|
|
7
|
+
implicitWidth: Number(renderer.prop("width", 240))
|
|
8
|
+
implicitHeight: Number(renderer.prop("height", 160))
|
|
9
|
+
|
|
10
|
+
Item {
|
|
11
|
+
id: sourceHost
|
|
12
|
+
anchors.fill: parent
|
|
13
|
+
Repeater { model: renderer.node.children || []; delegate: renderer.childDelegateComponent }
|
|
14
|
+
}
|
|
15
|
+
ShaderEffectSource { id: sourceTexture; anchors.fill: parent; sourceItem: sourceHost; hideSource: true; visible: false }
|
|
16
|
+
|
|
17
|
+
MultiEffect {
|
|
18
|
+
id: nativeEffect
|
|
19
|
+
anchors.fill: parent
|
|
20
|
+
source: sourceTexture
|
|
21
|
+
brightness: Number(renderer.prop("brightness", 0))
|
|
22
|
+
contrast: Number(renderer.prop("contrast", 0))
|
|
23
|
+
saturation: Number(renderer.prop("saturation", 0))
|
|
24
|
+
colorization: Number(renderer.prop("colorization", 0))
|
|
25
|
+
colorizationColor: renderer.prop("colorization_color", "white")
|
|
26
|
+
blurEnabled: renderer.prop("blur_enabled", false) === true
|
|
27
|
+
blur: Number(renderer.prop("blur", 0))
|
|
28
|
+
blurMax: Number(renderer.prop("blur_max", 32))
|
|
29
|
+
blurMultiplier: Number(renderer.prop("blur_multiplier", 1))
|
|
30
|
+
shadowEnabled: renderer.prop("shadow_enabled", false) === true
|
|
31
|
+
shadowOpacity: Number(renderer.prop("shadow_opacity", 1))
|
|
32
|
+
shadowBlur: Number(renderer.prop("shadow_blur", 1))
|
|
33
|
+
shadowHorizontalOffset: Number(renderer.prop("shadow_horizontal_offset", 0))
|
|
34
|
+
shadowVerticalOffset: Number(renderer.prop("shadow_vertical_offset", 0))
|
|
35
|
+
shadowColor: renderer.prop("shadow_color", "black")
|
|
36
|
+
shadowScale: Number(renderer.prop("shadow_scale", 1))
|
|
37
|
+
maskEnabled: renderer.prop("mask_enabled", false) === true
|
|
38
|
+
maskSource: renderer.findRenderedItem(renderer.prop("mask_source", ""))
|
|
39
|
+
maskThresholdMin: Number(renderer.prop("mask_threshold_min", 0))
|
|
40
|
+
maskSpreadAtMin: Number(renderer.prop("mask_spread_at_min", 0))
|
|
41
|
+
maskThresholdMax: Number(renderer.prop("mask_threshold_max", 1))
|
|
42
|
+
maskSpreadAtMax: Number(renderer.prop("mask_spread_at_max", 0))
|
|
43
|
+
maskInverted: renderer.prop("mask_inverted", false) === true
|
|
44
|
+
autoPaddingEnabled: renderer.prop("auto_padding", true) !== false
|
|
45
|
+
paddingRect: Qt.rect(Number(renderer.prop("padding_left", 0)), Number(renderer.prop("padding_top", 0)), Number(renderer.prop("padding_right", 0)), Number(renderer.prop("padding_bottom", 0)))
|
|
46
|
+
onShaderChanged: if (renderer.subscribed("shader_change")) renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "shader_change", { fragment: fragmentShader, vertex: vertexShader })
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
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.MultiSelect {
|
|
10
|
+
required property var renderer
|
|
11
|
+
label: renderer.escapeAutoText(renderer.prop("label", "")); values: renderer.prop("values", []); options: renderer.prop("options", [])
|
|
12
|
+
placeholderText: String(renderer.prop("placeholder", "Search...")); enabled: renderer.prop("enabled", true) !== false
|
|
13
|
+
optionsCommand: renderer.prop("options_command", []); optionsCommandCwd: String(renderer.prop("options_command_cwd", ""))
|
|
14
|
+
emptyText: String(renderer.prop("empty_text", "No options")); noSelectionText: String(renderer.prop("no_selection_text", "None selected"))
|
|
15
|
+
triggerLabel: String(renderer.prop("trigger_label", "")); showLabel: renderer.prop("show_label", true) !== false
|
|
16
|
+
width: Number(renderer.prop("width", 240)); foreground: renderer.prop("foreground", renderer.foreground)
|
|
17
|
+
background: renderer.prop("background", Color.popups.background); popupBorder: renderer.prop("popup_border", Color.popups.border)
|
|
18
|
+
accent: renderer.prop("accent", Color.accent); fontFamily: String(renderer.prop("font_family", renderer.fontFamily))
|
|
19
|
+
rowHeight: Number(renderer.prop("row_height", Style.spacing.controlHeight)); popupRowHeight: Number(renderer.prop("popup_row_height", Style.spacing.popupRowHeight))
|
|
20
|
+
popupMinHeight: Number(renderer.prop("popup_min_height", Style.spacing.searchablePopupMinHeight)); hasCursor: renderer.prop("cursor", false) === true
|
|
21
|
+
onChanged: function(values) { renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "change", { value: values }) }
|
|
22
|
+
onOptionHovered: function(value) { renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "hover", { value: value }) }
|
|
23
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import QtQuick
|
|
2
|
+
import QtQuick.Controls as QQC
|
|
3
|
+
import "../../Theme"
|
|
4
|
+
|
|
5
|
+
QQC.Pane {
|
|
6
|
+
id: railRoot
|
|
7
|
+
|
|
8
|
+
required property var renderer
|
|
9
|
+
readonly property var destinations: renderer.prop("items", [])
|
|
10
|
+
readonly property int requestedIndex: Number(renderer.prop("current_index", 0))
|
|
11
|
+
readonly property bool extended: renderer.prop("extended", false) === true
|
|
12
|
+
property int currentIndex: 0
|
|
13
|
+
property bool synchronizing: false
|
|
14
|
+
|
|
15
|
+
function itemAt(index) {
|
|
16
|
+
return Array.isArray(destinations) && index < destinations.length ? destinations[index] : null
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function itemValue(index, name, fallback) {
|
|
20
|
+
var item = itemAt(index)
|
|
21
|
+
return item !== null && typeof item === "object" && item[name] !== undefined
|
|
22
|
+
? item[name] : fallback
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function itemLabel(index) {
|
|
26
|
+
var item = itemAt(index)
|
|
27
|
+
return item !== null && typeof item === "object"
|
|
28
|
+
? String(item.label === undefined ? (item.text === undefined ? "" : item.text) : item.label)
|
|
29
|
+
: String(item === null ? "" : item)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function boundedIndex(value) {
|
|
33
|
+
var count = Array.isArray(destinations) ? destinations.length : 0
|
|
34
|
+
return count === 0 ? -1 : Math.max(0, Math.min(count - 1, Number(value)))
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function syncSelection() {
|
|
38
|
+
var next = boundedIndex(requestedIndex)
|
|
39
|
+
if (currentIndex === next) return
|
|
40
|
+
synchronizing = true
|
|
41
|
+
currentIndex = next
|
|
42
|
+
synchronizing = false
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
implicitWidth: Number(renderer.prop("width", extended ? 220 : 72))
|
|
46
|
+
implicitHeight: Number(renderer.prop("height", 480))
|
|
47
|
+
enabled: renderer.prop("enabled", true) !== false
|
|
48
|
+
visible: renderer.prop("visible", true) !== false
|
|
49
|
+
padding: Number(renderer.prop("padding", Style.spacing.md))
|
|
50
|
+
|
|
51
|
+
background: Rectangle {
|
|
52
|
+
color: renderer.prop("background", Color.background)
|
|
53
|
+
radius: Number(renderer.prop("radius", 0))
|
|
54
|
+
border.width: String(renderer.prop("border_color", "")).length > 0 ? Style.normalBorderWidth : 0
|
|
55
|
+
border.color: renderer.prop("border_color", "transparent")
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
contentItem: Item {
|
|
59
|
+
Column {
|
|
60
|
+
id: destinationColumn
|
|
61
|
+
anchors.left: parent.left
|
|
62
|
+
anchors.right: parent.right
|
|
63
|
+
anchors.top: String(renderer.prop("alignment", "top")) === "top" ? parent.top : undefined
|
|
64
|
+
anchors.verticalCenter: String(renderer.prop("alignment", "top")) === "center"
|
|
65
|
+
? parent.verticalCenter : undefined
|
|
66
|
+
anchors.bottom: String(renderer.prop("alignment", "top")) === "bottom" ? parent.bottom : undefined
|
|
67
|
+
spacing: Number(renderer.prop("spacing", Style.spacing.sm))
|
|
68
|
+
|
|
69
|
+
Repeater {
|
|
70
|
+
model: Array.isArray(railRoot.destinations) ? railRoot.destinations.length : 0
|
|
71
|
+
QQC.ToolButton {
|
|
72
|
+
required property int index
|
|
73
|
+
width: destinationColumn.width
|
|
74
|
+
height: Number(renderer.prop("item_height", 56))
|
|
75
|
+
enabled: railRoot.enabled && railRoot.itemValue(index, "enabled", true) !== false
|
|
76
|
+
checkable: true
|
|
77
|
+
checked: railRoot.currentIndex === index
|
|
78
|
+
hoverEnabled: true
|
|
79
|
+
|
|
80
|
+
contentItem: Row {
|
|
81
|
+
property bool selected: parent.checked
|
|
82
|
+
property bool available: parent.enabled
|
|
83
|
+
anchors.centerIn: parent
|
|
84
|
+
spacing: railRoot.extended ? Style.spacing.md : 0
|
|
85
|
+
|
|
86
|
+
Image {
|
|
87
|
+
visible: source.toString().length > 0
|
|
88
|
+
source: String(railRoot.itemValue(index, "icon_source", ""))
|
|
89
|
+
width: Number(renderer.prop("icon_size", Style.font.icon))
|
|
90
|
+
height: width
|
|
91
|
+
fillMode: Image.PreserveAspectFit
|
|
92
|
+
onStatusChanged: {
|
|
93
|
+
if (status === Image.Error)
|
|
94
|
+
renderer.componentError("navigation_rail_icon_failed",
|
|
95
|
+
"Unable to load the declared navigation rail icon image",
|
|
96
|
+
{ index: index, source: String(source) })
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
Text {
|
|
101
|
+
visible: String(railRoot.itemValue(index, "icon_source", "")).length === 0
|
|
102
|
+
text: renderer.iconGlyph(railRoot.itemValue(index, "icon", "circle_info"))
|
|
103
|
+
color: parent.selected ? renderer.prop("accent", Color.accent)
|
|
104
|
+
: (parent.available ? renderer.prop("foreground", renderer.foreground)
|
|
105
|
+
: renderer.prop("muted", Color.muted))
|
|
106
|
+
font.family: renderer.fontFamily
|
|
107
|
+
font.pixelSize: Number(renderer.prop("icon_size", Style.font.icon))
|
|
108
|
+
anchors.verticalCenter: parent.verticalCenter
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
Text {
|
|
112
|
+
visible: railRoot.extended
|
|
113
|
+
text: railRoot.itemLabel(index)
|
|
114
|
+
color: parent.selected ? renderer.prop("accent", Color.accent)
|
|
115
|
+
: (parent.available ? renderer.prop("foreground", renderer.foreground)
|
|
116
|
+
: renderer.prop("muted", Color.muted))
|
|
117
|
+
font.family: String(renderer.prop("font_family", renderer.fontFamily))
|
|
118
|
+
font.pixelSize: Number(renderer.prop("font_size", Style.font.body))
|
|
119
|
+
anchors.verticalCenter: parent.verticalCenter
|
|
120
|
+
elide: Text.ElideRight
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
background: Rectangle {
|
|
125
|
+
color: parent.checked ? renderer.prop("selected_background", "transparent") : "transparent"
|
|
126
|
+
radius: Number(renderer.prop("radius", Style.cornerRadius))
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
onClicked: {
|
|
130
|
+
railRoot.currentIndex = index
|
|
131
|
+
if (renderer.subscribed("select"))
|
|
132
|
+
renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "select",
|
|
133
|
+
{ value: index, label: railRoot.itemLabel(index) })
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
onRequestedIndexChanged: syncSelection()
|
|
141
|
+
onDestinationsChanged: syncSelection()
|
|
142
|
+
Component.onCompleted: syncSelection()
|
|
143
|
+
onCurrentIndexChanged: {
|
|
144
|
+
if (synchronizing || currentIndex < 0) return
|
|
145
|
+
if (renderer.subscribed("input"))
|
|
146
|
+
renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "input", { value: currentIndex })
|
|
147
|
+
if (renderer.subscribed("change"))
|
|
148
|
+
renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "change", { value: currentIndex })
|
|
149
|
+
}
|
|
150
|
+
onVisibleChanged: renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId,
|
|
151
|
+
visible ? "show" : "hide", {})
|
|
152
|
+
onActiveFocusChanged: renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId,
|
|
153
|
+
activeFocus ? "focus" : "blur", {})
|
|
154
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
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.NumberField {
|
|
10
|
+
required property var renderer
|
|
11
|
+
label: renderer.escapeAutoText(renderer.prop("label", "")); value: Number(renderer.prop("value", 0))
|
|
12
|
+
from: Number(renderer.prop("from", 0)); to: Number(renderer.prop("to", 100)); stepSize: Number(renderer.prop("step", 1))
|
|
13
|
+
foreground: renderer.prop("foreground", renderer.foreground); accent: renderer.prop("accent", Color.accent)
|
|
14
|
+
fontFamily: String(renderer.prop("font_family", renderer.fontFamily)); fontSize: Number(renderer.prop("font_size", Style.font.body))
|
|
15
|
+
fieldWidth: Number(renderer.prop("field_width", Style.spacing.numberFieldWidth)); hasCursor: renderer.prop("cursor", false) === true
|
|
16
|
+
onModified: function(value) { renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "change", { value: value }) }
|
|
17
|
+
onHovered: function(value) { renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "hover", { value: value }) }
|
|
18
|
+
}
|