1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-06-28 14:05:21 -04:00

feat(popouts): enhance hover functionality and introduce hover dismiss features

This commit is contained in:
purian23
2026-06-27 22:21:03 -04:00
parent 601d4104a3
commit a8c15fcde9
15 changed files with 1232 additions and 955 deletions
+13 -20
View File
@@ -2,34 +2,27 @@ pragma ComponentBehavior: Bound
import QtQuick
Item {
HoverHandler {
id: root
property bool enabled: false
property var shouldDismiss: null
signal dismissRequested
// Emitted on every hover move; passive to avoid blocking overlapping MouseAreas
signal hoverMoved(real gx, real gy)
anchors.fill: parent
HoverHandler {
id: hoverHandler
enabled: root.enabled
onPointChanged: {
if (!root.enabled || !hoverHandler.hovered)
return;
const gp = root.mapToItem(null, hoverHandler.point.position.x, hoverHandler.point.position.y);
root.hoverMoved(gp.x, gp.y);
}
onHoveredChanged: {
if (hoverHandler.hovered || !root.enabled)
return;
if (typeof root.shouldDismiss === "function" && !root.shouldDismiss())
return;
root.dismissRequested();
}
onPointChanged: {
if (!enabled || !hovered)
return;
const gp = parent.mapToItem(null, point.position.x, point.position.y);
hoverMoved(gp.x, gp.y);
}
onHoveredChanged: {
if (hovered || !enabled)
return;
if (typeof shouldDismiss === "function" && !shouldDismiss())
return;
dismissRequested();
}
function cancelPending() {