mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-15 18:43:59 +00:00
BarSectionEditor: cleaned up logs
This commit is contained in:
@@ -352,7 +352,7 @@ NBox {
|
|||||||
if (isLastItem && insertAtEnd) {
|
if (isLastItem && insertAtEnd) {
|
||||||
insertAtEnd = false
|
insertAtEnd = false
|
||||||
targetIndex = -1
|
targetIndex = -1
|
||||||
Logger.log("BarSectionEditor", "Last item dropped to right - no reordering needed")
|
//Logger.log("BarSectionEditor", "Last item dropped to right - no reordering needed")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Determine final target index based on position
|
// Determine final target index based on position
|
||||||
@@ -361,7 +361,7 @@ NBox {
|
|||||||
if (insertAtBeginning && widgetModel.length > 1) {
|
if (insertAtBeginning && widgetModel.length > 1) {
|
||||||
// Insert at the very beginning (position 0)
|
// Insert at the very beginning (position 0)
|
||||||
finalTargetIndex = 0
|
finalTargetIndex = 0
|
||||||
Logger.log("BarSectionEditor", "Inserting at beginning")
|
//Logger.log("BarSectionEditor", "Inserting at beginning")
|
||||||
} else if (insertAtEnd && widgetModel.length > 1) {
|
} else if (insertAtEnd && widgetModel.length > 1) {
|
||||||
// Insert at the very end
|
// Insert at the very end
|
||||||
let maxIndex = -1
|
let maxIndex = -1
|
||||||
@@ -371,7 +371,7 @@ NBox {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
finalTargetIndex = maxIndex
|
finalTargetIndex = maxIndex
|
||||||
Logger.log("BarSectionEditor", "Inserting at end, target:", finalTargetIndex)
|
//Logger.log("BarSectionEditor", "Inserting at end, target:", finalTargetIndex)
|
||||||
} else if (targetIndex !== -1) {
|
} else if (targetIndex !== -1) {
|
||||||
// Normal case - determine if we should insert before or after the target
|
// Normal case - determine if we should insert before or after the target
|
||||||
const targetWidget = widgetFlow.children[targetIndex]
|
const targetWidget = widgetFlow.children[targetIndex]
|
||||||
@@ -379,16 +379,16 @@ NBox {
|
|||||||
const targetCenterX = targetWidget.x + targetWidget.width / 2
|
const targetCenterX = targetWidget.x + targetWidget.width / 2
|
||||||
if (mouseX > targetCenterX) {
|
if (mouseX > targetCenterX) {
|
||||||
// Mouse is to the right of target center, insert after
|
// Mouse is to the right of target center, insert after
|
||||||
Logger.log("BarSectionEditor", "Inserting after widget at index:", targetIndex)
|
//Logger.log("BarSectionEditor", "Inserting after widget at index:", targetIndex)
|
||||||
} else {
|
} else {
|
||||||
// Mouse is to the left of target center, insert before
|
// Mouse is to the left of target center, insert before
|
||||||
finalTargetIndex = targetIndex
|
finalTargetIndex = targetIndex
|
||||||
Logger.log("BarSectionEditor", "Inserting before widget at index:", targetIndex)
|
//Logger.log("BarSectionEditor", "Inserting before widget at index:", targetIndex)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger.log("BarSectionEditor", "Final drop target index:", finalTargetIndex)
|
//Logger.log("BarSectionEditor", "Final drop target index:", finalTargetIndex)
|
||||||
|
|
||||||
// Check if reordering is needed
|
// Check if reordering is needed
|
||||||
if (finalTargetIndex !== -1 && finalTargetIndex !== draggedIndex) {
|
if (finalTargetIndex !== -1 && finalTargetIndex !== draggedIndex) {
|
||||||
@@ -402,7 +402,7 @@ NBox {
|
|||||||
draggedWidget.x = originalWidgetPos.x
|
draggedWidget.x = originalWidgetPos.x
|
||||||
draggedWidget.y = originalWidgetPos.y
|
draggedWidget.y = originalWidgetPos.y
|
||||||
draggedWidget.z = 0
|
draggedWidget.z = 0
|
||||||
Logger.log("BarSectionEditor", "No reordering - restoring original position")
|
//Logger.log("BarSectionEditor", "No reordering - restoring original position")
|
||||||
}
|
}
|
||||||
} else if (draggedIndex !== -1 && !dragStarted) {
|
} else if (draggedIndex !== -1 && !dragStarted) {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user