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:
1 parent
0f1df75a1d
commit
403ac30b3a
14 files changed
+283
-18
No files matched your search
+13
-5
@@ -15,7 +15,7 @@ Window {
|
||||
|
||||
// Fullscreen is a visibility, not a visible flag, so the mode switch has to
|
||||
// go through visibility or the two fight each other.
|
||||
property bool active: false
|
||||
property bool overlayActive: false
|
||||
|
||||
readonly property int catW: settings.catSize
|
||||
readonly property int catH: Math.round(settings.catSize * 0.9)
|
||||
@@ -26,14 +26,14 @@ Window {
|
||||
Platform.setInputRegion(win, Qt.rect(Math.round(cat.x), Math.round(groundY), catW, catH))
|
||||
}
|
||||
|
||||
visibility: active ? Window.FullScreen : Window.Hidden
|
||||
visibility: overlayActive ? Window.FullScreen : Window.Hidden
|
||||
color: "transparent"
|
||||
flags: Qt.FramelessWindowHint | Qt.WindowStaysOnTopHint | Qt.Tool
|
||||
| Qt.NoDropShadowWindowHint | Qt.WindowDoesNotAcceptFocus
|
||||
title: qsTr("TNCat")
|
||||
|
||||
onActiveChanged: {
|
||||
if (!active)
|
||||
onOverlayActiveChanged: {
|
||||
if (!overlayActive)
|
||||
return
|
||||
cat.stageWidth = width
|
||||
cat.catWidth = catW
|
||||
@@ -51,7 +51,7 @@ Window {
|
||||
// Coalesce mask updates: one X11 round trip per frame of walking is plenty.
|
||||
Timer {
|
||||
interval: 33
|
||||
running: win.active
|
||||
running: win.overlayActive
|
||||
repeat: true
|
||||
onTriggered: win.refreshInputRegion()
|
||||
}
|
||||
@@ -69,6 +69,14 @@ Window {
|
||||
}
|
||||
}
|
||||
|
||||
Cup {
|
||||
x: win.cat.cupX - width / 2
|
||||
y: win.height - height - win.settings.bottomMargin
|
||||
width: Math.round(win.settings.catSize * 0.38)
|
||||
height: Math.round(width * 1.18)
|
||||
visible: win.cat.cupVisible
|
||||
}
|
||||
|
||||
Item {
|
||||
id: catItem
|
||||
x: win.cat.x
|
||||
|
||||
Reference in new issue
Block a user