mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-06-02 18:42:04 +00:00
NPanel: add border while dragging
This commit is contained in:
+28
-2
@@ -428,10 +428,12 @@ Loader {
|
|||||||
dragStartX = panelBackground.x
|
dragStartX = panelBackground.x
|
||||||
dragStartY = panelBackground.y
|
dragStartY = panelBackground.y
|
||||||
panelBackground.isDragged = true
|
panelBackground.isDragged = true
|
||||||
if (root.enableBackgroundClick) root.disableBackgroundClick()
|
if (root.enableBackgroundClick)
|
||||||
|
root.disableBackgroundClick()
|
||||||
} else {
|
} else {
|
||||||
// Keep isDragged true so we continue using the manual x/y after release
|
// Keep isDragged true so we continue using the manual x/y after release
|
||||||
if (root.enableBackgroundClick) root.enableBackgroundClick()
|
if (root.enableBackgroundClick)
|
||||||
|
root.enableBackgroundClick()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onTranslationChanged: {
|
onTranslationChanged: {
|
||||||
@@ -449,6 +451,30 @@ Loader {
|
|||||||
panelBackground.manualY = Math.round(Math.max(minY, Math.min(ny, maxY)))
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user