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>
This commit is contained in:
JulianandClaude Opus 5 committed 2026-09-10 23:00:22 +02:00
1 parent 0f1df75a1d
commit 403ac30b3a
14 files changed
+283 -18

No files matched your search

+8 -7
View File
@@ -2,12 +2,12 @@
A little cat that wanders along the bottom edge of the screen, sits down, grooms
itself, stretches, dashes off and takes naps. Every now and then a curled steel
chip skitters past and the cat goes after it. Drag it around, tap it to pet it,
and it purrs.
chip skitters past and the cat goes after it, or a mug appears and the cat takes
a coffee break. Drag it around, tap it to pet it, and it purrs.
It announces what it is doing in the machine's own language: `G00` when it
sprints, `G01` when it strolls, `M08` while it washes, `G28` when it stretches
back to reference, `M30` when it goes to sleep.
back to reference, `M30` when it goes to sleep, `M01` when it stops for coffee.
The name is `TNC` plus `cat`, because the intended home is a HEIDENHAIN control
(TNC7, TNC 640). Primary target is therefore **Linux / X11**; development happens
@@ -22,16 +22,17 @@ plain Qt 6 / QML project.
|---|---|
| `CMakeLists.txt` | `qt_add_executable` + `qt_add_qml_module` (URI `TNCat`), macOS bundle, `.desktop` file on Linux |
| `src/main.cpp` | Wires `AppSettings` and `CatController` into the QML engine, warns on Wayland |
| `src/catcontroller.*` | Mood machine (walk, run, sit, groom, stretch, sleep, love, alert, chase, bat), movement tick, chip chase, cursor tracking |
| `src/catcontroller.*` | Mood machine (walk, run, sit, groom, stretch, sleep, love, alert, chase, bat, drink), movement tick, chip chase, coffee break, cursor tracking |
| `src/appsettings.*` | `QSettings`-backed coat, size, pace, ground line, eye tracking, pet counter |
| `src/platforminfo.*` | QML singleton `Platform`: platform name plus the X11 escape hatches |
| `src/traycontroller.*` | Tray icon and menu, silently skipped when the desktop has no tray |
| `qml/Main.qml` | Non-visual root that picks the window layout for the platform |
| `qml/CatWindow.qml`, `qml/ChipWindow.qml` | One small window each, positioned by the app. X11, macOS, Windows |
| `qml/CatWindow.qml`, `qml/ChipWindow.qml`, `qml/CupWindow.qml` | One small window each, positioned by the app. X11, macOS, Windows |
| `qml/OverlayWindow.qml` | One screen-filling click-through window holding both. Wayland |
| `qml/Cat.qml` | The drawing: rounded primitives plus `Shape` paths for tail, ears and mouth |
| `qml/Chip.qml` | The curled chip, a stroked `Shape` spiral |
| `qml/SettingsWindow.qml` | Coat swatches, size, pace, ground line, eye tracking, codes, chips, tricks |
| `qml/Cup.qml` | The coffee mug, with `Shape` steam wisps |
| `qml/SettingsWindow.qml` | Coat swatches, size, pace, ground line, eye tracking, codes, chips, coffee, tricks |
The cat is drawn in a fixed 100 x 90 design space and scaled by `width / 100`,
so every size setting stays crisp. There are no image assets, which keeps the
@@ -71,7 +72,7 @@ context menu.
## Two window layouts
On X11, macOS and Windows the cat and the chip each get their own small,
On X11, macOS and Windows the cat, the chip and the mug each get their own small,
frameless, always-on-top window, and the app moves those windows around. Nothing
else on screen is covered and no clicks are intercepted.