Files
TNCcat/qml/ChipWindow.qml
T
JulianandClaude Opus 5 0f1df75a1d Rename to TNCat, add chip chase, G-codes and a Wayland layout
The project is now TNCat, after HEIDENHAIN's TNC controls. Binary, QML module
URI, settings path, bundle id and .desktop entry follow; the environment
switches are TNCAT_*.

Entertainment: a curled steel chip skitters in every minute or two, the cat
runs it down and bats it away a few times before sitting back looking pleased.
Mood changes flash the matching machine code above its head, G00 for a sprint,
G01 for a stroll, M08 while it washes, G28 for a stretch, M30 for a nap.

Window handling was split into two layouts. X11 and macOS keep one small window
per object, positioned by the app. Wayland gets a screen-filling overlay whose
input region is masked down to the cat, since a Wayland client cannot place its
own window. Overlay mode is automatic there and available elsewhere via
TNCAT_OVERLAY=1.

Also adds a ground-line setting so the cat can walk above a softkey row.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-10 22:53:40 +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.45)
width: chipSize
height: Math.round(chipSize * 0.73)
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
kick: win.cat.chipKick
}
}