Fix modular bar (remove option)

This commit is contained in:
Ly-sec 2025-08-23 16:03:23 +02:00
parent e04c4e1394
commit b85d68f4cb
2 changed files with 26 additions and 0 deletions

View file

@ -175,6 +175,19 @@ NBox {
drag.target: parent
onPressed: {
// Check if the click is on the close button area
const closeButtonX = widgetContent.x + widgetContent.width - 20 * scaling
const closeButtonY = widgetContent.y
const closeButtonWidth = 20 * scaling
const closeButtonHeight = 20 * scaling
if (mouseX >= closeButtonX && mouseX <= closeButtonX + closeButtonWidth &&
mouseY >= closeButtonY && mouseY <= closeButtonY + closeButtonHeight) {
// Click is on the close button, don't start drag
mouse.accepted = false
return
}
Logger.log("NWidgetCard", `Started dragging widget: ${modelData} at index ${index}`)
// Bring to front when starting drag
widgetItem.z = 1000