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,27 @@
|
|
|
1
|
+
import QtQuick
|
|
2
|
+
import "../Theme"
|
|
3
|
+
|
|
4
|
+
Item {
|
|
5
|
+
id: root
|
|
6
|
+
property string text: ""
|
|
7
|
+
property string tooltipText: ""
|
|
8
|
+
property bool active: false
|
|
9
|
+
property color foreground: Color.foreground
|
|
10
|
+
property color activeColor: Color.accent
|
|
11
|
+
property real slotSize: 30
|
|
12
|
+
property real opticalSize: 18
|
|
13
|
+
property string fontFamily: Style.font.family
|
|
14
|
+
property real fontSize: Style.font.icon
|
|
15
|
+
property real textRotation: 0
|
|
16
|
+
property bool keepSpace: false
|
|
17
|
+
property bool dimmed: false
|
|
18
|
+
property bool concealed: false
|
|
19
|
+
property bool interactive: true
|
|
20
|
+
signal pressed(int button)
|
|
21
|
+
signal wheelMoved(real delta)
|
|
22
|
+
implicitWidth: concealed && !keepSpace ? 0 : slotSize
|
|
23
|
+
implicitHeight: slotSize
|
|
24
|
+
opacity: concealed ? 0 : (dimmed ? 0.45 : 1)
|
|
25
|
+
Text { anchors.centerIn: parent; text: root.text; color: root.active ? root.activeColor : root.foreground; font.family: root.fontFamily; font.pixelSize: root.fontSize; rotation: root.textRotation }
|
|
26
|
+
MouseArea { anchors.fill: parent; enabled: root.interactive; acceptedButtons: Qt.AllButtons; onClicked: function(event) { root.pressed(event.button) }; onWheel: function(event) { root.wheelMoved(event.angleDelta.y) } }
|
|
27
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import QtQuick
|
|
2
|
+
import "../Theme"
|
|
3
|
+
|
|
4
|
+
Item {
|
|
5
|
+
id: root
|
|
6
|
+
property bool active: false
|
|
7
|
+
property string activeText: ""
|
|
8
|
+
property string inactiveText: ""
|
|
9
|
+
property string activeTooltipText: ""
|
|
10
|
+
property string inactiveTooltipText: ""
|
|
11
|
+
property string indicatorBlock: "single"
|
|
12
|
+
property color foreground: Color.foreground
|
|
13
|
+
property color activeColor: Color.accent
|
|
14
|
+
property string fontFamily: Style.font.family
|
|
15
|
+
property real fontSize: Style.font.caption
|
|
16
|
+
signal pressed(int button)
|
|
17
|
+
signal wheelMoved(real delta)
|
|
18
|
+
implicitWidth: label.implicitWidth
|
|
19
|
+
implicitHeight: Math.max(Style.spacing.controlHeight, label.implicitHeight)
|
|
20
|
+
Text { id: label; anchors.centerIn: parent; text: root.active ? root.activeText : root.inactiveText; color: root.active ? root.activeColor : root.foreground; font.family: root.fontFamily; font.pixelSize: root.fontSize }
|
|
21
|
+
MouseArea { anchors.fill: parent; acceptedButtons: Qt.AllButtons; onClicked: function(event) { root.pressed(event.button) }; onWheel: function(event) { root.wheelMoved(event.angleDelta.y) } }
|
|
22
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import QtQuick
|
|
2
|
+
import "../Theme"
|
|
3
|
+
|
|
4
|
+
Rectangle {
|
|
5
|
+
property var borderSpec: Border.none
|
|
6
|
+
color: "transparent"
|
|
7
|
+
radius: Style.cornerRadius
|
|
8
|
+
border.color: borderSpec && borderSpec.color !== undefined ? borderSpec.color : "transparent"
|
|
9
|
+
border.width: borderSpec && borderSpec.widths ? Number(borderSpec.widths.top || 0) : 0
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import QtQuick
|
|
2
|
+
import "../Theme"
|
|
3
|
+
|
|
4
|
+
Rectangle {
|
|
5
|
+
property var borderSpec: Border.none()
|
|
6
|
+
color: Color.popups.background
|
|
7
|
+
radius: Style.cornerRadius
|
|
8
|
+
border.color: borderSpec && borderSpec.color !== undefined ? borderSpec.color : "transparent"
|
|
9
|
+
border.width: borderSpec && borderSpec.widths ? Number(borderSpec.widths.top || 0) : 0
|
|
10
|
+
}
|
data/Controls/Button.qml
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import QtQuick
|
|
2
|
+
import "../Theme"
|
|
3
|
+
|
|
4
|
+
Item {
|
|
5
|
+
id: root
|
|
6
|
+
property string text: ""
|
|
7
|
+
property string iconText: ""
|
|
8
|
+
property string tooltipText: ""
|
|
9
|
+
property bool selected: false
|
|
10
|
+
property bool active: false
|
|
11
|
+
property bool hasCursor: false
|
|
12
|
+
property bool focusable: true
|
|
13
|
+
property bool bordered: true
|
|
14
|
+
property color foreground: Color.foreground
|
|
15
|
+
property color background: "transparent"
|
|
16
|
+
property color accent: Color.accent
|
|
17
|
+
property string fontFamily: Style.font.family
|
|
18
|
+
property real fontSize: Style.font.body
|
|
19
|
+
property real iconSize: Style.font.icon
|
|
20
|
+
property real iconRotation: 0
|
|
21
|
+
property bool iconSpinning: false
|
|
22
|
+
property real horizontalPadding: Style.spacing.controlPaddingX
|
|
23
|
+
property real verticalPadding: Style.spacing.controlPaddingY
|
|
24
|
+
property bool leftAlign: false
|
|
25
|
+
property color tooltipBackground: Color.tooltip.background
|
|
26
|
+
property color tooltipForeground: Color.tooltip.text
|
|
27
|
+
property color tooltipBorder: Color.tooltip.border
|
|
28
|
+
signal clicked()
|
|
29
|
+
signal rightClicked()
|
|
30
|
+
signal hovered(bool value)
|
|
31
|
+
|
|
32
|
+
activeFocusOnTab: focusable
|
|
33
|
+
implicitWidth: content.implicitWidth + horizontalPadding * 2
|
|
34
|
+
implicitHeight: Math.max(Style.spacing.controlHeight, content.implicitHeight + verticalPadding * 2)
|
|
35
|
+
|
|
36
|
+
Rectangle {
|
|
37
|
+
anchors.fill: parent
|
|
38
|
+
radius: Style.cornerRadius
|
|
39
|
+
color: root.selected || root.active ? root.accent : root.background
|
|
40
|
+
border.width: root.bordered ? Style.normalBorderWidth : 0
|
|
41
|
+
border.color: root.active || root.selected ? root.accent : Qt.rgba(root.foreground.r, root.foreground.g, root.foreground.b, 0.3)
|
|
42
|
+
opacity: mouse.pressed ? 0.78 : (mouse.containsMouse ? 0.9 : 1)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
Row {
|
|
46
|
+
id: content
|
|
47
|
+
anchors.verticalCenter: parent.verticalCenter
|
|
48
|
+
anchors.left: root.leftAlign ? parent.left : undefined
|
|
49
|
+
anchors.leftMargin: root.horizontalPadding
|
|
50
|
+
anchors.horizontalCenter: root.leftAlign ? undefined : parent.horizontalCenter
|
|
51
|
+
spacing: root.iconText !== "" && root.text !== "" ? Style.spacing.controlGap : 0
|
|
52
|
+
Text {
|
|
53
|
+
visible: root.iconText !== ""
|
|
54
|
+
text: root.iconText
|
|
55
|
+
color: root.selected || root.active ? Color.background : root.foreground
|
|
56
|
+
font.family: root.fontFamily
|
|
57
|
+
font.pixelSize: root.iconSize
|
|
58
|
+
rotation: root.iconRotation
|
|
59
|
+
}
|
|
60
|
+
Text {
|
|
61
|
+
visible: root.text !== ""
|
|
62
|
+
text: root.text
|
|
63
|
+
color: root.selected || root.active ? Color.background : root.foreground
|
|
64
|
+
font.family: root.fontFamily
|
|
65
|
+
font.pixelSize: root.fontSize
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
MouseArea {
|
|
70
|
+
id: mouse
|
|
71
|
+
anchors.fill: parent
|
|
72
|
+
hoverEnabled: true
|
|
73
|
+
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
|
74
|
+
cursorShape: root.hasCursor ? Qt.PointingHandCursor : Qt.ArrowCursor
|
|
75
|
+
onClicked: function(event) { event.button === Qt.RightButton ? root.rightClicked() : root.clicked() }
|
|
76
|
+
onContainsMouseChanged: root.hovered(containsMouse)
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import QtQuick
|
|
2
|
+
import "../Theme"
|
|
3
|
+
|
|
4
|
+
Row {
|
|
5
|
+
id: root
|
|
6
|
+
property string value: ""
|
|
7
|
+
property var options: []
|
|
8
|
+
property color foreground: Color.foreground
|
|
9
|
+
property color background: Color.background
|
|
10
|
+
property color accent: Color.accent
|
|
11
|
+
property string fontFamily: Style.font.family
|
|
12
|
+
property real fontSize: Style.font.body
|
|
13
|
+
property bool focusable: true
|
|
14
|
+
property int cursorIndex: -1
|
|
15
|
+
signal changed(string value)
|
|
16
|
+
signal hovered(int index, string value)
|
|
17
|
+
spacing: 2
|
|
18
|
+
Repeater { model: root.options; Button { required property var modelData; required property int index; text: String(modelData); selected: String(modelData) === root.value; foreground: root.foreground; background: root.background; accent: root.accent; fontFamily: root.fontFamily; fontSize: root.fontSize; onClicked: root.changed(String(modelData)); onHovered: function(value) { root.hovered(index, String(modelData)) } } }
|
|
19
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import QtQuick
|
|
2
|
+
import "../Theme"
|
|
3
|
+
|
|
4
|
+
Item {
|
|
5
|
+
id: root
|
|
6
|
+
property bool opened: false
|
|
7
|
+
property string message: ""
|
|
8
|
+
property string cancelText: "Cancel"
|
|
9
|
+
property string confirmText: "Confirm"
|
|
10
|
+
property int selectedIndex: 1
|
|
11
|
+
property color background: Color.background
|
|
12
|
+
property color foreground: Color.foreground
|
|
13
|
+
property color scrim: Qt.rgba(0, 0, 0, 0.7)
|
|
14
|
+
property color selectedBackground: Qt.rgba(1, 1, 1, 0.08)
|
|
15
|
+
property color selectedText: Color.accent
|
|
16
|
+
property string fontFamily: Style.font.family
|
|
17
|
+
property real cornerRadius: Style.cornerRadius
|
|
18
|
+
signal canceled()
|
|
19
|
+
signal confirmed()
|
|
20
|
+
implicitWidth: 420
|
|
21
|
+
implicitHeight: panel.implicitHeight
|
|
22
|
+
visible: opened
|
|
23
|
+
Rectangle { id: panel; anchors.fill: parent; implicitHeight: content.implicitHeight + Style.spacing.xl * 2; color: root.background; radius: root.cornerRadius; border.color: Color.popups.border }
|
|
24
|
+
Column {
|
|
25
|
+
id: content
|
|
26
|
+
anchors.fill: parent
|
|
27
|
+
anchors.margins: Style.spacing.xl
|
|
28
|
+
spacing: Style.spacing.lg
|
|
29
|
+
Text { width: parent.width; text: root.message; color: root.foreground; font.family: root.fontFamily; wrapMode: Text.WordWrap }
|
|
30
|
+
Row {
|
|
31
|
+
anchors.right: parent.right
|
|
32
|
+
spacing: Style.spacing.sm
|
|
33
|
+
Button { text: root.cancelText; onClicked: root.canceled() }
|
|
34
|
+
Button { text: root.confirmText; active: true; onClicked: root.confirmed() }
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import QtQuick
|
|
2
|
+
import "../Theme"
|
|
3
|
+
|
|
4
|
+
BorderSurface {
|
|
5
|
+
id: root
|
|
6
|
+
|
|
7
|
+
property bool hasCursor: false
|
|
8
|
+
property bool current: false
|
|
9
|
+
property bool outline: false
|
|
10
|
+
property bool bordered: false
|
|
11
|
+
property color foreground: Color.foreground
|
|
12
|
+
property color accent: Color.accent
|
|
13
|
+
property color fill: Style.hoverFillFor(foreground, accent)
|
|
14
|
+
property color currentFill: Style.selectedFillFor(foreground, accent)
|
|
15
|
+
|
|
16
|
+
color: hasCursor ? fill : (current ? currentFill : "transparent")
|
|
17
|
+
radius: Style.cornerRadius
|
|
18
|
+
borderSpec: hasCursor
|
|
19
|
+
? Border.controlSpec("hover-cursor", foreground, accent)
|
|
20
|
+
: (current
|
|
21
|
+
? Border.controlSpec("selected", foreground, accent)
|
|
22
|
+
: (bordered
|
|
23
|
+
? Border.controlSpec("normal", foreground, accent)
|
|
24
|
+
: Border.none()))
|
|
25
|
+
|
|
26
|
+
Behavior on color {
|
|
27
|
+
ColorAnimation { duration: 60 }
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import QtQuick
|
|
2
|
+
import QtQuick.Controls as QQC
|
|
3
|
+
import "../Theme"
|
|
4
|
+
|
|
5
|
+
Column {
|
|
6
|
+
id: root
|
|
7
|
+
|
|
8
|
+
property string label: ""
|
|
9
|
+
property string value: ""
|
|
10
|
+
property var options: []
|
|
11
|
+
property color foreground: Color.foreground
|
|
12
|
+
property color background: Color.popups.background
|
|
13
|
+
property color popupBorder: Color.popups.border
|
|
14
|
+
property color accent: Color.accent
|
|
15
|
+
property string fontFamily: Style.font.family
|
|
16
|
+
property real rowHeight: Style.spacing.controlHeight
|
|
17
|
+
property real popupRowHeight: Style.spacing.popupRowHeight
|
|
18
|
+
property bool showLabel: true
|
|
19
|
+
property bool hasCursor: false
|
|
20
|
+
|
|
21
|
+
signal changed(string value)
|
|
22
|
+
signal optionHovered(var value)
|
|
23
|
+
|
|
24
|
+
spacing: Style.spacing.xs
|
|
25
|
+
|
|
26
|
+
Text {
|
|
27
|
+
visible: root.showLabel && root.label !== ""
|
|
28
|
+
text: root.label
|
|
29
|
+
color: root.foreground
|
|
30
|
+
font.family: root.fontFamily
|
|
31
|
+
font.pixelSize: Style.font.caption
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
QQC.ComboBox {
|
|
35
|
+
id: combo
|
|
36
|
+
|
|
37
|
+
width: root.width
|
|
38
|
+
height: root.rowHeight
|
|
39
|
+
model: root.options
|
|
40
|
+
currentIndex: Math.max(0, root.options.indexOf(root.value))
|
|
41
|
+
hoverEnabled: true
|
|
42
|
+
onActivated: root.changed(String(currentText))
|
|
43
|
+
onHoveredChanged: root.optionHovered(hovered)
|
|
44
|
+
|
|
45
|
+
contentItem: Text {
|
|
46
|
+
text: combo.displayText
|
|
47
|
+
color: root.foreground
|
|
48
|
+
font.family: root.fontFamily
|
|
49
|
+
verticalAlignment: Text.AlignVCenter
|
|
50
|
+
leftPadding: Style.spacing.controlPaddingX
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
background: Rectangle {
|
|
54
|
+
color: root.background
|
|
55
|
+
radius: Style.cornerRadius
|
|
56
|
+
border.color: combo.activeFocus ? root.accent : root.popupBorder
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import QtQuick
|
|
2
|
+
import QtQuick.Controls as QQC
|
|
3
|
+
import "../Theme"
|
|
4
|
+
|
|
5
|
+
Column {
|
|
6
|
+
id: root
|
|
7
|
+
property string label: ""
|
|
8
|
+
property var values: []
|
|
9
|
+
property var options: []
|
|
10
|
+
property string placeholderText: "Search..."
|
|
11
|
+
property var optionsCommand: []
|
|
12
|
+
property string optionsCommandCwd: ""
|
|
13
|
+
property string emptyText: "No options"
|
|
14
|
+
property string noSelectionText: "None selected"
|
|
15
|
+
property string triggerLabel: ""
|
|
16
|
+
property bool showLabel: true
|
|
17
|
+
property color foreground: Color.foreground
|
|
18
|
+
property color background: Color.popups.background
|
|
19
|
+
property color popupBorder: Color.popups.border
|
|
20
|
+
property color accent: Color.accent
|
|
21
|
+
property string fontFamily: Style.font.family
|
|
22
|
+
property real rowHeight: Style.spacing.controlHeight
|
|
23
|
+
property real popupRowHeight: Style.spacing.popupRowHeight
|
|
24
|
+
property real popupMinHeight: Style.spacing.searchablePopupMinHeight
|
|
25
|
+
property bool hasCursor: false
|
|
26
|
+
signal changed(var values)
|
|
27
|
+
signal optionHovered(var value)
|
|
28
|
+
spacing: Style.spacing.xs
|
|
29
|
+
Text { visible: root.showLabel && root.label !== ""; text: root.label; color: root.foreground; font.family: root.fontFamily; font.pixelSize: Style.font.caption }
|
|
30
|
+
QQC.Button { hoverEnabled: true; text: root.triggerLabel !== "" ? root.triggerLabel : (root.values.length > 0 ? root.values.join(", ") : root.noSelectionText); onClicked: menu.open(); onHoveredChanged: root.optionHovered(hovered); background: Rectangle { color: root.background; radius: Style.cornerRadius; border.color: root.popupBorder } }
|
|
31
|
+
QQC.Menu { id: menu; Repeater { model: root.options; QQC.MenuItem { required property var modelData; text: String(modelData); checkable: true; checked: root.values.indexOf(String(modelData)) >= 0; onTriggered: { var next = root.values.slice(); var index = next.indexOf(String(modelData)); index >= 0 ? next.splice(index, 1) : next.push(String(modelData)); root.changed(next) } } } }
|
|
32
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import QtQuick
|
|
2
|
+
import QtQuick.Controls as QQC
|
|
3
|
+
import "../Theme"
|
|
4
|
+
|
|
5
|
+
Item {
|
|
6
|
+
id: root
|
|
7
|
+
property string label: ""
|
|
8
|
+
property real value: 0
|
|
9
|
+
property real from: 0
|
|
10
|
+
property real to: 100
|
|
11
|
+
property real stepSize: 1
|
|
12
|
+
property color foreground: Color.foreground
|
|
13
|
+
property color accent: Color.accent
|
|
14
|
+
property string fontFamily: Style.font.family
|
|
15
|
+
property real fontSize: Style.font.body
|
|
16
|
+
property real fieldWidth: 108
|
|
17
|
+
property bool hasCursor: false
|
|
18
|
+
signal modified(real value)
|
|
19
|
+
signal hovered(bool value)
|
|
20
|
+
implicitWidth: labelText.implicitWidth + fieldWidth + Style.spacing.controlGap
|
|
21
|
+
implicitHeight: spin.implicitHeight
|
|
22
|
+
Row { spacing: Style.spacing.controlGap; Text { id: labelText; anchors.verticalCenter: parent.verticalCenter; text: root.label; color: root.foreground; font.family: root.fontFamily; font.pixelSize: root.fontSize } QQC.SpinBox { id: spin; width: root.fieldWidth; from: Math.round(root.from / root.stepSize); to: Math.round(root.to / root.stepSize); value: Math.round(root.value / root.stepSize); editable: true; onValueModified: root.modified(value * root.stepSize) } }
|
|
23
|
+
HoverHandler { onHoveredChanged: root.hovered(hovered) }
|
|
24
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import QtQuick
|
|
2
|
+
import "../Theme"
|
|
3
|
+
|
|
4
|
+
Item {
|
|
5
|
+
property alias text: glyph.text
|
|
6
|
+
property alias color: glyph.color
|
|
7
|
+
property alias fontFamily: glyph.font.family
|
|
8
|
+
property alias fontSize: glyph.font.pixelSize
|
|
9
|
+
property bool debugBounds: false
|
|
10
|
+
implicitWidth: glyph.implicitWidth
|
|
11
|
+
implicitHeight: glyph.implicitHeight
|
|
12
|
+
Rectangle { anchors.fill: parent; visible: parent.debugBounds; color: "transparent"; border.color: Color.accent }
|
|
13
|
+
Text { id: glyph; anchors.centerIn: parent; color: Color.foreground; font.family: Style.font.family; font.pixelSize: Style.font.icon }
|
|
14
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import QtQuick
|
|
2
|
+
import "../Theme"
|
|
3
|
+
|
|
4
|
+
Column {
|
|
5
|
+
id: root
|
|
6
|
+
property string title: ""
|
|
7
|
+
property string meta: ""
|
|
8
|
+
property string detail: ""
|
|
9
|
+
property real iconSize: Style.font.display
|
|
10
|
+
property real iconOpacity: 1
|
|
11
|
+
property real metaOpacity: 1
|
|
12
|
+
property color foreground: Color.foreground
|
|
13
|
+
property string fontFamily: Style.font.family
|
|
14
|
+
spacing: Style.spacing.xs
|
|
15
|
+
Text { text: root.title; color: root.foreground; font.family: root.fontFamily; font.pixelSize: Style.font.heading; font.bold: true }
|
|
16
|
+
Text { text: root.meta; color: root.foreground; opacity: root.metaOpacity; font.family: root.fontFamily; font.pixelSize: Style.font.caption }
|
|
17
|
+
Text { text: root.detail; color: root.foreground; opacity: 0.72; font.family: root.fontFamily; font.pixelSize: Style.font.body; wrapMode: Text.WordWrap }
|
|
18
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import QtQuick
|
|
2
|
+
|
|
3
|
+
FocusScope {
|
|
4
|
+
id: root
|
|
5
|
+
property bool blocked: false
|
|
6
|
+
signal closeRequested()
|
|
7
|
+
signal deleteRequested()
|
|
8
|
+
signal returnRequested()
|
|
9
|
+
signal tabRequested(bool reverse)
|
|
10
|
+
signal moveRequested(int dx, int dy)
|
|
11
|
+
signal activateRequested()
|
|
12
|
+
signal textKey(string text)
|
|
13
|
+
focus: true
|
|
14
|
+
Keys.onEscapePressed: if (!blocked) closeRequested()
|
|
15
|
+
Keys.onDeletePressed: if (!blocked) deleteRequested()
|
|
16
|
+
Keys.onReturnPressed: if (!blocked) returnRequested()
|
|
17
|
+
Keys.onTabPressed: if (!blocked) tabRequested(false)
|
|
18
|
+
Keys.onBacktabPressed: if (!blocked) tabRequested(true)
|
|
19
|
+
Keys.onLeftPressed: if (!blocked) moveRequested(-1, 0)
|
|
20
|
+
Keys.onRightPressed: if (!blocked) moveRequested(1, 0)
|
|
21
|
+
Keys.onUpPressed: if (!blocked) moveRequested(0, -1)
|
|
22
|
+
Keys.onDownPressed: if (!blocked) moveRequested(0, 1)
|
|
23
|
+
Keys.onSpacePressed: if (!blocked) activateRequested()
|
|
24
|
+
Keys.onPressed: function(event) { if (!blocked && event.text !== "") root.textKey(event.text) }
|
|
25
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import QtQuick
|
|
2
|
+
import QtQuick.Controls as QQC
|
|
3
|
+
import "../Theme"
|
|
4
|
+
|
|
5
|
+
Item {
|
|
6
|
+
id: root
|
|
7
|
+
property real value: 0
|
|
8
|
+
property real minimum: 0
|
|
9
|
+
property real maximum: 1
|
|
10
|
+
property real step: 0.05
|
|
11
|
+
property bool integer: false
|
|
12
|
+
property int tickCount: 0
|
|
13
|
+
property color trackColor: "#33414a"
|
|
14
|
+
property color fillColor: Color.accent
|
|
15
|
+
property color knobColor: Color.foreground
|
|
16
|
+
property real trackHeight: 4
|
|
17
|
+
property real knobSize: 16
|
|
18
|
+
property color tickColor: Color.background
|
|
19
|
+
signal released(real value)
|
|
20
|
+
signal moved(real value)
|
|
21
|
+
signal rightClicked()
|
|
22
|
+
implicitHeight: Math.max(knobSize, Style.spacing.controlHeight)
|
|
23
|
+
QQC.Slider {
|
|
24
|
+
id: slider
|
|
25
|
+
anchors.fill: parent
|
|
26
|
+
from: root.minimum
|
|
27
|
+
to: root.maximum
|
|
28
|
+
stepSize: root.step
|
|
29
|
+
value: root.value
|
|
30
|
+
onMoved: root.moved(root.integer ? Math.round(value) : value)
|
|
31
|
+
onPressedChanged: if (!pressed) root.released(root.integer ? Math.round(value) : value)
|
|
32
|
+
background: Rectangle { x: slider.leftPadding; y: slider.topPadding + slider.availableHeight / 2 - height / 2; width: slider.availableWidth; height: root.trackHeight; radius: height / 2; color: root.trackColor; Rectangle { width: slider.visualPosition * parent.width; height: parent.height; radius: parent.radius; color: root.fillColor } }
|
|
33
|
+
handle: Rectangle { x: slider.leftPadding + slider.visualPosition * (slider.availableWidth - width); y: slider.topPadding + slider.availableHeight / 2 - height / 2; width: root.knobSize; height: root.knobSize; radius: width / 2; color: root.knobColor }
|
|
34
|
+
}
|
|
35
|
+
TapHandler { acceptedButtons: Qt.RightButton; onTapped: root.rightClicked() }
|
|
36
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import QtQuick
|
|
2
|
+
import QtQuick.Controls as QQC
|
|
3
|
+
import "../Theme"
|
|
4
|
+
|
|
5
|
+
QQC.ToolTip {
|
|
6
|
+
property color panelForeground: Color.tooltip.text
|
|
7
|
+
property color panelBackground: Color.tooltip.background
|
|
8
|
+
property color panelBorder: Color.tooltip.border
|
|
9
|
+
property string fontFamily: Style.font.family
|
|
10
|
+
property real fontSize: Style.font.bodySmall
|
|
11
|
+
contentItem: Text { text: parent.text; color: parent.panelForeground; font.family: parent.fontFamily; font.pixelSize: parent.fontSize }
|
|
12
|
+
background: Rectangle { color: parent.panelBackground; radius: Style.cornerRadius; border.color: parent.panelBorder }
|
|
13
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import QtQuick
|
|
2
|
+
import "../Theme"
|
|
3
|
+
|
|
4
|
+
Dropdown {
|
|
5
|
+
property string placeholderText: "Search..."
|
|
6
|
+
property string emptyText: "No matches"
|
|
7
|
+
property string triggerLabel: ""
|
|
8
|
+
property color popupBorder: Color.popups.border
|
|
9
|
+
property real popupRowHeight: Style.spacing.popupRowHeight
|
|
10
|
+
property real popupMinHeight: Style.spacing.searchablePopupMinHeight
|
|
11
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import QtQuick
|
|
2
|
+
import QtQuick.Controls as QQC
|
|
3
|
+
import "../Theme"
|
|
4
|
+
|
|
5
|
+
QQC.TextField {
|
|
6
|
+
id: root
|
|
7
|
+
property bool password: false
|
|
8
|
+
property color foreground: Color.foreground
|
|
9
|
+
property color accent: Color.accent
|
|
10
|
+
property color selectionTint: Style.selectionFillFor(foreground, accent)
|
|
11
|
+
property real horizontalPadding: Style.spacing.controlPaddingX
|
|
12
|
+
property real verticalPadding: Style.spacing.inputPaddingY
|
|
13
|
+
property bool hasCursor: false
|
|
14
|
+
color: foreground
|
|
15
|
+
selectionColor: selectionTint
|
|
16
|
+
selectedTextColor: foreground
|
|
17
|
+
echoMode: password ? TextInput.Password : TextInput.Normal
|
|
18
|
+
leftPadding: horizontalPadding
|
|
19
|
+
rightPadding: horizontalPadding
|
|
20
|
+
topPadding: verticalPadding
|
|
21
|
+
bottomPadding: verticalPadding
|
|
22
|
+
font.family: Style.font.family
|
|
23
|
+
font.pixelSize: Style.font.body
|
|
24
|
+
background: Rectangle { color: Color.popups.background; radius: Style.cornerRadius; border.color: root.activeFocus ? root.accent : Color.popups.border; border.width: 1 }
|
|
25
|
+
}
|
data/Controls/Toggle.qml
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import QtQuick
|
|
2
|
+
import "../Theme"
|
|
3
|
+
|
|
4
|
+
Item {
|
|
5
|
+
id: root
|
|
6
|
+
property string label: ""
|
|
7
|
+
property string description: ""
|
|
8
|
+
property bool checked: false
|
|
9
|
+
property bool hasCursor: false
|
|
10
|
+
property bool rounded: true
|
|
11
|
+
property color foreground: Color.foreground
|
|
12
|
+
property color accent: Color.accent
|
|
13
|
+
property string fontFamily: Style.font.family
|
|
14
|
+
property real titleSize: Style.font.subtitle
|
|
15
|
+
property real descriptionSize: Style.font.caption
|
|
16
|
+
signal clicked()
|
|
17
|
+
signal hovered(bool value)
|
|
18
|
+
implicitWidth: content.implicitWidth
|
|
19
|
+
implicitHeight: Math.max(toggle.implicitHeight, labels.implicitHeight)
|
|
20
|
+
Row { id: content; spacing: Style.spacing.controlGap; ToggleSwitch { id: toggle; checked: root.checked; accent: root.accent; foreground: root.foreground; interactive: false } Column { id: labels; Text { text: root.label; color: root.foreground; font.family: root.fontFamily; font.pixelSize: root.titleSize } Text { text: root.description; visible: text !== ""; color: root.foreground; opacity: 0.65; font.family: root.fontFamily; font.pixelSize: root.descriptionSize } } }
|
|
21
|
+
MouseArea { anchors.fill: parent; hoverEnabled: true; cursorShape: root.hasCursor ? Qt.PointingHandCursor : Qt.ArrowCursor; onClicked: root.clicked(); onContainsMouseChanged: root.hovered(containsMouse) }
|
|
22
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import QtQuick
|
|
2
|
+
import "../Theme"
|
|
3
|
+
|
|
4
|
+
Item {
|
|
5
|
+
id: root
|
|
6
|
+
property bool checked: false
|
|
7
|
+
property bool busy: false
|
|
8
|
+
property bool interactive: true
|
|
9
|
+
property bool hasCursor: false
|
|
10
|
+
property bool cursorRing: true
|
|
11
|
+
property real cursorPad: 6
|
|
12
|
+
property bool rounded: true
|
|
13
|
+
property color foreground: Color.foreground
|
|
14
|
+
property color accent: Color.accent
|
|
15
|
+
property real trackHeight: 24
|
|
16
|
+
property real trackWidth: 46
|
|
17
|
+
property real knobSize: 18
|
|
18
|
+
property real knobInset: 3
|
|
19
|
+
signal toggled()
|
|
20
|
+
signal hovered(bool value)
|
|
21
|
+
implicitWidth: trackWidth
|
|
22
|
+
implicitHeight: trackHeight
|
|
23
|
+
Rectangle { anchors.fill: parent; radius: root.rounded ? height / 2 : 2; color: root.checked ? root.accent : Color.muted; opacity: root.busy ? 0.55 : 1 }
|
|
24
|
+
Rectangle { width: root.knobSize; height: root.knobSize; radius: root.rounded ? width / 2 : 2; color: root.foreground; y: root.knobInset; x: root.checked ? root.trackWidth - width - root.knobInset : root.knobInset; Behavior on x { NumberAnimation { duration: 140 } } }
|
|
25
|
+
MouseArea { anchors.fill: parent; enabled: root.interactive && !root.busy; hoverEnabled: true; cursorShape: root.hasCursor ? Qt.PointingHandCursor : Qt.ArrowCursor; onClicked: root.toggled(); onContainsMouseChanged: root.hovered(containsMouse) }
|
|
26
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import QtQuick
|
|
2
|
+
import "../Theme"
|
|
3
|
+
|
|
4
|
+
Item {
|
|
5
|
+
id: root
|
|
6
|
+
property string text: ""
|
|
7
|
+
property string tooltipText: ""
|
|
8
|
+
property bool active: false
|
|
9
|
+
property bool dimmed: false
|
|
10
|
+
property bool concealed: false
|
|
11
|
+
property bool interactive: true
|
|
12
|
+
property bool pressable: true
|
|
13
|
+
property string fontFamily: Style.font.family
|
|
14
|
+
property real fontSize: Style.font.body
|
|
15
|
+
property color foreground: Color.foreground
|
|
16
|
+
property color activeColor: Color.accent
|
|
17
|
+
property real horizontalMargin: 8.5
|
|
18
|
+
property real verticalPadding: 6
|
|
19
|
+
property real fixedWidth: -1
|
|
20
|
+
property real fixedHeight: -1
|
|
21
|
+
property real textRotation: 0
|
|
22
|
+
property bool keepSpace: false
|
|
23
|
+
property bool useActiveColor: true
|
|
24
|
+
property bool maintainIndicatorReveal: false
|
|
25
|
+
property bool labelVisible: true
|
|
26
|
+
property bool hasVisualContent: text !== ""
|
|
27
|
+
signal pressed(int button)
|
|
28
|
+
signal wheelMoved(real delta)
|
|
29
|
+
implicitWidth: fixedWidth >= 0 ? fixedWidth : label.implicitWidth + horizontalMargin * 2
|
|
30
|
+
implicitHeight: fixedHeight >= 0 ? fixedHeight : label.implicitHeight + verticalPadding * 2
|
|
31
|
+
opacity: concealed ? 0 : (dimmed ? 0.45 : 1)
|
|
32
|
+
visible: !concealed || keepSpace
|
|
33
|
+
Text { id: label; anchors.centerIn: parent; visible: root.labelVisible; text: root.text; color: root.active && root.useActiveColor ? root.activeColor : root.foreground; font.family: root.fontFamily; font.pixelSize: root.fontSize; rotation: root.textRotation }
|
|
34
|
+
MouseArea { anchors.fill: parent; enabled: root.interactive && root.pressable; acceptedButtons: Qt.AllButtons; onClicked: function(event) { root.pressed(event.button) }; onWheel: function(event) { root.wheelMoved(event.angleDelta.y) } }
|
|
35
|
+
}
|
data/Controls/qmldir
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
module Zui.Controls
|
|
2
|
+
PanelActionButton 1.0 PanelActionButton.qml
|
|
3
|
+
BarIconButton 1.0 BarIconButton.qml
|
|
4
|
+
BarIndicator 1.0 BarIndicator.qml
|
|
5
|
+
BorderOverlay 1.0 BorderOverlay.qml
|
|
6
|
+
BorderSurface 1.0 BorderSurface.qml
|
|
7
|
+
Button 1.0 Button.qml
|
|
8
|
+
ButtonGroup 1.0 ButtonGroup.qml
|
|
9
|
+
ConfirmDialog 1.0 ConfirmDialog.qml
|
|
10
|
+
CursorSurface 1.0 CursorSurface.qml
|
|
11
|
+
Dropdown 1.0 Dropdown.qml
|
|
12
|
+
MultiSelect 1.0 MultiSelect.qml
|
|
13
|
+
NumberField 1.0 NumberField.qml
|
|
14
|
+
OpticalGlyph 1.0 OpticalGlyph.qml
|
|
15
|
+
PanelHero 1.0 PanelHero.qml
|
|
16
|
+
PanelKeyCatcher 1.0 PanelKeyCatcher.qml
|
|
17
|
+
PanelSectionHeader 1.0 PanelSectionHeader.qml
|
|
18
|
+
PanelSeparator 1.0 PanelSeparator.qml
|
|
19
|
+
PanelSlider 1.0 PanelSlider.qml
|
|
20
|
+
PanelToolTip 1.0 PanelToolTip.qml
|
|
21
|
+
SearchableDropdown 1.0 SearchableDropdown.qml
|
|
22
|
+
TextField 1.0 TextField.qml
|
|
23
|
+
Toggle 1.0 Toggle.qml
|
|
24
|
+
ToggleSwitch 1.0 ToggleSwitch.qml
|
|
25
|
+
WidgetButton 1.0 WidgetButton.qml
|