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
+5
-8
@@ -1,7 +1,6 @@
|
||||
#include <QApplication>
|
||||
#include <QQmlApplicationEngine>
|
||||
#include <QQuickStyle>
|
||||
#include <QQuickWindow>
|
||||
#include <QLoggingCategory>
|
||||
|
||||
#include "appsettings.h"
|
||||
@@ -10,9 +9,8 @@
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QCoreApplication::setOrganizationName("workcat");
|
||||
QCoreApplication::setOrganizationDomain("workcat.app");
|
||||
QCoreApplication::setApplicationName("Workcat");
|
||||
QCoreApplication::setOrganizationName("TNCat");
|
||||
QCoreApplication::setApplicationName("TNCat");
|
||||
QApplication::setQuitOnLastWindowClosed(false);
|
||||
|
||||
// QApplication (not QGuiApplication) so QSystemTrayIcon can show a menu.
|
||||
@@ -24,7 +22,7 @@ int main(int argc, char *argv[])
|
||||
TrayController tray(&cat);
|
||||
|
||||
if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"))) {
|
||||
qWarning("Workcat: Wayland does not let a client place its own window. "
|
||||
qWarning("TNCat: Wayland does not let a client place its own window. "
|
||||
"Run with QT_QPA_PLATFORM=xcb for the cat to walk.");
|
||||
}
|
||||
|
||||
@@ -35,10 +33,9 @@ int main(int argc, char *argv[])
|
||||
});
|
||||
QObject::connect(&engine, &QQmlApplicationEngine::objectCreationFailed, &app,
|
||||
[] { QCoreApplication::exit(1); }, Qt::QueuedConnection);
|
||||
engine.loadFromModule("Workcat", "Main");
|
||||
engine.loadFromModule("TNCat", "Main");
|
||||
|
||||
if (auto *root = qobject_cast<QQuickWindow *>(engine.rootObjects().value(0))) {
|
||||
cat.setWindow(root);
|
||||
if (QObject *root = engine.rootObjects().value(0)) {
|
||||
QObject::connect(&tray, &TrayController::settingsRequested, root,
|
||||
[root] { QMetaObject::invokeMethod(root, "openSettings"); });
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user