From d29866ee2768266d6eb2f9f6e1d1f3919fe9e25e Mon Sep 17 00:00:00 2001 From: uncor3 Date: Mon, 8 Jun 2026 21:00:53 +0000 Subject: [PATCH] feat(StatusWindow): impl StatusWindow component --- src/ui/StatusWindow.qml | 91 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 src/ui/StatusWindow.qml diff --git a/src/ui/StatusWindow.qml b/src/ui/StatusWindow.qml new file mode 100644 index 0000000..2883db0 --- /dev/null +++ b/src/ui/StatusWindow.qml @@ -0,0 +1,91 @@ +pragma Singleton +import QtQuick +import QtQuick.Controls +import QtQuick.Window +import QtQuick.Layouts + +Window { + id: window + ListModel { id : processesList } + + width: 300 + height: 300 + visible: false + + flags: Qt.ToolTip + | Qt.FramelessWindowHint + | Qt.WindowStaysOnTopHint + + color: "transparent" + + Component.onCompleted : { + // TODO: remove + processesList.append({ + "processId": "test-process-001", + "title": "Exporting Project Files", + "type": "Export", + "status": "Running", + "currentFile": "Copying: /documents/report.pdf", + "totalBytes": 10485760, + "transferredBytes": 5242880, + "totalItems": 42, + "completedItems": 23, + "failedItems": 2, + "destinationPath": "/Users/username/Downloads/Exports", + "onComplete": null + }) + } + + Rectangle { + anchors.fill: parent + radius: 10 + color: "#333" + + ColumnLayout { + anchors.fill: parent + Repeater { + model : processesList + delegate : Item { + Layout.fillWidth: true + Layout.preferredHeight: 250 + StatusWindowProcess { + anchors.fill: parent + title: model.title + type: model.type + status: model.status + currentFile: model.currentFile + totalBytes: model.totalBytes + transferredBytes: model.transferredBytes + totalItems: model.totalItems + completedItems: model.completedItems + failedItems: model.failedItems + destinationPath: model.destinationPath + onComplete: model.onComplete + processId: model.processId + } + } + } + } + + } + + function toggle(parentWindow, globalPos) { + if (window.visible) { + window.hide() + return + } + + var targetX = globalPos.x - (window.width / 2) + var targetY = globalPos.y - window.height + + + transientParent = parentWindow + + window.show() + + window.x = targetX + window.y = targetY + + window.raise() + } +} \ No newline at end of file