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,140 @@
|
|
|
1
|
+
import QtQuick
|
|
2
|
+
import QtQuick.Controls as QQC
|
|
3
|
+
import QtQuick.Layouts
|
|
4
|
+
import "../../Theme"
|
|
5
|
+
|
|
6
|
+
QQC.SwitchDelegate {
|
|
7
|
+
id: switchRoot
|
|
8
|
+
|
|
9
|
+
required property var renderer
|
|
10
|
+
readonly property bool selected: renderer.prop("selected", false) === true
|
|
11
|
+
readonly property real indicatorWidth: Number(renderer.prop("indicator_width", 44))
|
|
12
|
+
readonly property real indicatorHeight: Number(renderer.prop("indicator_height", 24))
|
|
13
|
+
|
|
14
|
+
function eventPayload() {
|
|
15
|
+
return {
|
|
16
|
+
text: text,
|
|
17
|
+
value: renderer.prop("value", text),
|
|
18
|
+
checked: checked,
|
|
19
|
+
selected: selected
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
text: String(renderer.prop("text", ""))
|
|
24
|
+
checked: renderer.prop("checked", false) === true
|
|
25
|
+
highlighted: renderer.prop("highlighted", selected) === true
|
|
26
|
+
enabled: renderer.prop("enabled", true) !== false
|
|
27
|
+
visible: renderer.prop("visible", true) !== false
|
|
28
|
+
hoverEnabled: true
|
|
29
|
+
implicitWidth: Number(renderer.prop("width", 320))
|
|
30
|
+
implicitHeight: Number(renderer.prop("height", 56))
|
|
31
|
+
padding: Number(renderer.prop("padding", Style.spacing.md))
|
|
32
|
+
rightPadding: padding + indicatorWidth + Number(renderer.prop("spacing", Style.spacing.md))
|
|
33
|
+
font.family: String(renderer.prop("font_family", renderer.fontFamily))
|
|
34
|
+
font.pixelSize: Number(renderer.prop("font_size", Style.font.body))
|
|
35
|
+
Accessible.name: String(renderer.prop("accessible_name", text))
|
|
36
|
+
|
|
37
|
+
background: Rectangle {
|
|
38
|
+
color: switchRoot.highlighted
|
|
39
|
+
? renderer.prop("highlighted_background", renderer.prop("selected_background", Color.popups.background))
|
|
40
|
+
: (switchRoot.selected
|
|
41
|
+
? renderer.prop("selected_background", Color.popups.background)
|
|
42
|
+
: renderer.prop("background", "transparent"))
|
|
43
|
+
radius: Number(renderer.prop("radius", Style.cornerRadius))
|
|
44
|
+
border.width: Number(renderer.prop("border_width",
|
|
45
|
+
String(renderer.prop("border_color", "")).length > 0 ? Style.normalBorderWidth : 0))
|
|
46
|
+
border.color: renderer.prop("border_color", "transparent")
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
contentItem: ColumnLayout {
|
|
50
|
+
spacing: Style.spacing.xs
|
|
51
|
+
|
|
52
|
+
Text {
|
|
53
|
+
Layout.fillWidth: true
|
|
54
|
+
text: switchRoot.text
|
|
55
|
+
textFormat: Text.PlainText
|
|
56
|
+
color: switchRoot.selected
|
|
57
|
+
? renderer.prop("selected_foreground", renderer.prop("foreground", renderer.foreground))
|
|
58
|
+
: renderer.prop("foreground", renderer.foreground)
|
|
59
|
+
font: switchRoot.font
|
|
60
|
+
elide: Text.ElideRight
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
Text {
|
|
64
|
+
Layout.fillWidth: true
|
|
65
|
+
visible: text.length > 0
|
|
66
|
+
text: String(renderer.prop("description", ""))
|
|
67
|
+
textFormat: Text.PlainText
|
|
68
|
+
color: renderer.prop("muted", Color.muted)
|
|
69
|
+
font.family: String(renderer.prop("font_family", renderer.fontFamily))
|
|
70
|
+
font.pixelSize: Number(renderer.prop("description_size", Style.font.caption))
|
|
71
|
+
elide: Text.ElideRight
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
indicator: Rectangle {
|
|
76
|
+
x: switchRoot.width - switchRoot.rightPadding + Number(renderer.prop("spacing", Style.spacing.md))
|
|
77
|
+
y: (switchRoot.height - height) / 2
|
|
78
|
+
width: switchRoot.indicatorWidth
|
|
79
|
+
height: switchRoot.indicatorHeight
|
|
80
|
+
radius: height / 2
|
|
81
|
+
color: switchRoot.checked
|
|
82
|
+
? renderer.prop("checked_track_color", renderer.prop("accent", Color.accent))
|
|
83
|
+
: renderer.prop("track_color", Qt.rgba(renderer.foreground.r,
|
|
84
|
+
renderer.foreground.g, renderer.foreground.b, 0.24))
|
|
85
|
+
border.width: Style.normalBorderWidth
|
|
86
|
+
border.color: switchRoot.checked
|
|
87
|
+
? renderer.prop("checked_track_color", renderer.prop("accent", Color.accent))
|
|
88
|
+
: renderer.prop("track_color", renderer.foreground)
|
|
89
|
+
|
|
90
|
+
Behavior on color {
|
|
91
|
+
enabled: renderer.prop("animated", true) !== false
|
|
92
|
+
ColorAnimation { duration: Number(renderer.prop("duration", 140)) }
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
Rectangle {
|
|
96
|
+
id: switchThumb
|
|
97
|
+
readonly property real thumbSize: Math.min(parent.height - 4,
|
|
98
|
+
Number(renderer.prop("thumb_size", parent.height - 4)))
|
|
99
|
+
x: switchRoot.checked ? parent.width - width - 2 : 2
|
|
100
|
+
y: (parent.height - height) / 2
|
|
101
|
+
width: thumbSize
|
|
102
|
+
height: thumbSize
|
|
103
|
+
radius: width / 2
|
|
104
|
+
color: switchRoot.checked
|
|
105
|
+
? renderer.prop("checked_thumb_color", Color.background)
|
|
106
|
+
: renderer.prop("thumb_color", renderer.foreground)
|
|
107
|
+
|
|
108
|
+
Behavior on x {
|
|
109
|
+
enabled: renderer.prop("animated", true) !== false
|
|
110
|
+
NumberAnimation {
|
|
111
|
+
duration: Number(renderer.prop("duration", 140))
|
|
112
|
+
easing.type: Easing.OutCubic
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
Behavior on color {
|
|
116
|
+
enabled: renderer.prop("animated", true) !== false
|
|
117
|
+
ColorAnimation { duration: Number(renderer.prop("duration", 140)) }
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
onClicked: {
|
|
123
|
+
var payload = eventPayload()
|
|
124
|
+
renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "click", payload)
|
|
125
|
+
renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "activate", payload)
|
|
126
|
+
}
|
|
127
|
+
onToggled: {
|
|
128
|
+
var payload = eventPayload()
|
|
129
|
+
renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "toggle", payload)
|
|
130
|
+
renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "change", payload)
|
|
131
|
+
}
|
|
132
|
+
onPressed: renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "press", eventPayload())
|
|
133
|
+
onReleased: renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "release", eventPayload())
|
|
134
|
+
onHoveredChanged: renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId,
|
|
135
|
+
"hover", { value: hovered })
|
|
136
|
+
onActiveFocusChanged: renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId,
|
|
137
|
+
activeFocus ? "focus" : "blur", {})
|
|
138
|
+
onVisibleChanged: renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId,
|
|
139
|
+
visible ? "show" : "hide", {})
|
|
140
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import QtQuick
|
|
2
|
+
import QtQuick.Controls as QQC
|
|
3
|
+
import "../../Theme"
|
|
4
|
+
|
|
5
|
+
QQC.TabBar {
|
|
6
|
+
id: barRoot
|
|
7
|
+
|
|
8
|
+
required property var renderer
|
|
9
|
+
readonly property var tabItems: renderer.prop("items", [])
|
|
10
|
+
readonly property int requestedIndex: Number(renderer.prop("current_index", 0))
|
|
11
|
+
property bool synchronizing: false
|
|
12
|
+
|
|
13
|
+
function itemAt(index) {
|
|
14
|
+
return Array.isArray(tabItems) && index < tabItems.length ? tabItems[index] : null
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function itemValue(index, name, fallback) {
|
|
18
|
+
var item = itemAt(index)
|
|
19
|
+
return item !== null && typeof item === "object" && item[name] !== undefined
|
|
20
|
+
? item[name] : fallback
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function itemLabel(index) {
|
|
24
|
+
var item = itemAt(index)
|
|
25
|
+
return item !== null && typeof item === "object"
|
|
26
|
+
? String(item.label === undefined ? (item.text === undefined ? "" : item.text) : item.label)
|
|
27
|
+
: String(item === null ? "" : item)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function boundedIndex(value) {
|
|
31
|
+
return count === 0 ? -1 : Math.max(0, Math.min(count - 1, Number(value)))
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function syncSelection() {
|
|
35
|
+
var next = boundedIndex(requestedIndex)
|
|
36
|
+
if (currentIndex === next) return
|
|
37
|
+
synchronizing = true
|
|
38
|
+
currentIndex = next
|
|
39
|
+
synchronizing = false
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
implicitWidth: Number(renderer.prop("width", 480))
|
|
43
|
+
implicitHeight: Number(renderer.prop("height", 44))
|
|
44
|
+
enabled: renderer.prop("enabled", true) !== false
|
|
45
|
+
visible: renderer.prop("visible", true) !== false
|
|
46
|
+
spacing: Number(renderer.prop("spacing", 0))
|
|
47
|
+
position: String(renderer.prop("position", "top")) === "bottom"
|
|
48
|
+
? QQC.TabBar.Footer : QQC.TabBar.Header
|
|
49
|
+
LayoutMirroring.enabled: String(renderer.prop("layout_direction", "left_to_right")) === "right_to_left"
|
|
50
|
+
LayoutMirroring.childrenInherit: true
|
|
51
|
+
|
|
52
|
+
background: Rectangle {
|
|
53
|
+
color: renderer.prop("background", Color.background)
|
|
54
|
+
radius: Number(renderer.prop("radius", 0))
|
|
55
|
+
border.width: String(renderer.prop("border_color", "")).length > 0 ? Style.normalBorderWidth : 0
|
|
56
|
+
border.color: renderer.prop("border_color", "transparent")
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
Repeater {
|
|
60
|
+
model: Array.isArray(barRoot.tabItems) ? barRoot.tabItems.length : 0
|
|
61
|
+
QQC.TabButton {
|
|
62
|
+
required property int index
|
|
63
|
+
width: Number(renderer.prop("tab_width", 0)) > 0
|
|
64
|
+
? Number(renderer.prop("tab_width", 0))
|
|
65
|
+
: Math.max(1, barRoot.width / Math.max(1, barRoot.count))
|
|
66
|
+
height: barRoot.height
|
|
67
|
+
text: barRoot.itemLabel(index)
|
|
68
|
+
enabled: barRoot.itemValue(index, "enabled", true) !== false
|
|
69
|
+
icon.name: String(barRoot.itemValue(index, "icon", ""))
|
|
70
|
+
icon.source: String(barRoot.itemValue(index, "icon_source", ""))
|
|
71
|
+
font.family: String(renderer.prop("font_family", renderer.fontFamily))
|
|
72
|
+
font.pixelSize: Number(renderer.prop("font_size", Style.font.body))
|
|
73
|
+
contentItem: Text {
|
|
74
|
+
text: parent.text
|
|
75
|
+
color: parent.checked ? renderer.prop("accent", Color.accent)
|
|
76
|
+
: (parent.enabled ? renderer.prop("foreground", renderer.foreground)
|
|
77
|
+
: renderer.prop("muted", Color.muted))
|
|
78
|
+
font: parent.font
|
|
79
|
+
horizontalAlignment: Text.AlignHCenter
|
|
80
|
+
verticalAlignment: Text.AlignVCenter
|
|
81
|
+
elide: Text.ElideRight
|
|
82
|
+
}
|
|
83
|
+
background: Rectangle {
|
|
84
|
+
property bool selected: parent.checked
|
|
85
|
+
color: "transparent"
|
|
86
|
+
Rectangle {
|
|
87
|
+
anchors.left: parent.left
|
|
88
|
+
anchors.right: parent.right
|
|
89
|
+
anchors.bottom: barRoot.position === QQC.TabBar.Header ? parent.bottom : undefined
|
|
90
|
+
anchors.top: barRoot.position === QQC.TabBar.Footer ? parent.top : undefined
|
|
91
|
+
height: parent.selected ? 2 : 0
|
|
92
|
+
color: renderer.prop("accent", Color.accent)
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
onClicked: {
|
|
96
|
+
if (renderer.subscribed("tab_click"))
|
|
97
|
+
renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId,
|
|
98
|
+
"tab_click", { value: index, label: text })
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
onRequestedIndexChanged: syncSelection()
|
|
104
|
+
onCountChanged: syncSelection()
|
|
105
|
+
Component.onCompleted: syncSelection()
|
|
106
|
+
onCurrentIndexChanged: {
|
|
107
|
+
if (synchronizing || currentIndex < 0) return
|
|
108
|
+
if (renderer.subscribed("input"))
|
|
109
|
+
renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "input", { value: currentIndex })
|
|
110
|
+
if (renderer.subscribed("change"))
|
|
111
|
+
renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "change", { value: currentIndex })
|
|
112
|
+
}
|
|
113
|
+
onVisibleChanged: renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId,
|
|
114
|
+
visible ? "show" : "hide", {})
|
|
115
|
+
onActiveFocusChanged: renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId,
|
|
116
|
+
activeFocus ? "focus" : "blur", {})
|
|
117
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import QtQuick
|
|
2
|
+
import QtQuick.Controls as QQC
|
|
3
|
+
import "../../Theme"
|
|
4
|
+
|
|
5
|
+
QQC.TabButton {
|
|
6
|
+
id: buttonRoot
|
|
7
|
+
|
|
8
|
+
required property var renderer
|
|
9
|
+
|
|
10
|
+
text: String(renderer.prop("text", ""))
|
|
11
|
+
checked: renderer.prop("checked", false) === true
|
|
12
|
+
enabled: renderer.prop("enabled", true) !== false
|
|
13
|
+
visible: renderer.prop("visible", true) !== false
|
|
14
|
+
autoExclusive: renderer.prop("auto_exclusive", true) !== false
|
|
15
|
+
hoverEnabled: renderer.subscribed("hover")
|
|
16
|
+
implicitWidth: Number(renderer.prop("width", 140))
|
|
17
|
+
implicitHeight: Number(renderer.prop("height", 44))
|
|
18
|
+
icon.name: String(renderer.prop("icon", ""))
|
|
19
|
+
icon.source: String(renderer.prop("icon_source", ""))
|
|
20
|
+
icon.color: renderer.prop("icon_color", renderer.prop("foreground", renderer.foreground))
|
|
21
|
+
icon.width: Number(renderer.prop("icon_width", Style.font.body))
|
|
22
|
+
icon.height: Number(renderer.prop("icon_height", Style.font.body))
|
|
23
|
+
font.family: String(renderer.prop("font_family", renderer.fontFamily))
|
|
24
|
+
font.pixelSize: Number(renderer.prop("font_size", Style.font.body))
|
|
25
|
+
|
|
26
|
+
contentItem: Row {
|
|
27
|
+
spacing: Style.spacing.sm
|
|
28
|
+
anchors.centerIn: parent
|
|
29
|
+
|
|
30
|
+
Image {
|
|
31
|
+
visible: source.toString().length > 0
|
|
32
|
+
source: String(renderer.prop("icon_source", ""))
|
|
33
|
+
width: Number(renderer.prop("icon_width", Style.font.body))
|
|
34
|
+
height: Number(renderer.prop("icon_height", Style.font.body))
|
|
35
|
+
fillMode: Image.PreserveAspectFit
|
|
36
|
+
onStatusChanged: {
|
|
37
|
+
if (status === Image.Error)
|
|
38
|
+
renderer.componentError("tab_button_icon_failed",
|
|
39
|
+
"Unable to load the declared tab button icon image", { source: String(source) })
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
Text {
|
|
44
|
+
visible: String(renderer.prop("icon", "")).length > 0
|
|
45
|
+
&& String(renderer.prop("icon_source", "")).length === 0
|
|
46
|
+
text: renderer.iconGlyph(renderer.prop("icon", ""))
|
|
47
|
+
color: renderer.prop("icon_color", renderer.prop("foreground", renderer.foreground))
|
|
48
|
+
font.family: renderer.fontFamily
|
|
49
|
+
font.pixelSize: Number(renderer.prop("icon_width", Style.font.body))
|
|
50
|
+
anchors.verticalCenter: parent.verticalCenter
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
Text {
|
|
54
|
+
text: buttonRoot.text
|
|
55
|
+
color: !buttonRoot.enabled ? renderer.prop("muted", Color.muted)
|
|
56
|
+
: (buttonRoot.checked ? renderer.prop("checked_foreground", renderer.prop("accent", Color.accent))
|
|
57
|
+
: renderer.prop("foreground", renderer.foreground))
|
|
58
|
+
font: buttonRoot.font
|
|
59
|
+
anchors.verticalCenter: parent.verticalCenter
|
|
60
|
+
elide: Text.ElideRight
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
background: Rectangle {
|
|
65
|
+
color: buttonRoot.checked
|
|
66
|
+
? renderer.prop("checked_background", renderer.prop("background", "transparent"))
|
|
67
|
+
: renderer.prop("background", "transparent")
|
|
68
|
+
radius: Number(renderer.prop("radius", 0))
|
|
69
|
+
border.width: Number(renderer.prop("border_width",
|
|
70
|
+
String(renderer.prop("border_color", "")).length > 0 ? Style.normalBorderWidth : 0))
|
|
71
|
+
border.color: renderer.prop("border_color", "transparent")
|
|
72
|
+
Rectangle {
|
|
73
|
+
anchors.left: parent.left
|
|
74
|
+
anchors.right: parent.right
|
|
75
|
+
anchors.bottom: parent.bottom
|
|
76
|
+
height: buttonRoot.checked ? 2 : 0
|
|
77
|
+
color: renderer.prop("accent", Color.accent)
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
Shortcut {
|
|
82
|
+
sequence: String(renderer.prop("shortcut", ""))
|
|
83
|
+
enabled: buttonRoot.enabled && sequence.toString().length > 0
|
|
84
|
+
onActivated: renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "click",
|
|
85
|
+
{ checked: buttonRoot.checked, text: buttonRoot.text, shortcut: true })
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
onClicked: renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "click",
|
|
89
|
+
{ checked: checked, text: text })
|
|
90
|
+
onToggled: {
|
|
91
|
+
var payload = { value: checked, checked: checked, text: text }
|
|
92
|
+
if (renderer.subscribed("toggle"))
|
|
93
|
+
renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "toggle", payload)
|
|
94
|
+
if (renderer.subscribed("change"))
|
|
95
|
+
renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "change", payload)
|
|
96
|
+
}
|
|
97
|
+
onPressed: renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "press", {})
|
|
98
|
+
onReleased: renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "release", {})
|
|
99
|
+
onHoveredChanged: {
|
|
100
|
+
if (renderer.subscribed("hover"))
|
|
101
|
+
renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "hover", { value: hovered })
|
|
102
|
+
}
|
|
103
|
+
onActiveFocusChanged: renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId,
|
|
104
|
+
activeFocus ? "focus" : "blur", {})
|
|
105
|
+
}
|