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>
This commit is contained in:
1 parent
acef398f49
commit
0f1df75a1d
19 files changed
+817
-185
No files matched your search
+45
-10
@@ -2,7 +2,7 @@ pragma ComponentBehavior: Bound
|
||||
import QtQuick
|
||||
import QtQuick.Controls.Basic
|
||||
import QtQuick.Layouts
|
||||
import Workcat
|
||||
import TNCat
|
||||
|
||||
Window {
|
||||
id: win
|
||||
@@ -20,10 +20,10 @@ Window {
|
||||
]
|
||||
|
||||
width: 440
|
||||
height: 600
|
||||
height: 700
|
||||
minimumWidth: 380
|
||||
minimumHeight: 520
|
||||
title: qsTr("Workcat")
|
||||
minimumHeight: 600
|
||||
title: qsTr("TNCat")
|
||||
color: "#faf7f2"
|
||||
flags: Qt.Dialog | Qt.WindowStaysOnTopHint
|
||||
|
||||
@@ -35,20 +35,24 @@ Window {
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
spacing: 16
|
||||
Cat {
|
||||
Loader {
|
||||
Layout.preferredWidth: 110
|
||||
Layout.preferredHeight: 99
|
||||
coat: win.settings.coat
|
||||
mood: "sitting"
|
||||
petted: previewHover.hovered
|
||||
HoverHandler { id: previewHover }
|
||||
active: win.visible
|
||||
sourceComponent: Cat {
|
||||
coat: win.settings.coat
|
||||
mood: "sitting"
|
||||
showCodes: false
|
||||
petted: previewHover.hovered
|
||||
HoverHandler { id: previewHover }
|
||||
}
|
||||
}
|
||||
ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
spacing: 4
|
||||
Label {
|
||||
Layout.fillWidth: true
|
||||
text: qsTr("Workcat")
|
||||
text: qsTr("TNCat")
|
||||
font.pixelSize: 26
|
||||
font.bold: true
|
||||
color: "#2f2a36"
|
||||
@@ -122,6 +126,22 @@ Window {
|
||||
onMoved: win.settings.walkSpeed = value
|
||||
}
|
||||
|
||||
Label { text: qsTr("Ground line") }
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
Slider {
|
||||
id: marginSlider
|
||||
Layout.fillWidth: true
|
||||
from: 0; to: 600; stepSize: 10
|
||||
value: win.settings.bottomMargin
|
||||
onMoved: win.settings.bottomMargin = value
|
||||
}
|
||||
Label {
|
||||
Layout.preferredWidth: 54
|
||||
text: qsTr("%1 px").arg(Math.round(marginSlider.value))
|
||||
}
|
||||
}
|
||||
|
||||
Label { text: qsTr("Eyes") }
|
||||
Switch {
|
||||
text: qsTr("Follow the mouse")
|
||||
@@ -129,6 +149,20 @@ Window {
|
||||
onToggled: win.settings.followCursor = checked
|
||||
}
|
||||
|
||||
Label { text: qsTr("Codes") }
|
||||
Switch {
|
||||
text: qsTr("Show G-code above the cat")
|
||||
checked: win.settings.showCodes
|
||||
onToggled: win.settings.showCodes = checked
|
||||
}
|
||||
|
||||
Label { text: qsTr("Chips") }
|
||||
Switch {
|
||||
text: qsTr("Let a chip skitter past now and then")
|
||||
checked: win.settings.chipsEnabled
|
||||
onToggled: win.settings.chipsEnabled = checked
|
||||
}
|
||||
|
||||
Label { text: qsTr("Cat") }
|
||||
Switch {
|
||||
text: checked ? qsTr("Napping") : qsTr("Awake")
|
||||
@@ -148,6 +182,7 @@ Window {
|
||||
Button { text: qsTr("Stretch"); onClicked: win.cat.doTrick(CatController.Stretching) }
|
||||
Button { text: qsTr("Dash"); onClicked: win.cat.doTrick(CatController.Running) }
|
||||
Button { text: qsTr("Nap"); onClicked: win.cat.doTrick(CatController.Sleeping) }
|
||||
Button { text: qsTr("Toss a chip"); onClicked: win.cat.tossChip() }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user