diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2026-09-02 18:26:45 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2026-09-02 18:26:45 +0800 |
| commit | f7a43077fe4e139dd7e3f46f448e0951740ec148 (patch) | |
| tree | f6a68248fe42bd899e99049bab7fdb7e5d26ea60 /components/IMouseArea.qml | |
| parent | 2f7576faf493b4667b02dcb60ddbf3aa0a9f654b (diff) | |
fix: qmlfmt
IListView: animation
Diffstat (limited to 'components/IMouseArea.qml')
| -rw-r--r-- | components/IMouseArea.qml | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/components/IMouseArea.qml b/components/IMouseArea.qml index 4c360ed..e817bca 100644 --- a/components/IMouseArea.qml +++ b/components/IMouseArea.qml @@ -4,42 +4,42 @@ import QtQuick MouseArea { - hoverEnabled: true + hoverEnabled: true - property real gx: Number.MAX_VALUE - property real gy: Number.MAX_VALUE + property real gx: Number.MAX_VALUE + property real gy: Number.MAX_VALUE - property bool hovered: false + property bool hovered: false - signal entered_ - signal positionChanged_(var mouse) + signal entered_ + signal positionChanged_(var mouse) - onPositionChanged: mouse => { - let gpos = mapToItem(null, mouse.x, mouse.y); + onPositionChanged: mouse => { + let gpos = mapToItem(null, mouse.x, mouse.y); - if (gx === Number.MAX_VALUE && gy === Number.MAX_VALUE) { - gx = gpos.x; - gy = gpos.y; - return; - } + if (gx === Number.MAX_VALUE && gy === Number.MAX_VALUE) { + gx = gpos.x; + gy = gpos.y; + return; + } - if (gpos.x === gx && gpos.y === gy) - return; + if (gpos.x === gx && gpos.y === gy) + return; - gx = gpos.x; - gy = gpos.y; + gx = gpos.x; + gy = gpos.y; - if (!hovered) { - hovered = true; - entered_(); - } + if (!hovered) { + hovered = true; + entered_(); + } - positionChanged_(mouse); - } + positionChanged_(mouse); + } - onExited: { - hovered = false; - gx = Number.MAX_VALUE; - gy = Number.MAX_VALUE; - } + onExited: { + hovered = false; + gx = Number.MAX_VALUE; + gy = Number.MAX_VALUE; + } } |
