Files
TNCcat/qml/CupWindow.qml
T
JulianandClaude Opus 5 403ac30b3a Add a coffee break
Every so often a mug appears at the cat's nose, it sits down, dips its head in
and takes a few slow sips while steam rises. M01, optional stop.

The mug lives in its own click-through window like the chip, or inside the
overlay on Wayland. It goes away as soon as the cat is petted, dragged, sent to
sleep or moves on to something else, so no mug is ever left standing.

Also renames OverlayWindow's mode flag, which shadowed QWindow::active.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-10 23:00:22 +02:00

29 lines
865 B
QML

pragma ComponentBehavior: Bound
import QtQuick
import TNCat
// The mug stands on the ground next to the cat, click-through like the chip.
Window {
id: win
required property CatController cat
required property AppSettings settings
readonly property int cupSize: Math.round(settings.catSize * 0.38)
width: cupSize
height: Math.round(cupSize * 1.18)
x: cat.cupX - 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.cupVisible && !Platform.opaqueBackground
Cup {
anchors.fill: parent
}
}