NPanel: add border while dragging

This commit is contained in:
Ly-sec
2025-09-18 18:34:48 +02:00
parent 6fba3457f7
commit b8bce3d421
+28 -2
View File
@@ -428,10 +428,12 @@ Loader {
dragStartX = panelBackground.x
dragStartY = panelBackground.y
panelBackground.isDragged = true
if (root.enableBackgroundClick) root.disableBackgroundClick()
if (root.enableBackgroundClick)
root.disableBackgroundClick()
} else {
// Keep isDragged true so we continue using the manual x/y after release
if (root.enableBackgroundClick) root.enableBackgroundClick()
if (root.enableBackgroundClick)
root.enableBackgroundClick()
}
}
onTranslationChanged: {
@@ -449,6 +451,30 @@ Loader {
panelBackground.manualY = Math.round(Math.max(minY, Math.min(ny, maxY)))
}
}
// Drag indicator border
Rectangle {
anchors.fill: parent
anchors.margins: 0
color: Color.transparent
border.color: Color.mPrimary
border.width: Math.max(2, Style.borderL * scaling)
radius: parent.radius
visible: panelBackground.isDragged && dragHandler.active
opacity: 0.8
z: 3000
// Subtle glow effect
Rectangle {
anchors.fill: parent
anchors.margins: 0
color: Color.transparent
border.color: Color.mPrimary
border.width: Math.max(1, Style.borderS * scaling)
radius: parent.radius
opacity: 0.3
}
}
}
}
}