Rename debugModuleSlots to moduleSlots
The slot registry is about to become the routing table for panel hotkeys, so it has outgrown its debug-only name. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
af828481b9
commit
6bb3cb666b
+20
-20
@@ -87,7 +87,7 @@ Item {
|
|||||||
property real barDragOffsetY: 0
|
property real barDragOffsetY: 0
|
||||||
property var configControls: []
|
property var configControls: []
|
||||||
property var clickTargets: []
|
property var clickTargets: []
|
||||||
property var debugModuleSlots: []
|
property var moduleSlots: []
|
||||||
|
|
||||||
function registerClickTarget(target) {
|
function registerClickTarget(target) {
|
||||||
if (!target || clickTargets.indexOf(target) !== -1) return
|
if (!target || clickTargets.indexOf(target) !== -1) return
|
||||||
@@ -101,16 +101,16 @@ Item {
|
|||||||
clickTargets = next
|
clickTargets = next
|
||||||
}
|
}
|
||||||
|
|
||||||
function registerDebugModuleSlot(slot) {
|
function registerModuleSlot(slot) {
|
||||||
if (!slot || debugModuleSlots.indexOf(slot) !== -1) return
|
if (!slot || moduleSlots.indexOf(slot) !== -1) return
|
||||||
var next = debugModuleSlots.slice()
|
var next = moduleSlots.slice()
|
||||||
next.push(slot)
|
next.push(slot)
|
||||||
debugModuleSlots = next
|
moduleSlots = next
|
||||||
}
|
}
|
||||||
|
|
||||||
function unregisterDebugModuleSlot(slot) {
|
function unregisterModuleSlot(slot) {
|
||||||
var next = debugModuleSlots.filter(function(item) { return item !== slot })
|
var next = moduleSlots.filter(function(item) { return item !== slot })
|
||||||
debugModuleSlots = next
|
moduleSlots = next
|
||||||
}
|
}
|
||||||
|
|
||||||
function registerConfigControl(control) {
|
function registerConfigControl(control) {
|
||||||
@@ -127,8 +127,8 @@ Item {
|
|||||||
|
|
||||||
function debugBarGeometry() {
|
function debugBarGeometry() {
|
||||||
var out = []
|
var out = []
|
||||||
for (var i = 0; i < debugModuleSlots.length; i++) {
|
for (var i = 0; i < moduleSlots.length; i++) {
|
||||||
var slot = debugModuleSlots[i]
|
var slot = moduleSlots[i]
|
||||||
if (!slot || !slot.activeItem) continue
|
if (!slot || !slot.activeItem) continue
|
||||||
var point = { x: slot.x, y: slot.y }
|
var point = { x: slot.x, y: slot.y }
|
||||||
try {
|
try {
|
||||||
@@ -287,8 +287,8 @@ Item {
|
|||||||
var slots = []
|
var slots = []
|
||||||
for (var i = 0; i < entries.length; i++) {
|
for (var i = 0; i < entries.length; i++) {
|
||||||
var id = entryId(entries[i])
|
var id = entryId(entries[i])
|
||||||
for (var j = 0; j < debugModuleSlots.length; j++) {
|
for (var j = 0; j < moduleSlots.length; j++) {
|
||||||
var slot = debugModuleSlots[j]
|
var slot = moduleSlots[j]
|
||||||
if (!slot || slot.region !== region || slot.moduleName !== id) continue
|
if (!slot || slot.region !== region || slot.moduleName !== id) continue
|
||||||
var item = slot.activeItem
|
var item = slot.activeItem
|
||||||
if (!item || item.visible !== true || slot.visible !== true || slot.width <= 0 || slot.height <= 0) continue
|
if (!item || item.visible !== true || slot.visible !== true || slot.width <= 0 || slot.height <= 0) continue
|
||||||
@@ -304,8 +304,8 @@ Item {
|
|||||||
if (!owner) return false
|
if (!owner) return false
|
||||||
|
|
||||||
var currentSlot = null
|
var currentSlot = null
|
||||||
for (var i = 0; i < debugModuleSlots.length; i++) {
|
for (var i = 0; i < moduleSlots.length; i++) {
|
||||||
var slot = debugModuleSlots[i]
|
var slot = moduleSlots[i]
|
||||||
if (slot && slot.activeItem === owner) {
|
if (slot && slot.activeItem === owner) {
|
||||||
currentSlot = slot
|
currentSlot = slot
|
||||||
break
|
break
|
||||||
@@ -481,8 +481,8 @@ Item {
|
|||||||
|
|
||||||
function moduleDropAtScene(scenePoint, sourceSlot) {
|
function moduleDropAtScene(scenePoint, sourceSlot) {
|
||||||
var sourceWindow = root.slotWindow(sourceSlot) || root.barDragWindow
|
var sourceWindow = root.slotWindow(sourceSlot) || root.barDragWindow
|
||||||
for (var i = 0; i < debugModuleSlots.length; i++) {
|
for (var i = 0; i < moduleSlots.length; i++) {
|
||||||
var slot = debugModuleSlots[i]
|
var slot = moduleSlots[i]
|
||||||
if (!slot || slot === sourceSlot || !slot.visible || slot.width <= 0 || slot.height <= 0) continue
|
if (!slot || slot === sourceSlot || !slot.visible || slot.width <= 0 || slot.height <= 0) continue
|
||||||
if (sourceWindow && !root.sameWindow(root.slotWindow(slot), sourceWindow)) continue
|
if (sourceWindow && !root.sameWindow(root.slotWindow(slot), sourceWindow)) continue
|
||||||
|
|
||||||
@@ -506,8 +506,8 @@ Item {
|
|||||||
|
|
||||||
function visibleModuleSlot(region, name, sourceSlot) {
|
function visibleModuleSlot(region, name, sourceSlot) {
|
||||||
var sourceWindow = root.slotWindow(sourceSlot) || root.barDragWindow
|
var sourceWindow = root.slotWindow(sourceSlot) || root.barDragWindow
|
||||||
for (var i = 0; i < debugModuleSlots.length; i++) {
|
for (var i = 0; i < moduleSlots.length; i++) {
|
||||||
var slot = debugModuleSlots[i]
|
var slot = moduleSlots[i]
|
||||||
if (!slot || slot === sourceSlot || slot.region !== region || slot.moduleName !== name ||
|
if (!slot || slot === sourceSlot || slot.region !== region || slot.moduleName !== name ||
|
||||||
!slot.visible || slot.width <= 0 || slot.height <= 0) continue
|
!slot.visible || slot.width <= 0 || slot.height <= 0) continue
|
||||||
if (sourceWindow && !root.sameWindow(root.slotWindow(slot), sourceWindow)) continue
|
if (sourceWindow && !root.sameWindow(root.slotWindow(slot), sourceWindow)) continue
|
||||||
@@ -1271,10 +1271,10 @@ Item {
|
|||||||
height: implicitHeight
|
height: implicitHeight
|
||||||
z: modulePointer.dragging ? 100 : 0
|
z: modulePointer.dragging ? 100 : 0
|
||||||
|
|
||||||
Component.onCompleted: root.registerDebugModuleSlot(slot)
|
Component.onCompleted: root.registerModuleSlot(slot)
|
||||||
Component.onDestruction: {
|
Component.onDestruction: {
|
||||||
if (root.barDragSource === slot) root.clearBarDrag()
|
if (root.barDragSource === slot) root.clearBarDrag()
|
||||||
root.unregisterDebugModuleSlot(slot)
|
root.unregisterModuleSlot(slot)
|
||||||
}
|
}
|
||||||
|
|
||||||
HoverHandler { id: moduleHover }
|
HoverHandler { id: moduleHover }
|
||||||
|
|||||||
Reference in New Issue
Block a user