replicator-workshop 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. replicator/__init__.py +6 -0
  2. replicator/app.py +204 -0
  3. replicator/config.py +48 -0
  4. replicator/core/__init__.py +0 -0
  5. replicator/core/assembly.py +117 -0
  6. replicator/core/blender_link.py +161 -0
  7. replicator/core/critique.py +594 -0
  8. replicator/core/drawing.py +389 -0
  9. replicator/core/dxf.py +120 -0
  10. replicator/core/evaluate.py +439 -0
  11. replicator/core/explain.py +139 -0
  12. replicator/core/export.py +96 -0
  13. replicator/core/fit.py +170 -0
  14. replicator/core/importers.py +185 -0
  15. replicator/core/materials.py +104 -0
  16. replicator/core/ops_advanced.py +496 -0
  17. replicator/core/ops_engineering.py +223 -0
  18. replicator/core/physics.py +147 -0
  19. replicator/core/printers.py +100 -0
  20. replicator/core/program.py +298 -0
  21. replicator/core/render.py +145 -0
  22. replicator/core/reverse.py +350 -0
  23. replicator/core/robot.py +153 -0
  24. replicator/core/step.py +245 -0
  25. replicator/fixtures/gaming_pc_liquid.json +2259 -0
  26. replicator/fixtures/gas_generator_rocket.json +876 -0
  27. replicator/fixtures/gas_generator_rocket_aero.json +861 -0
  28. replicator/fixtures/house_two_bed.json +979 -0
  29. replicator/fixtures/quadcopter_drone.json +687 -0
  30. replicator/fixtures/raspberry_pi_5.json +884 -0
  31. replicator/fixtures/rocket_engine.json +652 -0
  32. replicator/fixtures/turbofan.json +931 -0
  33. replicator/fixtures/vector_engine.json +314 -0
  34. replicator/gpu.py +81 -0
  35. replicator/image3d/__init__.py +0 -0
  36. replicator/image3d/comfy.py +181 -0
  37. replicator/image3d/pipeline.py +208 -0
  38. replicator/image3d/sheet.py +154 -0
  39. replicator/knowledge/__init__.py +61 -0
  40. replicator/knowledge/car_wheel_corner.md +21 -0
  41. replicator/knowledge/desk_lamp.md +21 -0
  42. replicator/knowledge/desktop_pc.md +20 -0
  43. replicator/knowledge/electronics_board.md +21 -0
  44. replicator/knowledge/exoskeleton.md +21 -0
  45. replicator/knowledge/house.md +22 -0
  46. replicator/knowledge/light_aircraft.md +22 -0
  47. replicator/knowledge/multirotor_drone.md +25 -0
  48. replicator/knowledge/print_replica.md +13 -0
  49. replicator/knowledge/rocket_engine.md +27 -0
  50. replicator/knowledge/turbofan.md +23 -0
  51. replicator/llm/__init__.py +0 -0
  52. replicator/llm/client.py +424 -0
  53. replicator/llm/prompts/blueprint.md +28 -0
  54. replicator/llm/prompts/edit.md +15 -0
  55. replicator/llm/prompts/explain.md +37 -0
  56. replicator/llm/prompts/name_parts.md +13 -0
  57. replicator/llm/prompts/program.md +72 -0
  58. replicator/llm/prompts/research_queries.md +8 -0
  59. replicator/mcp_server.py +307 -0
  60. replicator/qml/Main.qml +874 -0
  61. replicator/qml/Replicator/UI/Chip.qml +17 -0
  62. replicator/qml/Replicator/UI/DockHeader.qml +27 -0
  63. replicator/qml/Replicator/UI/Icon.qml +118 -0
  64. replicator/qml/Replicator/UI/IconButton.qml +31 -0
  65. replicator/qml/Replicator/UI/Kbd.qml +18 -0
  66. replicator/qml/Replicator/UI/NumField.qml +69 -0
  67. replicator/qml/Replicator/UI/Pill.qml +28 -0
  68. replicator/qml/Replicator/UI/RCombo.qml +51 -0
  69. replicator/qml/Replicator/UI/RMenu.qml +42 -0
  70. replicator/qml/Replicator/UI/RSlider.qml +23 -0
  71. replicator/qml/Replicator/UI/Segmented.qml +63 -0
  72. replicator/qml/Replicator/UI/Swatch.qml +47 -0
  73. replicator/qml/Replicator/UI/Theme.qml +149 -0
  74. replicator/qml/Replicator/UI/qmldir +14 -0
  75. replicator/qml/panels/AgentPrompt.qml +53 -0
  76. replicator/qml/panels/AttributeManager.qml +171 -0
  77. replicator/qml/panels/Commander.qml +136 -0
  78. replicator/qml/panels/HolodeckPanel.qml +117 -0
  79. replicator/qml/panels/IssuesCard.qml +78 -0
  80. replicator/qml/panels/LedgerPanel.qml +110 -0
  81. replicator/qml/panels/MaterialShelf.qml +97 -0
  82. replicator/qml/panels/ObjectManager.qml +107 -0
  83. replicator/qml/panels/Preferences.qml +211 -0
  84. replicator/qml/panels/Presenter.qml +316 -0
  85. replicator/qml/panels/StatusBar.qml +77 -0
  86. replicator/qml/panels/Timeline.qml +149 -0
  87. replicator/qml/panels/Welcome.qml +126 -0
  88. replicator/qml/viewport/Callouts.qml +87 -0
  89. replicator/qml/viewport/EdgeMaterial.qml +16 -0
  90. replicator/qml/viewport/GridMaterial.qml +16 -0
  91. replicator/qml/viewport/HoloMaterial.qml +23 -0
  92. replicator/qml/viewport/NavGizmo.qml +72 -0
  93. replicator/qml/viewport/ReferenceMaterial.qml +17 -0
  94. replicator/qml/viewport/Viewport.qml +583 -0
  95. replicator/qt/__init__.py +0 -0
  96. replicator/qt/bridge.py +1427 -0
  97. replicator/qt/drawing_sheet.py +33 -0
  98. replicator/qt/envmap.py +40 -0
  99. replicator/qt/library.py +68 -0
  100. replicator/qt/mesh_geometry.py +167 -0
  101. replicator/qt/svg.py +41 -0
  102. replicator/research/__init__.py +0 -0
  103. replicator/research/lane.py +281 -0
  104. replicator/shaders/edge.frag +9 -0
  105. replicator/shaders/edge.vert +7 -0
  106. replicator/shaders/grid.frag +52 -0
  107. replicator/shaders/grid.vert +6 -0
  108. replicator/shaders/holo.frag +41 -0
  109. replicator/shaders/reference.frag +15 -0
  110. replicator/shaders/reference.vert +6 -0
  111. replicator/voice.py +120 -0
  112. replicator_workshop-0.1.0.dist-info/METADATA +410 -0
  113. replicator_workshop-0.1.0.dist-info/RECORD +118 -0
  114. replicator_workshop-0.1.0.dist-info/WHEEL +5 -0
  115. replicator_workshop-0.1.0.dist-info/entry_points.txt +3 -0
  116. replicator_workshop-0.1.0.dist-info/licenses/LICENSE +21 -0
  117. replicator_workshop-0.1.0.dist-info/licenses/vendor/mcp-for-blender/LICENSE +21 -0
  118. replicator_workshop-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,17 @@
1
+ import QtQuick
2
+
3
+ // A read-out: a small-caps label and a monospace value, for the status bar and the viewport HUD.
4
+ Row {
5
+ id: chip
6
+ property string label: ""
7
+ property string value: ""
8
+ property string icon: ""
9
+ property color valueColor: Theme.text
10
+ property color labelColor: Theme.faint
11
+ spacing: 5
12
+ Icon { visible: chip.icon !== ""; name: chip.icon; size: 13; color: chip.labelColor; anchors.verticalCenter: parent.verticalCenter }
13
+ Text { visible: chip.label !== ""; text: chip.label; color: chip.labelColor; anchors.verticalCenter: parent.verticalCenter
14
+ font.pixelSize: Theme.fsTiny; font.family: Theme.sans; font.letterSpacing: 1.1; font.weight: Font.DemiBold }
15
+ Text { text: chip.value; color: chip.valueColor; anchors.verticalCenter: parent.verticalCenter
16
+ font.pixelSize: Theme.fsSmall; font.family: Theme.mono }
17
+ }
@@ -0,0 +1,27 @@
1
+ import QtQuick
2
+ import QtQuick.Layouts
3
+
4
+ // The title strip of a dock panel: an icon, a small-caps title, an optional count and trailing buttons.
5
+ Rectangle {
6
+ id: dh
7
+ property string title: ""
8
+ property string icon: ""
9
+ property string count: ""
10
+ default property alias trailing: tail.data
11
+ Layout.fillWidth: true
12
+ implicitHeight: Theme.bar
13
+ color: Theme.header
14
+ Rectangle { anchors.bottom: parent.bottom; width: parent.width; height: 1; color: Theme.line }
15
+ Row {
16
+ x: Theme.pad; anchors.verticalCenter: parent.verticalCenter; spacing: 7
17
+ Icon { visible: dh.icon !== ""; name: dh.icon; size: 14; color: Theme.dim; anchors.verticalCenter: parent.verticalCenter }
18
+ Text { text: dh.title.toUpperCase(); color: Theme.dim; anchors.verticalCenter: parent.verticalCenter
19
+ font.pixelSize: Theme.fsTiny; font.family: Theme.sans; font.weight: Font.DemiBold; font.letterSpacing: Theme.caps }
20
+ Rectangle {
21
+ visible: dh.count !== ""; anchors.verticalCenter: parent.verticalCenter
22
+ width: ct.implicitWidth + 10; height: 15; radius: 7.5; color: Theme.panel2
23
+ Text { id: ct; anchors.centerIn: parent; text: dh.count; color: Theme.dim; font.pixelSize: 9; font.family: Theme.mono }
24
+ }
25
+ }
26
+ Row { id: tail; anchors.right: parent.right; anchors.rightMargin: 4; anchors.verticalCenter: parent.verticalCenter; spacing: 1 }
27
+ }
@@ -0,0 +1,118 @@
1
+ import QtQuick
2
+ import QtQuick.Shapes
3
+
4
+ // Replicator's icon set: line icons on a 24 unit grid, drawn as vector paths (crisp at any size, tinted by any
5
+ // token). `name` picks the path, `fill` (0..1) fills the outline for solid glyphs such as play.
6
+ // Add an icon by adding one SVG path string to `paths`; nothing else needs to change.
7
+ Item {
8
+ id: ic
9
+ property string name: ""
10
+ property real size: 18
11
+ property color color: Theme.text
12
+ property real stroke: 1.7
13
+ property real fill: solid.indexOf(name) >= 0 ? 1.0 : 0.0
14
+ implicitWidth: size; implicitHeight: size
15
+ width: size; height: size
16
+
17
+ function circle(cx, cy, r) { return "M" + (cx - r) + " " + cy + " a" + r + " " + r + " 0 1 0 " + (2 * r) + " 0 a" + r + " " + r + " 0 1 0 " + (-2 * r) + " 0 " }
18
+ function ellipse(cx, cy, rx, ry) { return "M" + (cx - rx) + " " + cy + " a" + rx + " " + ry + " 0 1 0 " + (2 * rx) + " 0 a" + rx + " " + ry + " 0 1 0 " + (-2 * rx) + " 0 " }
19
+ readonly property string cube: "M12 3 L20 7.5 V16.5 L12 21 L4 16.5 V7.5 Z M4 7.5 L12 12 L20 7.5 M12 12 V21 "
20
+ readonly property string globe: circle(12, 12, 8) + "M4 12 H20 M12 4 C8.4 8 8.4 16 12 20 M12 4 C15.6 8 15.6 16 12 20 "
21
+ readonly property string frameCorners: "M4 9 V4 H9 M15 4 H20 V9 M20 15 V20 H15 M9 20 H4 V15 "
22
+ readonly property string rays: "M12 2.5 V5 M12 19 V21.5 M2.5 12 H5 M19 12 H21.5 M5.3 5.3 L7 7 M17 17 L18.7 18.7 M5.3 18.7 L7 17 M17 7 L18.7 5.3 "
23
+ readonly property var solid: ["play", "playBack", "shaded", "dot", "cursor"]
24
+
25
+ readonly property var paths: ({
26
+ // tools
27
+ cursor: "M5 3 L5 19 L9.5 14.8 L12.6 21 L15 19.9 L12 13.8 L18 13.5 Z",
28
+ move: "M12 3 V21 M3 12 H21 M9 6 L12 3 L15 6 M9 18 L12 21 L15 18 M6 9 L3 12 L6 15 M18 9 L21 12 L18 15",
29
+ frame: frameCorners + circle(12, 12, 1.6),
30
+ // display
31
+ shaded: circle(12, 12, 8),
32
+ lines: globe,
33
+ wire: cube + "M12 3 V12 M4 16.5 L12 12 L20 16.5",
34
+ xray: circle(12, 12, 8) + circle(12, 12, 3.4),
35
+ layers: "M12 3 L21 8 L12 13 L3 8 Z M3 12 L12 17 L21 12 M3 16 L12 21 L21 16",
36
+ grid: "M4 4 H20 V20 H4 Z M4 9.33 H20 M4 14.66 H20 M9.33 4 V20 M14.66 4 V20",
37
+ reference: "M4 5 H14 V15 H4 Z M10 9 H20 V19 H10 Z",
38
+ sun: circle(12, 12, 4) + rays,
39
+ // primitives
40
+ box: cube,
41
+ cylinder: ellipse(12, 6.5, 7, 2.8) + "M5 6.5 V17.5 a7 2.8 0 0 0 14 0 V6.5",
42
+ sphere: circle(12, 12, 8) + "M4 12 a8 3 0 0 0 16 0",
43
+ torus: ellipse(12, 12, 9, 5.5) + "M8.5 11.3 a3.5 1.7 0 0 0 7 0",
44
+ capsule: "M8 8 a4 4 0 0 1 8 0 V16 a4 4 0 0 1 -8 0 Z",
45
+ gear: circle(12, 12, 2.6) + circle(12, 12, 6) + "M12 2.5 V6 M12 18 V21.5 M2.5 12 H6 M18 12 H21.5 M5.3 5.3 L7.8 7.8 M16.2 16.2 L18.7 18.7 M5.3 18.7 L7.8 16.2 M16.2 7.8 L18.7 5.3",
46
+ helix: "M7 3.5 L17 6 L7 8.5 L17 11 L7 13.5 L17 16 L7 18.5 L17 21",
47
+ pipe: "M3 18 H8 a5 5 0 0 0 5 -5 V11 a5 5 0 0 1 5 -5 H21",
48
+ loft: "M8 4 H16 L20 20 H4 Z M6 12 H18",
49
+ // transport
50
+ play: "M8 5 L19 12 L8 19 Z",
51
+ playBack: "M16 5 L5 12 L16 19 Z",
52
+ pause: "M8.5 5 V19 M15.5 5 V19",
53
+ first: "M6 5 V19 M19 5 L9.5 12 L19 19 Z",
54
+ last: "M18 5 V19 M5 5 L14.5 12 L5 19 Z",
55
+ // objects
56
+ eye: "M2.5 12 C5.5 6.4 18.5 6.4 21.5 12 C18.5 17.6 5.5 17.6 2.5 12 Z " + circle(12, 12, 2.6),
57
+ eyeOff: "M2.5 12 C5.5 6.4 18.5 6.4 21.5 12 C18.5 17.6 5.5 17.6 2.5 12 Z M4.5 4.5 L19.5 19.5",
58
+ target: circle(12, 12, 6.5) + circle(12, 12, 1.8) + "M12 2 V5.5 M12 18.5 V22 M2 12 H5.5 M18.5 12 H22",
59
+ chevronRight: "M9 6 L15 12 L9 18",
60
+ chevronDown: "M6 9 L12 15 L18 9",
61
+ dot: circle(12, 12, 3.2),
62
+ // modes
63
+ build: "M4 13 H11 V20 H4 Z M13 13 H20 V20 H13 Z M8.5 4 H15.5 V11 H8.5 Z",
64
+ dissect: "M9.5 9.5 H14.5 V14.5 H9.5 Z M12 6.5 V2.5 M12 21.5 V17.5 M6.5 12 H2.5 M21.5 12 H17.5 M10.4 4.1 L12 2.5 L13.6 4.1 M10.4 19.9 L12 21.5 L13.6 19.9 M4.1 10.4 L2.5 12 L4.1 13.6 M19.9 10.4 L21.5 12 L19.9 13.6",
65
+ reverse: frameCorners + "M3 12 H21",
66
+ showcase: "M3 8 H7.5 L9 5.5 H15 L16.5 8 H21 V19 H3 Z " + circle(12, 13.2, 3.4),
67
+ // actions
68
+ search: circle(10.5, 10.5, 6.5) + "M15.5 15.5 L20.5 20.5",
69
+ sliders: "M4 7 H13 M17 7 H20 M15 5 V9 M4 12 H7 M11 12 H20 M9 10 V14 M4 17 H14 M18 17 H20 M16 15 V19",
70
+ image: "M4 5 H20 V19 H4 Z M4 16 L9 11 L13 15 L16 12.5 L20 16 " + circle(15.5, 8.8, 1.2),
71
+ importIn: "M12 3 V14 M8 10 L12 14 L16 10 M4 15 V20 H20 V15",
72
+ exportOut: "M12 14 V3 M8 7 L12 3 L16 7 M4 15 V20 H20 V15",
73
+ folder: "M3 6 H9 L11 8.5 H21 V19 H3 Z",
74
+ sparkle: "M11 3 L12.9 9.1 L19 11 L12.9 12.9 L11 19 L9.1 12.9 L3 11 L9.1 9.1 Z M18.5 15.5 L19.3 18.2 L22 19 L19.3 19.8 L18.5 22.5 L17.7 19.8 L15 19 L17.7 18.2 Z",
75
+ pencil: "M4 20 L5 15.5 L16 4.5 L19.5 8 L8.5 19 Z M14 6.5 L17.5 10",
76
+ undo: "M9 6 L4 10 L9 14 M4 10 H14 a5 5 0 0 1 0 10 H11",
77
+ redo: "M15 6 L20 10 L15 14 M20 10 H10 a5 5 0 0 0 0 10 H13",
78
+ terminal: "M3 5 H21 V19 H3 Z M7 9.5 L10 12 L7 14.5 M12.5 15 H17",
79
+ close: "M6 6 L18 18 M18 6 L6 18",
80
+ check: "M5 12.5 L10 17.5 L19 7",
81
+ plus: "M12 5 V19 M5 12 H19",
82
+ copy: "M8 8 H20 V20 H8 Z M16 8 V4 H4 V16 H8",
83
+ trash: "M4 7 H20 M9 7 V4 H15 V7 M6 7 L7 20 H17 L18 7 M10 11 V16 M14 11 V16",
84
+ panelLeft: "M3 5 H21 V19 H3 Z M9 5 V19",
85
+ panelRight: "M3 5 H21 V19 H3 Z M15 5 V19",
86
+ panelBottom: "M3 5 H21 V19 H3 Z M3 14 H21",
87
+ material: circle(12, 12, 8) + "M8.3 10.2 a4.5 4.5 0 0 1 4 -3.6",
88
+ chip: "M7 7 H17 V17 H7 Z M10 3 V7 M14 3 V7 M10 17 V21 M14 17 V21 M3 10 H7 M3 14 H7 M17 10 H21 M17 14 H21",
89
+ external: "M14 4 H20 V10 M20 4 L11 13 M18 14 V20 H4 V6 H10",
90
+ render: "M3 6 H21 V18 H3 Z M3 10 H21 M7.5 6 L5.5 10 M12.5 6 L10.5 10 M17.5 6 L15.5 10",
91
+ history: circle(12, 12, 8) + "M12 7.5 V12 L15 14",
92
+ ruler: "M3 15 L15 3 L21 9 L9 21 Z M7.5 13.5 L9.5 15.5 M10.5 10.5 L12.5 12.5 M13.5 7.5 L15.5 9.5",
93
+ spin: "M20 12 a8 8 0 1 1 -3 -6.2 M17.5 2.5 V6 H14",
94
+ present: "M3 4.5 H21 V16.5 H3 Z M12 16.5 V20.5 M8 20.5 H16 M10.3 8 L14.6 10.5 L10.3 13 Z",
95
+ mic: "M9.5 5.5 a2.5 2.5 0 0 1 5 0 V11 a2.5 2.5 0 0 1 -5 0 Z M6 11 a6 6 0 0 0 12 0 M12 17 V20.5 M8.5 20.5 H15.5",
96
+ speaker: "M4 9.5 H7.5 L12 6 V18 L7.5 14.5 H4 Z M15.5 9 a4 4 0 0 1 0 6 M18 6.5 a7.5 7.5 0 0 1 0 11",
97
+ speakerOff: "M4 9.5 H7.5 L12 6 V18 L7.5 14.5 H4 Z M16 9.5 L20.5 14.5 M20.5 9.5 L16 14.5",
98
+ book: "M4 5 C7 4 10 4.5 12 6 C14 4.5 17 4 20 5 V18.5 C17 17.5 14 18 12 19.5 C10 18 7 17.5 4 18.5 Z M12 6 V19.5",
99
+ link: "M10 14 a4 4 0 0 0 5.7 0 L19 10.7 a4 4 0 0 0 -5.7 -5.7 L12 6.3 M14 10 a4 4 0 0 0 -5.7 0 L5 13.3 a4 4 0 0 0 5.7 5.7 L12 17.7",
100
+ alert: "M12 4 L21.5 20 H2.5 Z M12 10 V14.5 M12 17.2 V17.4",
101
+ printer: "M7 9 V4 H17 V9 M7 17 H4 V9 H20 V17 H17 M7 14 H17 V20 H7 Z"
102
+ })
103
+
104
+ Shape {
105
+ width: 24; height: 24
106
+ scale: ic.size / 24
107
+ transformOrigin: Item.TopLeft
108
+ preferredRendererType: Shape.CurveRenderer
109
+ ShapePath {
110
+ strokeColor: ic.color
111
+ strokeWidth: ic.stroke * Math.min(1.25, Math.max(0.85, 18 / ic.size))
112
+ fillColor: Qt.rgba(ic.color.r, ic.color.g, ic.color.b, ic.color.a * ic.fill)
113
+ capStyle: ShapePath.RoundCap
114
+ joinStyle: ShapePath.RoundJoin
115
+ PathSvg { path: ic.paths[ic.name] || "" }
116
+ }
117
+ }
118
+ }
@@ -0,0 +1,31 @@
1
+ import QtQuick
2
+ import QtQuick.Controls
3
+
4
+ // A square icon button: hover wash, accent when `on`. `tip` shows after a short delay, with `keys` as a keycap.
5
+ Rectangle {
6
+ id: b
7
+ property string icon: ""
8
+ property string tip: ""
9
+ property string keys: ""
10
+ property bool on: false
11
+ property real size: Theme.ctl + 6
12
+ property real iconSize: 17
13
+ property color tint: Theme.dim
14
+ signal hit()
15
+ implicitWidth: size; implicitHeight: size
16
+ radius: Theme.r2
17
+ opacity: enabled ? 1 : 0.35
18
+ color: on ? Theme.accentSoft : ma.pressed ? Theme.press : ma.containsMouse ? Theme.hover : "transparent"
19
+ border.width: on ? 1 : 0
20
+ border.color: Theme.accentLine
21
+ Behavior on color { ColorAnimation { duration: Theme.fast } }
22
+ Icon {
23
+ anchors.centerIn: parent
24
+ name: b.icon; size: b.iconSize
25
+ color: b.on ? Theme.accentHi : ma.containsMouse ? Theme.text : b.tint
26
+ }
27
+ MouseArea { id: ma; anchors.fill: parent; hoverEnabled: true; cursorShape: Qt.PointingHandCursor; onClicked: b.hit() }
28
+ ToolTip.visible: ma.containsMouse && b.tip !== ""
29
+ ToolTip.text: b.tip + (b.keys !== "" ? " " + b.keys : "")
30
+ ToolTip.delay: 450
31
+ }
@@ -0,0 +1,18 @@
1
+ import QtQuick
2
+
3
+ // A keycap: shows a shortcut ("Ctrl+K") as small raised keys.
4
+ Row {
5
+ id: kbd
6
+ property string keys: ""
7
+ spacing: 3
8
+ Repeater {
9
+ model: kbd.keys === "" ? [] : kbd.keys.split("+")
10
+ delegate: Rectangle {
11
+ required property string modelData
12
+ width: Math.max(18, kt.implicitWidth + 9); height: 18; radius: 4
13
+ color: Theme.raised; border.color: Theme.line
14
+ Text { id: kt; anchors.centerIn: parent; text: parent.modelData; color: Theme.dim
15
+ font.pixelSize: Theme.fsTiny; font.family: Theme.mono }
16
+ }
17
+ }
18
+ }
@@ -0,0 +1,69 @@
1
+ import QtQuick
2
+ import QtQuick.Controls
3
+
4
+ // A DCC-style number field: drag on it horizontally to scrub (Shift = fine, Ctrl = coarse), click to type.
5
+ Rectangle {
6
+ id: f
7
+ property real value: 0
8
+ property string label: ""
9
+ property color labelColor: Theme.dim
10
+ property real stepSize: 1
11
+ property int decimals: 2
12
+ signal committed(real v)
13
+ implicitHeight: Theme.ctl - 2
14
+ implicitWidth: 80
15
+ radius: Theme.r1
16
+ color: Theme.field
17
+ border.color: input.activeFocus ? Theme.accent : drag.containsMouse ? Theme.accentLine : Theme.line
18
+
19
+ property real _shown: value
20
+ onValueChanged: if (!drag.active && !input.activeFocus) _shown = value
21
+
22
+ Rectangle { // axis stripe
23
+ visible: f.label !== ""
24
+ width: 2; height: parent.height - 8; x: 4; anchors.verticalCenter: parent.verticalCenter
25
+ radius: 1; color: f.labelColor
26
+ }
27
+ Text {
28
+ id: lab
29
+ anchors.left: parent.left; anchors.leftMargin: 10; anchors.verticalCenter: parent.verticalCenter
30
+ text: f.label; color: f.labelColor; font.pixelSize: Theme.fsTiny; font.weight: Font.DemiBold; font.family: Theme.sans
31
+ visible: f.label !== ""
32
+ }
33
+ TextInput {
34
+ id: input
35
+ anchors.left: lab.visible ? lab.right : parent.left; anchors.leftMargin: 6
36
+ anchors.right: parent.right; anchors.rightMargin: 7; anchors.verticalCenter: parent.verticalCenter
37
+ horizontalAlignment: TextInput.AlignRight
38
+ color: Theme.text; font.pixelSize: Theme.fsSmall; font.family: Theme.mono
39
+ selectionColor: Theme.accent; selectedTextColor: Theme.onAccent
40
+ selectByMouse: true
41
+ clip: true
42
+ text: Number(f._shown).toFixed(f.decimals)
43
+ validator: DoubleValidator {}
44
+ onEditingFinished: { const v = parseFloat(text); if (!isNaN(v)) { f._shown = v; f.committed(v) } }
45
+ }
46
+ MouseArea {
47
+ id: drag
48
+ anchors.fill: parent
49
+ hoverEnabled: true
50
+ property real startX: 0
51
+ property real startV: 0
52
+ property bool moved: false
53
+ property bool active: pressed && moved
54
+ cursorShape: Qt.SizeHorCursor
55
+ onPressed: (m) => { startX = m.x; startV = f._shown; moved = false }
56
+ onPositionChanged: (m) => {
57
+ if (!pressed) return
58
+ const dx = m.x - startX
59
+ if (Math.abs(dx) > 3) moved = true
60
+ if (!moved) return
61
+ const k = (m.modifiers & Qt.ShiftModifier) ? 0.1 : (m.modifiers & Qt.ControlModifier) ? 10 : 1
62
+ f._shown = startV + dx * f.stepSize * k * 0.5
63
+ }
64
+ onReleased: {
65
+ if (moved) f.committed(f._shown)
66
+ else { input.forceActiveFocus(); input.selectAll() }
67
+ }
68
+ }
69
+ }
@@ -0,0 +1,28 @@
1
+ import QtQuick
2
+
3
+ // The one button style: a rounded pill. `primary` fills it with the accent; `icon` adds a leading glyph.
4
+ Rectangle {
5
+ id: pill
6
+ property string text
7
+ property string icon: ""
8
+ property bool primary: false
9
+ signal hit()
10
+ implicitWidth: row.implicitWidth + 26; implicitHeight: Theme.ctl + 2; radius: height / 2
11
+ opacity: enabled ? 1 : 0.4
12
+ color: primary ? (pma.pressed ? Qt.darker(Theme.accent, 1.12) : pma.containsMouse ? Theme.accentHi : Theme.accent)
13
+ : (pma.pressed ? Theme.press : pma.containsMouse ? Theme.hover : "transparent")
14
+ border.width: primary ? 0 : 1
15
+ border.color: pma.containsMouse ? Theme.accentLine : Theme.line
16
+ Behavior on color { ColorAnimation { duration: Theme.fast } }
17
+ Row {
18
+ id: row
19
+ anchors.centerIn: parent
20
+ spacing: 6
21
+ Icon { visible: pill.icon !== ""; name: pill.icon; size: 14; anchors.verticalCenter: parent.verticalCenter
22
+ color: pill.primary ? Theme.onAccent : Theme.text }
23
+ Text { text: pill.text; anchors.verticalCenter: parent.verticalCenter
24
+ color: pill.primary ? Theme.onAccent : Theme.text
25
+ font.pixelSize: Theme.fs; font.family: Theme.sans; font.weight: pill.primary ? Font.DemiBold : Font.Medium }
26
+ }
27
+ MouseArea { id: pma; anchors.fill: parent; hoverEnabled: true; cursorShape: Qt.PointingHandCursor; onClicked: pill.hit() }
28
+ }
@@ -0,0 +1,51 @@
1
+ import QtQuick
2
+ import QtQuick.Controls
3
+
4
+ // A themed combo box: flat field, chevron, a rounded popup list.
5
+ ComboBox {
6
+ id: cb
7
+ implicitHeight: Theme.ctl
8
+ implicitWidth: 110
9
+ font.pixelSize: Theme.fsSmall
10
+ font.family: Theme.sans
11
+ leftPadding: 9; rightPadding: 24
12
+ background: Rectangle {
13
+ radius: Theme.r1; color: Theme.field
14
+ border.color: cb.popup.visible ? Theme.accent : cb.hovered ? Theme.accentLine : Theme.line
15
+ }
16
+ contentItem: Text {
17
+ text: cb.displayText; color: Theme.text; font: cb.font
18
+ verticalAlignment: Text.AlignVCenter; elide: Text.ElideRight
19
+ }
20
+ indicator: Icon {
21
+ x: cb.width - width - 7; y: (cb.height - height) / 2
22
+ name: "chevronDown"; size: 12; color: Theme.dim
23
+ }
24
+ delegate: ItemDelegate {
25
+ id: del
26
+ required property var modelData
27
+ required property int index
28
+ width: ListView.view ? ListView.view.width : cb.width
29
+ height: Theme.ctl + 2
30
+ contentItem: Text {
31
+ text: cb.textRole ? del.modelData[cb.textRole] : del.modelData
32
+ color: cb.currentIndex === del.index ? Theme.accentHi : Theme.text
33
+ font: cb.font; verticalAlignment: Text.AlignVCenter; elide: Text.ElideRight
34
+ }
35
+ background: Rectangle { radius: Theme.r1; color: del.hovered || del.highlighted ? Theme.hover : "transparent" }
36
+ }
37
+ popup: Popup {
38
+ y: cb.height + 3
39
+ width: Math.max(cb.width, 120)
40
+ padding: 4
41
+ implicitHeight: Math.min(contentItem.implicitHeight + 8, 320)
42
+ contentItem: ListView {
43
+ clip: true
44
+ implicitHeight: contentHeight
45
+ model: cb.popup.visible ? cb.delegateModel : null
46
+ currentIndex: cb.highlightedIndex
47
+ ScrollBar.vertical: ScrollBar {}
48
+ }
49
+ background: Rectangle { radius: Theme.r2; color: Theme.raised; border.color: Theme.line }
50
+ }
51
+ }
@@ -0,0 +1,42 @@
1
+ import QtQuick
2
+ import QtQuick.Controls
3
+
4
+ // A themed drop-down menu fed from the action registry. `actions` is a list of action objects
5
+ // ({ title, keys, icon, run, enabled, checked }) or the string "-" for a separator.
6
+ Popup {
7
+ id: menu
8
+ property var actions: []
9
+ function val(x) { return typeof x === "function" ? x() : x } // registry fields may be live functions
10
+ padding: 5
11
+ implicitWidth: 286
12
+ background: Rectangle { radius: Theme.r3; color: Theme.raised; border.color: Theme.line }
13
+ enter: Transition { NumberAnimation { property: "opacity"; from: 0; to: 1; duration: Theme.fast } }
14
+ contentItem: Column {
15
+ spacing: 1
16
+ Repeater {
17
+ model: menu.actions
18
+ delegate: Item {
19
+ id: it
20
+ required property var modelData
21
+ readonly property bool sep: modelData === "-"
22
+ readonly property bool ok: !sep && (modelData.enabled === undefined || menu.val(modelData.enabled))
23
+ readonly property bool on: !sep && modelData.checked !== undefined && menu.val(modelData.checked)
24
+ width: menu.availableWidth
25
+ height: sep ? 9 : Theme.row
26
+ Rectangle { visible: it.sep; anchors.centerIn: parent; width: parent.width - 12; height: 1; color: Theme.line }
27
+ Rectangle { visible: !it.sep && mma.containsMouse && it.ok; anchors.fill: parent; radius: Theme.r1; color: Theme.accentSoft }
28
+ Icon { visible: !it.sep; x: 8; anchors.verticalCenter: parent.verticalCenter
29
+ name: it.sep ? "" : (it.on ? "check" : (it.modelData.icon || ""))
30
+ size: 15; color: it.on ? Theme.accentHi : Theme.dim; opacity: it.ok ? 1 : 0.4 }
31
+ Text { visible: !it.sep; x: 32; anchors.verticalCenter: parent.verticalCenter
32
+ text: it.sep ? "" : it.modelData.title; color: Theme.text; opacity: it.ok ? 1 : 0.4
33
+ font.pixelSize: Theme.fs; font.family: Theme.sans }
34
+ Text { visible: !it.sep; anchors.right: parent.right; anchors.rightMargin: 10; anchors.verticalCenter: parent.verticalCenter
35
+ text: it.sep ? "" : (it.modelData.keys || ""); color: Theme.faint
36
+ font.pixelSize: Theme.fsTiny; font.family: Theme.mono }
37
+ MouseArea { id: mma; anchors.fill: parent; hoverEnabled: true; enabled: !it.sep
38
+ onClicked: if (it.ok) { menu.close(); it.modelData.run() } }
39
+ }
40
+ }
41
+ }
42
+ }
@@ -0,0 +1,23 @@
1
+ import QtQuick
2
+ import QtQuick.Controls
3
+
4
+ // A thin themed slider: accent fill, a round handle that grows on hover.
5
+ Slider {
6
+ id: s
7
+ implicitWidth: 160
8
+ implicitHeight: 22
9
+ background: Item {
10
+ x: s.leftPadding; y: s.topPadding + s.availableHeight / 2 - 2
11
+ width: s.availableWidth; height: 4
12
+ Rectangle { anchors.fill: parent; radius: 2; color: Theme.line }
13
+ Rectangle { width: s.visualPosition * parent.width; height: parent.height; radius: 2; color: Theme.accent }
14
+ }
15
+ handle: Rectangle {
16
+ x: s.leftPadding + s.visualPosition * (s.availableWidth - width)
17
+ y: s.topPadding + s.availableHeight / 2 - height / 2
18
+ width: s.pressed || s.hovered ? 14 : 12; height: width; radius: width / 2
19
+ color: Theme.dark ? "#f4f7fa" : "#ffffff"
20
+ border.color: Theme.accent; border.width: 2
21
+ Behavior on width { NumberAnimation { duration: Theme.fast } }
22
+ }
23
+ }
@@ -0,0 +1,63 @@
1
+ import QtQuick
2
+ import QtQuick.Controls
3
+
4
+ // A segmented switch with a sliding thumb. model: [{ key, label, icon?, hint? }]. `current` is the selected key.
5
+ // iconsOnly shows the label as a tooltip instead; hints: false drops the key hints to save width.
6
+ Rectangle {
7
+ id: seg
8
+ property var model: []
9
+ property string current: ""
10
+ property real segWidth: 104
11
+ property bool iconsOnly: false
12
+ property bool hints: true
13
+ signal pick(string key)
14
+ implicitWidth: model.length * segWidth + 6
15
+ implicitHeight: Theme.ctl + 6
16
+ radius: height / 2
17
+ color: Theme.field
18
+ border.color: Theme.line
19
+
20
+ readonly property int index: { for (let i = 0; i < model.length; i++) if (model[i].key === current) return i; return -1 }
21
+ Rectangle { // thumb
22
+ visible: seg.index >= 0
23
+ x: 3 + seg.index * seg.segWidth; y: 3
24
+ width: seg.segWidth; height: parent.height - 6; radius: height / 2
25
+ color: Theme.accent
26
+ Behavior on x { NumberAnimation { duration: Theme.med; easing.type: Easing.OutCubic } }
27
+ }
28
+ Row {
29
+ x: 3; y: 3
30
+ Repeater {
31
+ model: seg.model
32
+ delegate: Item {
33
+ id: cell
34
+ required property var modelData
35
+ required property int index
36
+ readonly property bool sel: seg.current === modelData.key
37
+ width: seg.segWidth; height: seg.height - 6
38
+ Rectangle { anchors.fill: parent; radius: height / 2; color: Theme.hover; visible: sma.containsMouse && !cell.sel }
39
+ Row {
40
+ anchors.centerIn: parent
41
+ spacing: 6
42
+ Icon { visible: !!cell.modelData.icon; name: cell.modelData.icon || ""; size: 15
43
+ anchors.verticalCenter: parent.verticalCenter
44
+ color: cell.sel ? Theme.onAccent : sma.containsMouse ? Theme.text : Theme.dim }
45
+ Text { visible: !seg.iconsOnly; text: cell.modelData.label || ""
46
+ anchors.verticalCenter: parent.verticalCenter
47
+ color: cell.sel ? Theme.onAccent : sma.containsMouse ? Theme.text : Theme.dim
48
+ font.pixelSize: Theme.fs; font.family: Theme.sans
49
+ font.weight: cell.sel ? Font.DemiBold : Font.Medium }
50
+ Text { visible: !seg.iconsOnly && seg.hints && !!cell.modelData.hint; text: cell.modelData.hint || ""
51
+ anchors.verticalCenter: parent.verticalCenter
52
+ color: cell.sel ? Qt.rgba(Theme.onAccent.r, Theme.onAccent.g, Theme.onAccent.b, 0.55) : Theme.faint
53
+ font.pixelSize: Theme.fsTiny; font.family: Theme.mono }
54
+ }
55
+ MouseArea { id: sma; anchors.fill: parent; hoverEnabled: true; cursorShape: Qt.PointingHandCursor
56
+ onClicked: seg.pick(cell.modelData.key) }
57
+ ToolTip.visible: seg.iconsOnly && sma.containsMouse
58
+ ToolTip.text: (cell.modelData.label || "") + (cell.modelData.hint ? " " + cell.modelData.hint : "")
59
+ ToolTip.delay: 450
60
+ }
61
+ }
62
+ }
63
+ }
@@ -0,0 +1,47 @@
1
+ import QtQuick
2
+
3
+ // A material preview ball drawn in 2D: base colour, a key light whose size follows roughness, a rim for metals
4
+ // and a glow for emissive materials. Cheap enough to show a whole shelf of them.
5
+ Item {
6
+ id: sw
7
+ property color base: "#b8bbc2"
8
+ property real metal: 0
9
+ property real rough: 0.5
10
+ property color glow: "black"
11
+ property bool selected: false
12
+ property real size: 34
13
+ implicitWidth: size; implicitHeight: size
14
+ readonly property bool lit: glow.r + glow.g + glow.b > 0.05
15
+
16
+ Rectangle { // emissive halo
17
+ visible: sw.lit
18
+ anchors.centerIn: parent; width: sw.size + 6; height: width; radius: width / 2
19
+ color: "transparent"; border.width: 3
20
+ border.color: Qt.rgba(sw.glow.r, sw.glow.g, sw.glow.b, 0.35)
21
+ }
22
+ Rectangle {
23
+ id: ball
24
+ anchors.centerIn: parent
25
+ width: sw.size - 4; height: width; radius: width / 2
26
+ gradient: Gradient {
27
+ GradientStop { position: 0.0; color: sw.lit ? Qt.lighter(sw.glow, 1.25) : Qt.lighter(sw.base, 1.0 + 0.55 * (1 - sw.rough * 0.6)) }
28
+ GradientStop { position: 0.55; color: sw.lit ? sw.glow : sw.base }
29
+ GradientStop { position: 1.0; color: sw.lit ? Qt.darker(sw.glow, 1.5) : Qt.darker(sw.base, 1.9 + sw.metal * 1.6) }
30
+ }
31
+ Rectangle { // key light: tight on polished surfaces, wide and faint on rough ones
32
+ x: parent.width * 0.24; y: parent.height * 0.16
33
+ width: parent.width * (0.2 + sw.rough * 0.28); height: width * 0.62; radius: height / 2
34
+ color: "white"; opacity: sw.lit ? 0.5 : (0.85 - sw.rough * 0.7)
35
+ }
36
+ Rectangle { // environment band on metals
37
+ visible: sw.metal > 0.5 && !sw.lit
38
+ anchors.horizontalCenter: parent.horizontalCenter; y: parent.height * 0.6
39
+ width: parent.width * 0.72; height: parent.height * 0.1; radius: height / 2
40
+ color: "white"; opacity: 0.16 * (1 - sw.rough)
41
+ }
42
+ }
43
+ Rectangle {
44
+ anchors.centerIn: parent; width: sw.size; height: width; radius: width / 2
45
+ color: "transparent"; border.width: sw.selected ? 2 : 0; border.color: Theme.accent
46
+ }
47
+ }