Files
TNCcat/qml/ChipWindow.qml
T
JulianandClaude Opus 5 f6ecf0ddbf Give the chip a box it fits in, and a spin that settles
The chip window was 60 x 44 with the curl tumbling about its centre. The curl
reaches 24.2 units from that pivot once the stroke is counted, so a half height
of 22 clipped the top and bottom off it on every turn.

The box is now 52 x 58 with the pivot at (26, 33), measured off the actual
Bezier curve rather than its control points. The shadow sits at 15.1 below the
pivot, which is where the curl comes to rest, so the chip lands on its own
shadow instead of floating above it.

The endless rotation is gone. Each bat now adds one or two whole turns in the
direction it was hit and coasts to a stop, so the resting silhouette is always
the same one, the one the shadow was placed under.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-11 07:12:11 +02:00

35 lines
1.0 KiB
QML

pragma ComponentBehavior: Bound
import QtQuick
import TNCat
// The chip gets its own little click-through window so it can skitter away
// from the cat across the whole screen.
Window {
id: win
required property CatController cat
required property AppSettings settings
readonly property int chipSize: Math.round(settings.catSize * 0.46)
width: chipSize
height: Math.round(chipSize * CatDefs.chipAspect)
x: cat.chipX - width / 2
y: Screen.desktopAvailableHeight - height - settings.bottomMargin
color: "transparent"
flags: Qt.FramelessWindowHint | Qt.WindowStaysOnTopHint | Qt.Tool
| Qt.NoDropShadowWindowHint | Qt.WindowDoesNotAcceptFocus
| Qt.WindowTransparentForInput
| (Platform.bypassWindowManager ? Qt.X11BypassWindowManagerHint : 0)
visible: cat.chipVisible && !Platform.opaqueBackground
Behavior on x {
NumberAnimation { duration: 320; easing.type: Easing.OutQuad }
}
Chip {
anchors.fill: parent
spin: win.cat.chipSpin
}
}