zui 0.0.5 → 0.0.6
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 +4 -4
- data/Components/Builtins/Canvas.qml +4 -1
- data/Controls/PanelKeyCatcher.qml +2 -0
- data/README.md +1 -1
- data/Service.qml +15 -10
- data/lib/zui.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d7ea7b4582e9bcf5569570df18dd76f3d1393ec669e1b724074a42100e4fda3a
|
|
4
|
+
data.tar.gz: 53cdb96fec42899c801e28699bc6a288c209de6e194096644e1087e51238f1de
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 908ffce6d2e11436a24ea978971dcdc19aabf55a7dd1706ff2e6fb86b0ce255c77a98d61bbb02b82b2bc6a5b9b16e4674f017adda6629ae95f76af284e0ae64e
|
|
7
|
+
data.tar.gz: 71f8b68dc16b2260efb2a3424e4a9170ac86db42f05958778a63fe2f74c302763141842c94766d7d8db577f3514dfb6b0146d658002c45532f70f74a408a873f
|
|
@@ -152,7 +152,10 @@ Item {
|
|
|
152
152
|
function payload(mouse) { return { x: mouse.x, y: mouse.y, button: mouse.button } }
|
|
153
153
|
onClicked: function(mouse) { if (renderer.subscribed("click")) renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "click", payload(mouse)) }
|
|
154
154
|
onDoubleClicked: function(mouse) { if (renderer.subscribed("double_click")) renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "double_click", payload(mouse)) }
|
|
155
|
-
onPressed: function(mouse) {
|
|
155
|
+
onPressed: function(mouse) {
|
|
156
|
+
canvasRoot.forceActiveFocus()
|
|
157
|
+
if (renderer.subscribed("press")) renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "press", payload(mouse))
|
|
158
|
+
}
|
|
156
159
|
onReleased: function(mouse) { if (renderer.subscribed("release")) renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "release", payload(mouse)) }
|
|
157
160
|
onPositionChanged: function(mouse) { if (renderer.subscribed("hover")) renderer.bridge.sendEvent(renderer.surfaceName, renderer.controlId, "hover", payload(mouse)) }
|
|
158
161
|
}
|
|
@@ -11,6 +11,8 @@ FocusScope {
|
|
|
11
11
|
signal activateRequested()
|
|
12
12
|
signal textKey(string text)
|
|
13
13
|
focus: true
|
|
14
|
+
Component.onCompleted: Qt.callLater(function() { root.forceActiveFocus() })
|
|
15
|
+
onVisibleChanged: if (visible) Qt.callLater(function() { root.forceActiveFocus() })
|
|
14
16
|
Keys.onEscapePressed: if (!blocked) closeRequested()
|
|
15
17
|
Keys.onDeletePressed: if (!blocked) deleteRequested()
|
|
16
18
|
Keys.onReturnPressed: if (!blocked) returnRequested()
|
data/README.md
CHANGED
data/Service.qml
CHANGED
|
@@ -158,11 +158,20 @@ Item {
|
|
|
158
158
|
|
|
159
159
|
surfaces = message.surfaces
|
|
160
160
|
surfaceOptions = message.surface_options || ({})
|
|
161
|
-
|
|
161
|
+
commitNodeIndex(nextIndex)
|
|
162
162
|
revision += 1
|
|
163
163
|
lastError = ""
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
+
// nodeIndex intentionally keeps a stable object identity. ControlNode observes
|
|
167
|
+
// revision, so publishing a new index object before its revision would expose
|
|
168
|
+
// intermediate patch state and invalidate every renderer in a batch.
|
|
169
|
+
function commitNodeIndex(nextIndex) {
|
|
170
|
+
for (var oldId in nodeIndex)
|
|
171
|
+
if (nextIndex[oldId] === undefined) delete nodeIndex[oldId]
|
|
172
|
+
for (var nextId in nextIndex) nodeIndex[nextId] = nextIndex[nextId]
|
|
173
|
+
}
|
|
174
|
+
|
|
166
175
|
function validateSurfaceOptions(options) {
|
|
167
176
|
if (!plainObject(options)) return false
|
|
168
177
|
var allowed = {
|
|
@@ -192,6 +201,8 @@ Item {
|
|
|
192
201
|
if (!validSetPatch(message.patches[batchIndex])) return reject("patch batch rejected")
|
|
193
202
|
for (var applyIndex = 0; applyIndex < message.patches.length; applyIndex++)
|
|
194
203
|
applySetPatch(message.patches[applyIndex], false)
|
|
204
|
+
// All replacements above are invisible to bindings until this single
|
|
205
|
+
// revision publishes the complete, internally consistent batch.
|
|
195
206
|
revision += 1
|
|
196
207
|
return true
|
|
197
208
|
}
|
|
@@ -220,7 +231,7 @@ Item {
|
|
|
220
231
|
var containerReplacement = ({ type: node.type, id: node.id, props: node.props || {}, children: message.children })
|
|
221
232
|
if (node.events !== undefined) containerReplacement.events = node.events
|
|
222
233
|
childrenIndex[node.id] = containerReplacement
|
|
223
|
-
|
|
234
|
+
commitNodeIndex(childrenIndex)
|
|
224
235
|
revision += 1
|
|
225
236
|
return true
|
|
226
237
|
}
|
|
@@ -250,10 +261,7 @@ Item {
|
|
|
250
261
|
if (node.children !== undefined) animatedReplacement.children = node.children
|
|
251
262
|
if (node.events !== undefined) animatedReplacement.events = node.events
|
|
252
263
|
animatedReplacement.transitions = validatedTracks
|
|
253
|
-
|
|
254
|
-
for (var animatedId in nodeIndex) animatedIndex[animatedId] = nodeIndex[animatedId]
|
|
255
|
-
animatedIndex[node.id] = animatedReplacement
|
|
256
|
-
nodeIndex = animatedIndex
|
|
264
|
+
nodeIndex[node.id] = animatedReplacement
|
|
257
265
|
revision += 1
|
|
258
266
|
return true
|
|
259
267
|
}
|
|
@@ -299,10 +307,7 @@ Item {
|
|
|
299
307
|
}
|
|
300
308
|
}
|
|
301
309
|
|
|
302
|
-
|
|
303
|
-
for (var id in nodeIndex) nextIndex[id] = nodeIndex[id]
|
|
304
|
-
nextIndex[node.id] = replacement
|
|
305
|
-
nodeIndex = nextIndex
|
|
310
|
+
nodeIndex[node.id] = replacement
|
|
306
311
|
if (incrementRevision) revision += 1
|
|
307
312
|
return true
|
|
308
313
|
}
|
data/lib/zui.rb
CHANGED